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

[netCDF #SCT-388171]: FW: Data extraction

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: [netCDF #SCT-388171]: FW: Data extraction
  • Date: Thu, 07 Dec 2006 09:32:31 -0700

Hi Joo-Youp,

Sorry it's taken a while to reply to your question.

> I figured out the answer to my 2nd question below. Since the longitude
> varies from 220E to 300E, the number of grids equally divided by 0.25 degree
> is (300-220)/0.25 + 1 = 321. Thus, longitude 2 means 220.25E. It also
> applies to latitude in the same way. Thanks.

Actually the latitude and longitude coordinates are printed out in the ncdump 
output, and it looks to me like longitude 2 is 3.75 degrees east.  See the 
ncdump output I sent below, which includes:

 lat = 88.75, 86.25, 83.75, 81.25, 78.75, 76.25, 73.75, 71.25, 68.75, 66.25,
   ...
-81.25, -83.75, -86.25, -88.75 ;

lon = 1.25, 3.75, 6.25, 8.75, 11.25, 13.75, 16.25, 18.75, 21.25, 23.75,
   ...
348.75, 351.25, 353.75, 356.25, 358.75 ;

> I also found the add_offset and scale_factor values from the converted text
> file after applying ncdump utility as follows:
> 
> precip:add_offset = 50.f ;
> precip:scale_factor = 0.001525972f ;

Well, for the half-megabyte file you originally attached,  precip.mon.ltm.nc, 
ncdump printed out

 precip:add_offset = 0.f ;
 precip:scale_factor = 1.f ;

which means the data wasn't packed.  It looks like you're getting the values 
above for add_offset and scale_factor from a different netCDF file, so I can't 
answer the rest of your question by looking at the file, but p[lease notice 
that the ncdump output you sent also shows:

 precip:missing_value = 32766s ;

That means the packed value 32766 is stored for data that was missing, so you 
should not try to unpack such data and interpret it.  When you are unpacking 
data, check for the missing value first.

--Russ




Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: SCT-388171
Department: Support netCDF
Priority: Normal
Status: Closed