Opened 8 months ago

Closed 7 months ago

#2627 closed help (fixed)

netcdf valid_min and valid_max; pp conversion

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



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,

Change History (2)

comment:1 Changed 8 months 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


comment:2 Changed 7 months ago by willie

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.