glamod/glamod-nuim

Bug in wind measurement code handling when no codes set

Closed this issue · 1 comments

rjhd2 commented

When running

 hourly_qff_to_cdm_lite_v1.py --station NOM00001326

get an error that the mask = (var_frame["measurement_code"].str.startswith(code)) | mask line fails as the .str can't be set on non-string values. The issue is that in testing we presumed there'd be at least one of the wind measurement codes (e..g N-Normal, C-Calm) set in the stations. However for around half this isn't the case - and hence the var_frame["measurement_code"] is all blank (read in by pandas as NaN). The NaNs aren't strings and this fails.

rjhd2 commented

For Release 6 removing the startswith option removes this bug, and #83 refers to a future fix.