コード例 #1
0
ファイル: utils_test.py プロジェクト: g-weatherill/hmtk
 def test_input_checks_simple_input(self):
     completeness_table = [[1900, 2.0]]
     catalogue = Catalogue.make_from_dict({
         'magnitude': [5.0, 6.0],
         'year': [2000, 2000]
     })
     config = {}
     rec_utils.input_checks(catalogue, config, completeness_table)
コード例 #2
0
 def test_input_checks_sets_magnitude_interval(self):
     fake_completeness_table = 0.0
     catalogue = {'year': [1900]}
     config = {'magnitude_interval': 0.1}
     cmag, ctime, ref_mag, dmag = rec_utils.input_checks(
         catalogue, config, fake_completeness_table)
     self.assertEqual(0.1, dmag)
コード例 #3
0
ファイル: b_maximum_likelihood.py プロジェクト: matley/hmtk
    def calculate(self, catalogue, config, completeness=None, end_year=None):
        """ Calculates recurrence parameters a_value and b_value, and their 
        respective uncertainties

        :param dict catalogue: Earthquake Catalogue 
            An instance of :class:`hmtk.seismicity.catalogue`
        :param dict config: 
            A configuration dictionary; the only parameter that can be 
            defined in this case if the type of average to be applied 
            in the calculation
        :param list or numpy.ndarray completeness: 
            Completeness table
        :param int end_year: 
            Catalogue termination year 
        """

        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config,
                                                    completeness)

        # Fix the end year
        if end_year is None:
            end_year = np.max(catalogue['year'])

        # Check the configuration
        if not config['Average Type'] in ['Weighted','Harmonic']:
            raise ValueError('Average type not recognised in bMaxLiklihood!')

        return self._b_ml(catalogue, config, cmag, ctime, ref_mag, 
                dmag, end_year)
コード例 #4
0
ファイル: weichert.py プロジェクト: atalayayele/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Calculates recurrence using the Weichert (1980) method'''
        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config,
                                                   completeness)
        # Apply Weichert preparation
        cent_mag, t_per, n_obs = self._weichert_prep(catalogue['year'],
                                                     catalogue['magnitude'],
                                                     ctime, cmag, dmag)

        # A few more Weichert checks
        key_list = config.keys()
        if (not 'bvalue' in key_list) or (not config['bvalue']):
            config['bvalue'] = 1.0
        if (not 'itstab' in key_list) or (not config['itstab']):
            config['itstab'] = 1E-5
        if (not 'maxiter' in key_list) or (not config['maxiter']):
            config['maxiter'] = 1000

        bval, sigma_b, rate, sigma_rate, aval, sigma_a = \
            self.weichert_algorithm(t_per, cent_mag, n_obs, ref_mag, 
            config['bvalue'], config['itstab'], config['maxiter'])

        if not 'reference_magnitude' in config:
            rate = np.log10(aval)
            sigma_rate = np.log10(sigma_a)

        return bval, sigma_b, rate, sigma_rate
コード例 #5
0
ファイル: weichert.py プロジェクト: lcui24/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Calculates recurrence using the Weichert (1980) method'''
        # Input checks
        cmag, ctime, ref_mag, dmag, config = input_checks(catalogue,
                                                          config,
                                                          completeness)
        # Apply Weichert preparation
        cent_mag, t_per, n_obs = self._weichert_prep(
            catalogue.data['year'],
            catalogue.data['magnitude'],
            ctime, cmag, dmag)

        # A few more Weichert checks
        key_list = config.keys()
        if (not 'bvalue' in key_list) or (not config['bvalue']):
            config['bvalue'] = 1.0
        if (not 'itstab' in key_list) or (not config['itstab']):
            config['itstab'] = 1E-5
        if (not 'maxiter' in key_list) or (not config['maxiter']):
            config['maxiter'] = 1000
        bval, sigma_b, rate, sigma_rate, aval, sigma_a = \
            self.weichert_algorithm(t_per, cent_mag, n_obs, ref_mag,
            config['bvalue'], config['itstab'], config['maxiter'])
       
        if not config['reference_magnitude']:
            rate = np.log10(aval)
            sigma_rate = np.log10(aval + sigma_a) - np.log10(aval)

        return bval, sigma_b, rate, sigma_rate
