GEUS-Glaciology-and-Climate / pypromice

Process AWS data from L0 (raw logger) through Lx (end user)
https://pypromice.readthedocs.io
GNU General Public License v2.0
12 stars 4 forks source link

found bug it clip_value for rh_u_cor and rh_l_cor, adjusting limit for rh_u and rh_l and problem with the specific humidity's unit in variable.csv #220

Closed BaptisteVandecrux closed 2 months ago

BaptisteVandecrux commented 5 months ago

In these lines:

https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/a7997ef0b7f347ed7649cdd37edad1f6f7eade2c/src/pypromice/process/value_clipping.py#L36-L42

there was an attempt to replace values <lo by lo and>hi by hi.

First of all values outside of this functional range indicate at a sensor malfunction and should be replaced by NaN, not by one of the two limit values.

Second, because this function is called in L0toL1, rh_u_cor had not been calculated and was full of NaN, then replaced by zeroes in l.36-37 and not switched back to NaN if there are indead rh_u values for that period. I don't know if those zeroes have implications later on (since rh_u_cor is calculated at a later point) but anyway it was not ideal to have them there, even temporarily.

So I'll remove the exception for rh_u_cor / rh_l_cor and have for all variables: https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/a7997ef0b7f347ed7649cdd37edad1f6f7eade2c/src/pypromice/process/value_clipping.py#L45-L48

BaptisteVandecrux commented 5 months ago

Unit for specific humidity should be kg/kg (according to Fausto et al. 2021) not %

https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/main/src/pypromice/process/variables.csv

BaptisteVandecrux commented 5 months ago

Last, rh_u and rh_l as mesaured with regard to water by the instrument should be limited to 0-100.

It is only when converting these values to RH with regard to ice that supersaturation and values above 100 can occur.