Beispiel #1
0
 def test_prep_irbem_sysaxesnone(self):
     """prep_irbem should handle 'car' and 'sph' version of systems identically"""
     locc = spacepy.coordinates.Coords([[3,0,0],[2,0,0]], 'GSM', 'car')
     out1 = ib.prep_irbem(ticks=self.ticks, loci=locc,
                          extMag='0', options=[1, 0, 0, 0, 1])
     pos = ib.car2sph(locc.data)
     locs = spacepy.coordinates.Coords(pos, 'GSM', 'sph')
     out2 = ib.prep_irbem(ticks=self.ticks, loci=locs,
                          extMag='0', options=[1, 0, 0, 0, 1])
     self.assertEqual(out1['sysaxes'], out2['sysaxes'])
     numpy.testing.assert_almost_equal(out1['xin1'], out2['xin1'])
     numpy.testing.assert_almost_equal(out1['xin2'], out2['xin2'])
     numpy.testing.assert_almost_equal(out1['xin3'], out2['xin3'])
Beispiel #2
0
 def test_car2sph(self):
     loc = [0.5, 0.5, 0.70710678]
     expected = [1, 45, 45]
     numpy.testing.assert_almost_equal(expected, ib.car2sph(loc))
Beispiel #3
0
 def test_car2sph(self):
     loc = [ 0.5,  0.5,  0.70710678]
     expected = [1,45,45]
     numpy.testing.assert_almost_equal(expected, ib.car2sph(loc))