[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20000505: packing- scale_factor and add_offset

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: 20000505: packing- scale_factor and add_offset
  • Date: Fri, 05 May 2000 09:32:58 -0600

Takaya,

> To: address@hidden
> From: "takaya namba" <address@hidden>
> Subject: scale_factor and add_offset
> Organization: waumail.com
> Keywords: 200005050755.e457tJG28481

In the above message, you wrote:

> When scale_factor and add_offsets are defined in the netcdf file,
> is it possible to unpack the variable without the formular in fortran?
> 
> x=(x_packed-1)*scale_factor + add_offset.
> 
> Which mean whether we can obtain x value automatically without the above 
> calculation or not?  
> 
> For example,if the factor.cdf define the scale_factor and add_offset inside,
> ncdump factor.cdf >factor
> ncgen -f factor >factor.f
> 
> only this process bring the unpacked value or now?

The netCDF library returns packed values.  The software that uses the
netCDF library must perform the unpacking computation in order to obtain
the actual values -- the netCDF library does not do this automatically.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>