示例#1
0
    def test_no_BC(self):
        #expected is from:
        #np.dot((np.cos(z1[:,np.newaxis] * m[np.newaxis,:])-np.cos(z2[:,np.newaxis] * m[np.newaxis,:]))/m[np.newaxis,:]/(z2[:,np.newaxis]-z1[:,np.newaxis]), v_E_Igamv_the)
        assert_allclose(dim1sin_avgf(self.m,
                                  self.outz,
                                  self.tvals,
                                  self.v_E_Igamv_the,
                                  drn=0),

                                  np.array([[ 1.6275434 ,  1.6275434 ],
                                            [ 2.29709903,  2.29709903]]))
示例#2
0
    def test_bot_vs_time_drn_0(self):
        #expected is from:
        #test no_bc + bot_vs time interplolated at tvals and depth z (mag_vs_depth reduces to zero at top)

        assert_allclose(dim1sin_avgf(self.m,
                                  self.outz,
                                  self.tvals,
                                  self.v_E_Igamv_the,
                                  drn=0,
                                  bot_vs_time = [self.bot_vs_time]),

                                  np.array([[ 1*0.3+1.6275434 ,  2*0.3+1.6275434 ],
                                            [ 1*0.5+2.29709903,  2*0.5+2.29709903]]))
示例#3
0
    def test_top_vs_time_drn_1(self):
        #expected is from:
        #test no_bc + top_vs time interplolated at tvals and depth z (mag vs depth is uniform top to bottom)

        assert_allclose(dim1sin_avgf(self.m,
                                  self.outz,
                                  self.tvals,
                                  self.v_E_Igamv_the,
                                  drn=1,
                                  top_vs_time = [self.top_vs_time]),

                                  np.array([[ 1+1.6275434 ,  2+1.6275434 ],
                                            [ 1+2.29709903,  2+2.29709903]]))
示例#4
0
    def test_bot_vs_time_top_vs_time_drn_1_double_loads(self):
        #expected is from:
        #test no_bc + top_vs_time and bot_vs time interplolated at tvals and depth z (mag_vs_depth is uniform from top plus reduces to zero at top)

        assert_allclose(dim1sin_avgf(self.m,
                                  self.outz,
                                  self.tvals,
                                  self.v_E_Igamv_the,
                                  drn=1,
                                  top_vs_time = [self.top_vs_time, self.top_vs_time],
                                  bot_vs_time = [self.bot_vs_time, self.bot_vs_time]),

                                  np.array([[ 2+2*0.3+1.6275434 ,  4+4*0.3+1.6275434 ],
                                            [ 2+2*0.5+2.29709903,  4+4*0.5+2.29709903]]))
示例#5
0
    def test_top_vs_time_drn_0_omega_phase(self):
        #expected is from:
        #test no_bc + cos(omega*t+phase)  multiplied top_vs time interplolated at tvals and depth z (mag_vs_depth reduces to zero at bottom)

        assert_allclose(dim1sin_avgf(self.m,
                                  self.outz,
                                  self.tvals,
                                  self.v_E_Igamv_the,
                                  drn=0,
                                  top_vs_time = [self.top_vs_time],
                                  top_omega_phase=[self.omega_phase]),

                                  np.array([[ 1*0.7*np.cos(1*1+2)+1.6275434,  2*0.7*np.cos(1*3+2)+1.6275434],
                                            [ 1*0.5*np.cos(1*1+2)+2.29709903,  2*0.5*np.cos(1*3+2)+2.29709903]]))