Exemple #1
0
def test_declination_corrected_directional_stats(dset_2d):
    filename = FILES_DIR / "triaxys.DIRSPEC"
    dset1 = read_triaxys(filename, magnetic_variation=10, regrid_dir=False)
    dset2 = read_triaxys(filename, magnetic_variation=10, regrid_dir=True)
    assert dset1.spec.dm().values == pytest.approx(dset2.spec.dm().values,
                                                   rel=1e-2)
    assert dset1.spec.dpm().values == pytest.approx(dset2.spec.dpm().values,
                                                    rel=1e-2)
Exemple #2
0
def test_regrid_dir(dset_2d):
    filename = FILES_DIR / "triaxys.DIRSPEC"
    dset1 = _ds = read_triaxys(filename, magnetic_variation=None)
    dset2 = _ds = read_triaxys(filename,
                               magnetic_variation=10,
                               regrid_dir=False)
    dset3 = _ds = read_triaxys(filename,
                               magnetic_variation=10,
                               regrid_dir=True)
    assert dset_2d.dir.identical(dset1.dir)
    assert dset_2d.dir.identical(dset3.dir)
    assert not dset_2d.dir.identical(dset2.dir)
Exemple #3
0
def dset_2d():
    _ds = read_triaxys(str(FILES_DIR / 'triaxys.DIRSPEC'))
    yield _ds
Exemple #4
0
def test_magnetic_variation_only_2d():
    filename = FILES_DIR / "triaxys.NONDIRSPEC"
    dset1 = _ds = read_triaxys(filename)
    dset2 = _ds = read_triaxys(filename, magnetic_variation=10)
    assert dset1.identical(dset2)
 def setup_class(self):
     """Setup class."""
     self.tmp_dir = mkdtemp()
     self.ds_1d = read_triaxys(os.path.join(FILES_DIR,
                                            'triaxys.NONDIRSPEC'))
     self.ds_2d = read_triaxys(os.path.join(FILES_DIR, 'triaxys.DIRSPEC'))