def compute_afternoon_vpd(self) : bufs = self.get_buffer_group() t = bufs.get('Tair').ref_val() q = bufs.get('Qair').ref_val() p = bufs.get('PSurf').ref_val() vp_act = met.calc_vp_spec_humidity(q,p) return met.calc_vpd(t,vp_act)
def compute_afternoon_vpd(self): bufs = self.get_buffer_group() t = bufs.get('Tair').ref_val() q = bufs.get('Qair').ref_val() p = bufs.get('PSurf').ref_val() vp_act = met.calc_vp_spec_humidity(q, p) return met.calc_vpd(t, vp_act)
def test_vp_spec_humidity(self) : """Tests specific humidity -> vapor pressure calculation Calculates specific humidity using eqn 2.19 of [1], then tests to ensure the tested function can calculate the original vapor pressure used. [1] Rogers, R. R. A Short Course in Cloud Physics, Third Edition. 3 edition. Oxford ; New York: Pergamon, 1989. """ # atmospheric variables used in specific humidity calc. e = 611 * u.Pa # vapor pressure p = 1 * u.bar # total pressure # calculate specific humidity q = m.EPSILON * (e/(p - (1-m.EPSILON)*e)) e_test = m.calc_vp_spec_humidity(q,p) self.assertTrue(np.abs(e-e_test)<0.1 * u.Pa)
def test_vp_spec_humidity(self): """Tests specific humidity -> vapor pressure calculation Calculates specific humidity using eqn 2.19 of [1], then tests to ensure the tested function can calculate the original vapor pressure used. [1] Rogers, R. R. A Short Course in Cloud Physics, Third Edition. 3 edition. Oxford ; New York: Pergamon, 1989. """ # atmospheric variables used in specific humidity calc. e = 611 * u.Pa # vapor pressure p = 1 * u.bar # total pressure # calculate specific humidity q = m.EPSILON * (e / (p - (1 - m.EPSILON) * e)) e_test = m.calc_vp_spec_humidity(q, p) self.assertTrue(np.abs(e - e_test) < 0.1 * u.Pa)