Exemple #1
0
    def test_io_dobs(self):

        data_object = Data(
            survey=self.survey, dobs=self.dobs, standard_deviation=self.std
        )
        filename = "dpred.gg"

        write_gg3d_ubc(filename, data_object)
        data_loaded = read_gg3d_ubc(filename)
        os.remove(filename)

        passed = np.all(
            np.isclose(
                self.survey.receiver_locations, data_loaded.survey.receiver_locations
            )
        )
        self.assertTrue(passed, True)

        passed = np.all(np.isclose(self.dobs, data_loaded.dobs))
        self.assertTrue(passed, True)

        passed = np.all(np.isclose(self.std, data_loaded.standard_deviation))
        self.assertTrue(passed, True)

        print("OBSERVED DATA FILE IO FOR GG3D PASSED")
Exemple #2
0
    def test_io_survey(self):

        data_object = Data(survey=self.survey)
        filename = "survey.gg"

        write_gg3d_ubc(filename, data_object)
        data_loaded = read_gg3d_ubc(filename)
        os.remove(filename)

        passed = np.all(
            np.isclose(self.survey.receiver_locations,
                       data_loaded.survey.receiver_locations))
        self.assertTrue(passed, True)

        print("SURVEY FILE IO FOR GG3D PASSED")