Opened 11 days ago

Last modified 11 days ago

#2627 new help

netcdf valid_min and valid_max; pp conversion

Reported by: ajd Owned by: um_support
Priority: normal Component: UM Tools
Keywords: Cc:
Platform: UM Version:

Description

Hi CMS,

I've previously used either a convsh tcl script or iris to convert from pp files to netcdf, and found that occasionally the converted netcdfs are not consistent. Specifically, the convsh *tcl script adds the netcdf attributes valid_min and valid_max, which iris does not do. Depending on the language I use for my analysis, these attributes are sometimes used and sometimes ignored (e.g. NCL ignores those but python doesn't), which can lead to inconsistencies in the results. Is this a known 'problem' and do you know where the values for valid min and max come from?

Many thanks,
Andrea

Change History (1)

comment:1 Changed 11 days ago by jeff

Hi Andrea

The valid_max and valid_min should be the max and min of the field, xconv/convsh will work this out from the field values.

I think python netcdf treats any values outside of valid_max and valid_min as missing data, this should not matter if you use the fields directly but could cause problems if you process the field and don't change the valid_max and valid_min values to match.

It is possible to turn these attributes off in convsh, add this line near the top of the script

setvaratt valid_min valid_max att_nouse

Jeff.

Note: See TracTickets for help on using tickets.