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

Missing barometer height in BUFR files #218

Closed ladsmund closed 5 months ago

ladsmund commented 6 months ago

The BUFR files are missing heightOfBarometerAboveMeanSeaLevel when z_boom_u_smooth I nan.

pypromice/src/pypromice/postprocess/csv2bufr.py:

#Set measurement heights
if math.isnan(row['z_boom_u_smooth']) is False:
    codes_set(ibufr,
              '#1#heightOfSensorAboveLocalGroundOrDeckOfMarinePlatform',
              row['z_boom_u_smooth']-0.1) # For air temp and RH
    codes_set(ibufr,
              '#7#heightOfSensorAboveLocalGroundOrDeckOfMarinePlatform',
              row['z_boom_u_smooth']+0.4) # For wind speed
    if math.isnan(row['gps_alt_fit']) is False:
        codes_set(ibufr, 'heightOfBarometerAboveMeanSeaLevel',
                  row['gps_alt_fit']+row['z_boom_u_smooth']) # For pressure

I don't understand why z_boom_u_smooth is used to compute heightOfBarometerAboveMeanSeaLevel. z_boom_u_smooth is relative to the snow height and not the barometer height above sea level. I expected to see a constant offset defining the barometer height relative height between the gps receiver:

barometer_height = row['gps_alt_fit'] + barometer_height_relative_to_gps_receiver
ladsmund commented 6 months ago

@PennyHow @patrickjwright Do you have some inputs to this?

PennyHow commented 5 months ago

Looks like this is all resolved now with the merged PR. Great catch @ladsmund!