Added wagner_pruss option for saturation vapour pressure.#43
Added wagner_pruss option for saturation vapour pressure.#43mariuswinkler wants to merge 18 commits intoobservingClouds:masterfrom
Conversation
1af341b to
d429efa
Compare
|
The last test fails because of: "FAILED test/test_mwx_output.py::test_mwx_file_consistency - AssertionError: difference between old and new dataset is too large for mr which must be related to the changes I made in the computation of the saturation vapour pressure whiche affects the mixing ration computation. Since the threshold value is set at 0.0001 and the error is raised for a value slightly larger (0.00014251), would it make sense to raise the threshold value for this test? |
The issue is probably that in metpy the molecular weight ratio is given more precisely than |
|
Won't quite work still... running out of ideas rn |
| td.calc_wv_mixing_ratio(self.profile, e_s) | ||
| * self.profile.humidity.values | ||
| mixing_ratio = td.calc_wv_mixing_ratio( | ||
| self.profile, e_s * self.profile.humidity.values |
There was a problem hiding this comment.
The brackets are incorrectly set here and in the next occurrence. It is
w = w_s * RH / 100There was a problem hiding this comment.
Thanks for the note. Initially the RH scaling was applied after computing the saturated mixing ratio. It should go inside to compute the actual vapor pressure first. I've corrected it so that e = RH * e_s is passed directly into the function.
For the else case when self.profile.humidity.values is in percent the / 100 needs to also go inside the brackets of course.
|
hmmm... The only explanation I can think of is that the test might use some form of checksum or internal consistency check based on previous test-datasets. By moving the relative humidity inside the brackets of the mixing ratio computation, we might now be slightly overstepping the threshold that causes the test to fail even though the result is actually correct. |
|
So what was wrong with df559b8? You like breaking tests?! ;) Can we not do the scaling afterwards as I did before? |
|
Now I've stumbled over my own leg. One more try. |
|
I think the scaling by relative humidity (dividing by 100) needs to happen inside the mixing ratio function, since the computation is nonlinear and depends on the actual vapor pressure, not RH in percent, no ? |
|
Well, don't we want to calculate the:
|
|
Actually, both should work no ? What you are suggesting is: ... only, that my version does not pass the test. |
|
Well, to stay simple, let's stay with what works. |
|
I'll turn it around in a new push. 1 sec. |
411c864 to
69296fb
Compare
With that, the calculation for the mixing ratio has changed throughout pysonde. Although Hardy1998 is used to calibrate the radiosondes from Vaisala side, we decided to go for the Wagner Pruss approach to align with the french MAESTRO Team which.
Co-authored-by: Hauke Schulz <43613877+observingClouds@users.noreply.github.com>
Co-authored-by: Hauke Schulz <43613877+observingClouds@users.noreply.github.com>
Co-authored-by: Hauke Schulz <43613877+observingClouds@users.noreply.github.com>
Co-authored-by: Hauke Schulz <43613877+observingClouds@users.noreply.github.com>
b84bb72 to
5cd1c79
Compare
d03a79d to
cb0ccb2
Compare
|
I don't understand why this test won't go through. I took "method=wagner_pruss" out so that the test would pass but without success. I am running out of ideas here. Maybe you can have a look at it, Hauke. |
With that, the calculation for the mixing ratio has changed throughout pysonde. Although Hardy1998 is used to calibrate the radiosondes from Vaisala side, we decided to go for the Wagner Pruss approach to align with the french MAESTRO Team which.