コード例 #6
0
ファイル: weichert.py プロジェクト: julgp/hmtk
    def calculate(self, catalogue, config, completeness=None):
        """Calculates recurrence using the Weichert (1980) method"""
        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config, completeness)
        # Apply Weichert preparation
        cent_mag, t_per, n_obs = self._weichert_prep(catalogue["year"], catalogue["magnitude"], ctime, cmag, dmag)

        # A few more Weichert checks
        key_list = config.keys()
        if (not "bvalue" in key_list) or (not config["bvalue"]):
            config["bvalue"] = 1.0
        if (not "itstab" in key_list) or (not config["itstab"]):
            config["itstab"] = 1e-5
        if (not "maxiter" in key_list) or (not config["maxiter"]):
            config["maxiter"] = 1000

        bval, sigma_b, rate, sigma_rate, aval, sigma_a = self.weichert_algorithm(
            t_per, cent_mag, n_obs, ref_mag, config["bvalue"], config["itstab"], config["maxiter"]
        )

        if not "reference_magnitude" in config:
            rate = np.log10(aval)
            sigma_rate = np.log10(sigma_a)

        return bval, sigma_b, rate, sigma_rate
コード例 #7
0
    def calculate(self, catalogue, config=None, completeness=None):
        """ Calculation of b-value and its uncertainty for a given 
        catalogue, using the maximum likelihood method of Aki (1965), 
        with a correction for discrete bin width (Bender, 1983).

        :param catalogue:
            See :class:`hmtk.seismicity.occurrence.base.py' for further 
            explanation
        :param config:
            The configuration in this case do not contains specific 
            information
        :keyword float completeness: 
            Completeness magnitude

        :return float bval:
            b-value of the Gutenberg-Richter relationship
        :return float sigma_b:
            Standard deviation of the GR b-value
        """
        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config,
                                                    completeness)
        rt = recurrence_table(catalogue['magnitude'], dmag, catalogue['year'])
        bval, sigma_b = self._aki_ml(rt[:,0], rt[:,1])
        return bval, sigma_b 
コード例 #8
0
ファイル: utils_test.py プロジェクト: g-weatherill/hmtk
 def test_input_checks_use_reference_magnitude(self):
     fake_completeness_table = 0.0
     catalogue = Catalogue.make_from_dict({'year': [1900]})
     config = {'reference_magnitude' : 3.0}
     cmag, ctime, ref_mag, dmag, _ = rec_utils.input_checks(catalogue,
             config, fake_completeness_table)
     self.assertEqual(3.0, ref_mag)
コード例 #9
0
    def calculate(self, catalogue, config=None, completeness=None):
        """ Calculation of b-value and its uncertainty for a given
        catalogue, using the maximum likelihood method of Aki (1965),
        with a correction for discrete bin width (Bender, 1983).

        :param catalogue:
            See :class:`hmtk.seismicity.occurrence.base.py' for further
            explanation
        :param config:
            The configuration in this case do not contains specific
            information
        :keyword float completeness:
            Completeness magnitude

        :return float bval:
            b-value of the Gutenberg-Richter relationship
        :return float sigma_b:
            Standard deviation of the GR b-value
        """
        # Input checks
        _cmag, _ctime, _ref_mag, dmag, config = input_checks(
            catalogue, config, completeness)
        rt = recurrence_table(catalogue.data['magnitude'], dmag,
                              catalogue.data['year'])
        bval, sigma_b = self._aki_ml(rt[:, 0], rt[:, 1])
        return bval, sigma_b
