コード例 #1
0
 def test_find_magequator(self):
     expected = {'Bmin': array([ 1030.456337,  3444.077016 ])}
     Bmin_loci = array([[ 2.99935449,  0.005511 , -0.032353  ],
                       [ 2.00289871, -0.00734881,  0.045382]])
     actual = ib.find_magequator(self.ticks, self.loci, omnivals=self.omnivals)
     numpy.testing.assert_almost_equal(expected['Bmin'], actual['Bmin'], decimal=6)
     numpy.testing.assert_almost_equal(Bmin_loci, actual['loci'].data, decimal=6)
コード例 #2
0
ファイル: corr_utils.py プロジェクト: wlwetzel/SAMPEX
    def _find_loss_cone(self, position, time):
        foot = irb.find_footpoint(time, position, extMag='T89')['Bfoot']
        eq = irb.find_magequator(time, position, extMag='T89')['Bmin']

        pitch = 90  #for particles mirroring at 100km
        return np.rad2deg(
            np.arcsin(np.sqrt(np.sin(np.deg2rad(pitch))**2 * eq / foot)))
コード例 #3
0
ファイル: test_irbempy.py プロジェクト: spacepy/spacepy
 def test_find_magequator(self):
     expected = {'Bmin': array([ 1030.50271503,  3444.0670669 ])}
     Bmin_loci = array([[ 2.99935449,  0.0055078 , -0.032328  ],
                       [ 2.00289871, -0.00734881,  0.04538073]])
     actual = ib.find_magequator(self.ticks, self.loci, omnivals=self.omnivals)
     numpy.testing.assert_almost_equal(expected['Bmin'], actual['Bmin'], decimal=6)
     numpy.testing.assert_almost_equal(Bmin_loci, actual['loci'].data, decimal=6)
コード例 #4
0
def to_equatorial(position, time, pitch):
    """
    take in spacepy coord class and ticktock class
    """

    blocal = irb.get_Bfield(time, position, extMag='T89')['Blocal']
    beq = irb.find_magequator(time, position, extMag='T89')['Bmin']
    eq_pitch = np.arcsin(np.sqrt(np.sin(np.deg2rad(pitch))**2 * beq / blocal))
    return np.rad2deg(eq_pitch)
コード例 #5
0
ファイル: test_irbempy.py プロジェクト: yangjian615/spacepy
 def test_find_magequator(self):
     expected = {'Bmin': array([1030.50271503, 3444.0670669])}
     Bmin_loci = array([[2.99935449, 0.0055078, -0.032328],
                        [2.00289871, -0.00734881, 0.04538073]])
     actual = ib.find_magequator(self.ticks,
                                 self.loci,
                                 omnivals=self.omnivals)
     numpy.testing.assert_almost_equal(expected['Bmin'],
                                       actual['Bmin'],
                                       decimal=6)
     numpy.testing.assert_almost_equal(Bmin_loci,
                                       actual['loci'].data,
                                       decimal=6)
コード例 #6
0
 def test_find_magequator(self):
     expected = {'Bmin': array([1030.4563374, 3444.07701499])}
     Bmin_loci = [[2.999354, 0.00551125, -0.03235315],
                  [2.00289878, -0.0073488, 0.04538181]]
     actual = ib.find_magequator(self.ticks,
                                 self.loci,
                                 omnivals=self.omnivals)
     numpy.testing.assert_almost_equal(expected['Bmin'],
                                       actual['Bmin'],
                                       decimal=6)
     numpy.testing.assert_almost_equal(Bmin_loci,
                                       actual['loci'].data,
                                       decimal=6)