Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#358 closed upgrade (Done)

Expanded use of add_offset and scale_factor

Reported by: arango Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.3
Component: Nonlinear Version: 3.3
Keywords: Cc:

Description (last modified by arango)

Expanded the update in src:ticket:356 to also include the scale_factor attribute.

Currently, all the NetCDF data input routines will check if any the following attributes: scale_factor, add_offset, or _FillValue are present in the input NetCDF variable:

  • If the scale_value attribute is present, the data is multiplied by this factor after reading.
  • If the add_offset attribute is present, this value is added to the data after reading.
  • If both scale_factor and add_offset attributes are present, the data are first scaled before the offset is added. They are usually used for simple data compression.
  • If the _FillValue attribute is present, the data having this value is treated as missing and it is replaced with zero. This feature it is usually related with the land/sea masking.

Notice that the NetCDF attribute convention stipulates:

"When scale_factor and add_offset are used for packing, the associated variable (containing the packed data) is typically of type byte or short, whereas the unpacked values are intended to be of type float or double. The attributes scale_factor and add_offset should both be of the type intended for the unpacked data, e.g. float or double".

On the other hand, the _FillValue must be of the same type as the NetCDF variable.

Change History (2)

comment:1 by arango, 15 years ago

Description: modified (diff)
Resolution: Done
Status: newclosed

comment:2 by arango, 15 years ago

Summary: Expanded used of add_offset and scale_factorExpanded use of add_offset and scale_factor
Note: See TracTickets for help on using tickets.