コード例 #1
0
 def test_standard(self):
     SA = [34.7118, 34.8915, 35.0256, 34.8472, 34.7366, 34.7324]
     pt = [28.7832, 28.4210, 22.7850, 10.2305, 6.8292, 4.3245]
     s = gsw.entropy_from_pt(SA, pt)
     s_correct = np.array([400.38946744, 395.43839949, 319.86743859,
                           146.79054828,  98.64691006,  62.79135672])
     self.assertTrue(np.all(abs(s - s_correct) < 1.0e-8))
コード例 #2
0
 def test_masked(self):
     SA = np.array([35, -99])
     SA = np.ma.masked_where(SA < 0, SA)
     pt = 10.0
     s = gsw.entropy_from_pt(SA, pt)
     self.assertTrue(np.all(s.mask == SA.mask))
コード例 #3
0
ファイル: matlab-test.py プロジェクト: jklymak/pythonMvp
#sigma3_CT = gsw.sigma3_CT(SA_chck_cast, CT_chck_cast)
#test_print("sigma3_CT")

#sigma4_CT = gsw.sigma4_CT(SA_chck_cast, CT_chck_cast)
#test_print("sigma4_CT")

#NOTE: redundant
#enthalpy_CT = gsw.enthalpy_CT(SA_chck_cast, CT_chck_cast, gsw_cv.p_chck_cast)
#or
enthalpy_CT = gsw.enthalpy(SA_chck_cast, _t, gsw_cv.p_chck_cast)
test_print("enthalpy_CT")

#enthalpy_diff_CT =  gsw.enthalpy_diff_CT(SA_chck_cast, CT_chck_cast, gsw_cv.p_chck_cast_shallow, gsw_cv.p_chck_cast_deep)
#test_print("enthalpy_diff_CT")

entropy_from_pt = gsw.entropy_from_pt(SA_chck_cast, pt)
test_print("entropy_from_pt") #NOTE: diffs are also found in the original

#NOTE: redundant
entropy_from_CT = gsw.entropy_from_CT(SA_chck_cast, CT_chck_cast)
test_print("entropy_from_CT")

pt_from_entropy =  gsw.pt_from_entropy(SA_chck_cast, entropy)
test_print("pt_from_entropy") #FIXME: diffs are not found in the original

#NOTE: redundant
CT_from_entropy =  gsw.CT_from_entropy(SA_chck_cast, entropy)
test_print("CT_from_entropy") #FIXME: diffs are not found in the original

""" derivatives of enthalpy,  entropy,  CT and pt """
CT_SA, CT_pt = gsw.CT_first_derivatives(SA_chck_cast, pt)