コード例 #10
0
ファイル: kijko_smit.py プロジェクト: matley/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Main function to calculate the a- and b-value'''
        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config,
                                                  completeness)
        ival = 0
        mag_eq_tolerance = 1E-5
        number_intervals = np.shape(ctime)[0]
        b_est = np.zeros(number_intervals, dtype=float)
        neq = np.zeros(number_intervals, dtype=float)
        nyr = np.zeros(number_intervals, dtype=float)

        for ival in range(0, number_intervals):
            id0 = np.abs(ctime - ctime[ival]) < mag_eq_tolerance
            m_c = np.min(cmag[id0])
            if ival == number_intervals - 1:
                id1 = np.logical_and(
                    catalogue['year'] >= ctime[ival], catalogue['magnitude'] >=
                    (m_c - mag_eq_tolerance))
            else:
                id1 = np.logical_and(catalogue['year'] >= ctime[ival],
                                     catalogue['year'] < ctime[ival + 1])
                id1 = np.logical_and(
                    id1, catalogue['magnitude'] >= (m_c - mag_eq_tolerance))

#        while ival < number_intervals:
#            id0 = np.abs(ctime - ctime[ival]) < mag_eq_tolerance
#            m_c = np.min(cmag[id0])
#            # Find events later than cut-off year, and with magnitude
#            # greater than or equal to the corresponding completeness magnitude.
#            # m_c - mag_eq_tolerance is required to correct floating point
#            # differences.
#            id1 = np.logical_and(catalogue['year'] >= ctime[ival],
#                catalogue['magnitude'] >= (m_c - mag_eq_tolerance))
            nyr[ival] = np.float(
                np.max(catalogue['year'][id1]) -
                np.min(catalogue['year'][id1]) + 1)
            neq[ival] = np.sum(id1)
            # Get a- and b- value for the selected events
            temp_rec_table = recurrence_table(catalogue['magnitude'][id1],
                                              dmag, catalogue['year'][id1])

            aki_ml = AkiMaxLikelihood()
            b_est[ival] = aki_ml._aki_ml(temp_rec_table[:, 0],
                                         temp_rec_table[:, 1], dmag, m_c)[0]
            ival += 1

        total_neq = np.float(np.sum(neq))
        bval = self._harmonic_mean(b_est, neq)
        sigma_b = bval / np.sqrt(total_neq)
        aval = self._calculate_a_value(bval, total_neq, nyr, cmag, ref_mag)
        sigma_a = self._calculate_a_value(bval + sigma_b, total_neq, nyr, cmag,
                                          ref_mag)

        if not 'reference_magnitude' in config:
            aval = np.log10(aval)
            sigma_a = np.log10(sigma_a) - aval
        else:
            sigma_a = sigma_a - aval
        return bval, sigma_b, aval, sigma_a
コード例 #11
0
ファイル: weichert.py プロジェクト: GEMScienceTools/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Calculates recurrence using the Weichert (1980) method'''
        # Input checks
        cmag, ctime, ref_mag, _, config = input_checks(catalogue, config,
                                                       completeness)
        if not "dtime" in catalogue.data.keys() or not\
            len(catalogue.data["dtime"]):
            catalogue.data["dtime"] = catalogue.get_decimal_time()
        if not catalogue.end_year:
            catalogue.update_end_year()
        if completeness is None:
            start_year = float(np.min(catalogue.data["year"]))
            completeness = np.column_stack([ctime, cmag])
        # Apply Weichert preparation
        cent_mag, t_per, n_obs = get_completeness_counts(
            catalogue, completeness, config["magnitude_interval"])

        # A few more Weichert checks
        key_list = config.keys()
        if (not 'bvalue' in key_list) or (not config['bvalue']):
            config['bvalue'] = 1.0
        if (not 'itstab' in key_list) or (not config['itstab']):
            config['itstab'] = 1E-5
        if (not 'maxiter' in key_list) or (not config['maxiter']):
            config['maxiter'] = 1000
        bval, sigma_b, rate, sigma_rate, aval, sigma_a = \
            self.weichert_algorithm(t_per, cent_mag, n_obs, ref_mag,
            config['bvalue'], config['itstab'], config['maxiter'])

        if not config['reference_magnitude']:
            rate = np.log10(aval)
            sigma_rate = np.log10(aval + sigma_a) - np.log10(aval)

        return bval, sigma_b, rate, sigma_rate
