Open stella-bourdin opened 1 month ago
This was intentional. The slp_units
argument is only a backup the psl array doesn't already have units. preprocess_and_wrap
calls metpy.quantify()
which converts the input to a pint array with units from the array attributes. I think it's a good thing that it is flagging if the units are not valid rather than overwriting them, but we could flip it around so that it uses slp_units
by default.
I have a file of tracks in NetCDF format (from TRACK). In there, slp units are "hpa" (which is incorrect for pint/metpy.units). When running
get_pressure_cat
, I can specifyslp_units
, but it will in fact ignore it... I get an error saying the unit 'hpa' is incorrect. I can fix it by rewriting the unit attribute, but I think it's desirable to be able to override it as an argument. It seems to have to do with the@preprocess_and_wrap
, which I don't know how it works yet. Can you have a look at it @leosaffin ? Thanks!