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
14 stars 4 forks source link

Unnecessary wind direction recalculation from directional wind speed #96

Closed BaptisteVandecrux closed 1 year ago

BaptisteVandecrux commented 1 year ago

Wind direction is measured by the station. Then directional wind speed is calculated in the L0toL1 conversion. Then I don't see why we need to recalculate wind direction from directional wind speed again.

https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/480a77316bacacb0055d14368e00b54b54a68040/src/pypromice/L2toL3.py#L34

https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/480a77316bacacb0055d14368e00b54b54a68040/src/pypromice/L2toL3.py#L61

https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/480a77316bacacb0055d14368e00b54b54a68040/src/pypromice/L2toL3.py#L86

PennyHow commented 1 year ago

This is a direct translation from the IDL/GDL workflow used to produce the previous AWS data (Edition 3).

I agree it is strange if we already have wdir then why we need to recalculate it from directional wind speed wspd_x wspd_y. I just never touched it because I wanted to keep it consistent with the previous processing.

Should we keep it but call it a different variable name, like wdir_u_dev (to demonstrate that it is derived)? I would say wdir_u_cor better adheres to our naming convention, but the derived wind direction isn't really a correction...

BaptisteVandecrux commented 1 year ago

This is a direct translation from the IDL/GDL workflow used to produce the previous AWS data (Edition 3).

Then I guess it was an unnecessary step in the GDL code and I don't think we need to keep it, even as (confusing) duplicate variable.

I have commented out this calculation in this commit under #92. These lines should be completely removed after we get confirmation from @robertfausto and @Dirk-van-As.

Dirk-van-As commented 1 year ago

Not sure without going into your translated version, but in my IDL code I recalculate averaged wind directions from X and Y components, because you can't average angles. Or otherwise it is so that a potential wind direction correction (based on automated compass readings or manual measurements during maintenance visits) can be applied in between?

BaptisteVandecrux commented 1 year ago

Thanks for the info Dirk! I did not think about the temporal average of angles indeed. Even if it means that it shouldn't be completely removed, it means that it needs to go after the temporal averaging of the data:

I have a preference for the former.

It also means that it is not needed for the instantaneous data.

BaptisteVandecrux commented 1 year ago

Fixed with #172