コード例 #12
0
ファイル: weichert.py プロジェクト: GEMScienceTools/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Calculates recurrence using the Weichert (1980) method'''
        # Input checks
        cmag, ctime, ref_mag, _, config = input_checks(catalogue,
                                                       config,
                                                       completeness)
        if not "dtime" in catalogue.data.keys() or not\
            len(catalogue.data["dtime"]):
            catalogue.data["dtime"] = catalogue.get_decimal_time()
        if not catalogue.end_year:
            catalogue.update_end_year()
        if completeness is None:
            start_year = float(np.min(catalogue.data["year"]))
            completeness = np.column_stack([ctime, cmag])
        # Apply Weichert preparation
        cent_mag, t_per, n_obs = get_completeness_counts(
            catalogue, completeness, config["magnitude_interval"])

        # A few more Weichert checks
        key_list = config.keys()
        if (not 'bvalue' in key_list) or (not config['bvalue']):
            config['bvalue'] = 1.0
        if (not 'itstab' in key_list) or (not config['itstab']):
            config['itstab'] = 1E-5
        if (not 'maxiter' in key_list) or (not config['maxiter']):
            config['maxiter'] = 1000
        bval, sigma_b, rate, sigma_rate, aval, sigma_a = \
            self.weichert_algorithm(t_per, cent_mag, n_obs, ref_mag,
            config['bvalue'], config['itstab'], config['maxiter'])
       
        if not config['reference_magnitude']:
            rate = np.log10(aval)
            sigma_rate = np.log10(aval + sigma_a) - np.log10(aval)

        return bval, sigma_b, rate, sigma_rate
コード例 #13
0
ファイル: kijko_smit.py プロジェクト: francescovisini/hmtk
    def calculate(self, catalogue, config, completeness=None):
        """
        Main function to calculate the a- and b-value
        """
        # Input checks
        cmag, ctime, ref_mag, dmag, config = input_checks(catalogue,
                                                          config,
                                                          completeness)
        ival = 0
        tolerance = 1E-7
        number_intervals = np.shape(ctime)[0]
        b_est = np.zeros(number_intervals, dtype=float)
        neq = np.zeros(number_intervals, dtype=float)
        nyr = np.zeros(number_intervals, dtype=float)

        for ival in range(0, number_intervals):
            id0 = np.abs(ctime - ctime[ival]) < tolerance
            m_c = np.min(cmag[id0])
            if ival == 0:
                id1 = np.logical_and(
                    catalogue.data['year'] >= (ctime[ival] - tolerance),
                    catalogue.data['magnitude'] >= (m_c - tolerance))
                nyr[ival] = float(catalogue.end_year) - ctime[ival] + 1.
            elif ival == number_intervals - 1:
                id1 = np.logical_and(
                    catalogue.data['year'] < (ctime[ival - 1] - tolerance),
                    catalogue.data['magnitude'] >= (m_c - tolerance))
                nyr[ival] = ctime[ival - 1] - ctime[ival]
            else:
                id1 = np.logical_and(
                    catalogue.data['year'] >= (ctime[ival] - tolerance),
                    catalogue.data['year'] < (ctime[ival - 1] - tolerance))
                id1 = np.logical_and(id1,
                    catalogue.data['magnitude'] > (m_c - tolerance))
                nyr[ival] = ctime[ival - 1] - ctime[ival]
            neq[ival] = np.sum(id1)
            #print ival, m_c, ctime, neq, np.where(id1)[0]
            # Get a- and b- value for the selected events
            temp_rec_table = recurrence_table(catalogue.data['magnitude'][id1],
                                              dmag,
                                              catalogue.data['year'][id1])

            aki_ml = AkiMaxLikelihood()
            b_est[ival] = aki_ml._aki_ml(temp_rec_table[:, 0],
                                         temp_rec_table[:, 1],
                                         dmag, m_c)[0]
            ival += 1
        total_neq = np.float(np.sum(neq))
        bval = self._harmonic_mean(b_est, neq)
        sigma_b = bval / np.sqrt(total_neq)
        aval = self._calculate_a_value(bval, total_neq, nyr, cmag, ref_mag)
        sigma_a = self._calculate_a_value(bval + sigma_b, total_neq, nyr,
                                          cmag, ref_mag)

        if not config['reference_magnitude']:
            aval = np.log10(aval)
            sigma_a = np.log10(sigma_a) - aval
        else:
            sigma_a = sigma_a - aval
        return bval, sigma_b, aval, sigma_a
コード例 #14
0
 def test_input_checks_use_reference_magnitude(self):
     fake_completeness_table = 0.0
     catalogue = {'year': [1900]}
     config = {'reference_magnitude': 3.0}
     cmag, ctime, ref_mag, dmag = rec_utils.input_checks(
         catalogue, config, fake_completeness_table)
     self.assertEqual(3.0, ref_mag)
コード例 #15
0
ファイル: utils_test.py プロジェクト: g-weatherill/hmtk
 def test_input_checks_sets_magnitude_interval(self):
     fake_completeness_table = 0.0
     catalogue = Catalogue.make_from_dict({'year': [1900]})
     config = {'magnitude_interval' : 0.1}
     cmag, ctime, ref_mag, dmag, _ = rec_utils.input_checks(catalogue,
             config, fake_completeness_table)
     self.assertEqual(0.1, dmag)
コード例 #16
0
ファイル: kijko_smit.py プロジェクト: lcui24/hmtk
    def calculate(self, catalogue, config, completeness=None):
        """
        Main function to calculate the a- and b-value
        """
        # Input checks
        cmag, ctime, ref_mag, dmag, config = input_checks(
            catalogue, config, completeness)
        ival = 0
        tolerance = 1E-7
        number_intervals = np.shape(ctime)[0]
        b_est = np.zeros(number_intervals, dtype=float)
        neq = np.zeros(number_intervals, dtype=float)
        nyr = np.zeros(number_intervals, dtype=float)

        for ival in range(0, number_intervals):
            id0 = np.abs(ctime - ctime[ival]) < tolerance
            m_c = np.min(cmag[id0])
            if ival == 0:
                id1 = np.logical_and(
                    catalogue.data['year'] >= (ctime[ival] - tolerance),
                    catalogue.data['magnitude'] >= (m_c - tolerance))
                nyr[ival] = float(catalogue.end_year) - ctime[ival] + 1.
            elif ival == number_intervals - 1:
                id1 = np.logical_and(
                    catalogue.data['year'] < (ctime[ival - 1] - tolerance),
                    catalogue.data['magnitude'] >= (m_c - tolerance))
                nyr[ival] = ctime[ival - 1] - ctime[ival]
            else:
                id1 = np.logical_and(
                    catalogue.data['year'] >= (ctime[ival] - tolerance),
                    catalogue.data['year'] < (ctime[ival - 1] - tolerance))
                id1 = np.logical_and(
                    id1, catalogue.data['magnitude'] > (m_c - tolerance))
                nyr[ival] = ctime[ival - 1] - ctime[ival]
            neq[ival] = np.sum(id1)
            #print ival, m_c, ctime, neq, np.where(id1)[0]
            # Get a- and b- value for the selected events
            temp_rec_table = recurrence_table(catalogue.data['magnitude'][id1],
                                              dmag,
                                              catalogue.data['year'][id1])

            aki_ml = AkiMaxLikelihood()
            b_est[ival] = aki_ml._aki_ml(temp_rec_table[:, 0],
                                         temp_rec_table[:, 1], dmag, m_c)[0]
            ival += 1
        total_neq = np.float(np.sum(neq))
        bval = self._harmonic_mean(b_est, neq)
        sigma_b = bval / np.sqrt(total_neq)
        aval = self._calculate_a_value(bval, total_neq, nyr, cmag, ref_mag)
        sigma_a = self._calculate_a_value(bval + sigma_b, total_neq, nyr, cmag,
                                          ref_mag)

        if not config['reference_magnitude']:
            aval = np.log10(aval)
            sigma_a = np.log10(sigma_a) - aval
        else:
            sigma_a = sigma_a - aval
        return bval, sigma_b, aval, sigma_a
コード例 #17
0
ファイル: kijko_smith.py プロジェクト: atalayayele/hmtk
    def calculate(self, catalogue, config, completeness=None):
        '''Main function to calculate the a- and b-value'''
        # Input checks
        cmag, ctime, ref_mag, dmag = input_checks(catalogue, config, 
                                                   completeness)
        ival = 0
        mag_eq_tolerance = 1E-5
        number_intervals = np.shape(ctime)[0]
        b_est = np.zeros(number_intervals, dtype=float)
        neq = np.zeros(number_intervals, dtype=float)
        nyr = np.zeros(number_intervals, dtype=float)
        while ival < number_intervals:
            id0 = np.abs(ctime - ctime[ival]) < mag_eq_tolerance
            m_c = np.min(cmag[id0])
            # Find events later than cut-off year, and with magnitude
            # greater than or equal to the corresponding completeness magnitude.
            # m_c - mag_eq_tolerance is required to correct floating point
            # differences.
            id1 = np.logical_and(catalogue['year'] >= ctime[ival],
                catalogue['magnitude'] >= (m_c - mag_eq_tolerance))
            nyr[ival] = np.float(np.max(catalogue['year'][id1]) -
                                 np.min(catalogue['year'][id1]) + 1)
            neq[ival] = np.sum(id1)
            # Get a- and b- value for the selected events
            temp_rec_table = recurrence_table(catalogue['magnitude'][id1], 
                                              dmag, 
                                              catalogue['year'][id1])

            aki_ml = AkiMaxLikelihood()
            b_est[ival]= aki_ml._aki_ml(temp_rec_table[:, 0], 
                                        temp_rec_table[:, 1], 
                                        dmag, m_c)[0]
            ival += 1

        total_neq = np.float(np.sum(neq))
        bval = self._harmonic_mean(b_est, neq)
        sigma_b = bval / np.sqrt(total_neq)
        aval = self._calculate_a_value(bval, total_neq, nyr, cmag, ref_mag)
        sigma_a = self._calculate_a_value(bval + sigma_b, total_neq, nyr, 
                                          cmag, ref_mag)

        if not 'reference_magnitude' in config:
            aval = np.log10(aval)
            sigma_a = np.log10(sigma_a) - aval
        else: 
            sigma_a = sigma_a - aval
        return bval, sigma_b, aval, sigma_a 
コード例 #18
0
ファイル: utils_test.py プロジェクト: juliogarciagem/hmtk
 def test_input_checks_simple_input(self):
     completeness_table = [[1900, 2.0]]
     catalogue = {"magnitude": [5.0, 6.0], "year": [2000, 2000]}
     config = {}
     rec_utils.input_checks(catalogue, config, completeness_table)
コード例 #19
0
ファイル: utils_test.py プロジェクト: juliogarciagem/hmtk
 def test_input_checks_sets_magnitude_interval(self):
     fake_completeness_table = 0.0
     catalogue = {"year": [1900]}
     config = {"magnitude_interval": 0.1}
     cmag, ctime, ref_mag, dmag = rec_utils.input_checks(catalogue, config, fake_completeness_table)
     self.assertEqual(0.1, dmag)
コード例 #20
0
ファイル: utils_test.py プロジェクト: g-weatherill/hmtk
 def test_input_checks_use_a_float_for_completeness(self):
     fake_completeness_table = 0.0
     catalogue = Catalogue.make_from_dict({'year': [1900]})
     config = {}
     rec_utils.input_checks(catalogue, config, fake_completeness_table)
コード例 #21
0
ファイル: utils_test.py プロジェクト: g-weatherill/hmtk
 def test_input_checks_simple_input(self):
     completeness_table = [[1900, 2.0]]
     catalogue = Catalogue.make_from_dict(
         {'magnitude': [5.0, 6.0], 'year': [2000, 2000]})
     config = {}
     rec_utils.input_checks(catalogue, config, completeness_table)
コード例 #22
0
ファイル: utils_test.py プロジェクト: juliogarciagem/hmtk
 def test_input_checks_use_a_float_for_completeness(self):
     fake_completeness_table = 0.0
     catalogue = {"year": [1900]}
     config = {}
     rec_utils.input_checks(catalogue, config, fake_completeness_table)
コード例 #23
0
ファイル: utils_test.py プロジェクト: juliogarciagem/hmtk
 def test_input_checks_use_reference_magnitude(self):
     fake_completeness_table = 0.0
     catalogue = {"year": [1900]}
     config = {"reference_magnitude": 3.0}
     cmag, ctime, ref_mag, dmag = rec_utils.input_checks(catalogue, config, fake_completeness_table)
     self.assertEqual(3.0, ref_mag)
コード例 #24
0
 def test_input_checks_use_a_float_for_completeness(self):
     fake_completeness_table = 0.0
     catalogue = {'year': [1900]}
     config = {}
     rec_utils.input_checks(catalogue, config, fake_completeness_table)