[ncl-talk] change dimensions to lat/lon

Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC] jian.su at nasa.gov
Tue May 2 07:59:18 MDT 2017


Thank you Rick,

Filedimdef successfully added lat/lon, but how can we remove DIM_001/ DIM_002 and assign lat/lon to the variable pixTot?


   file global attributes:
   dimensions:
      DIM_001 = 1440
      DIM_002 = 720
      lat = 1440
      lon = 720
   variables:
      integer pixTot ( DIM_001, DIM_002 )
         CodeMissingValue :       -9999
         DimensionNames :         nlon,nlat



From: Rick Brownrigg <brownrig at ucar.edu>
Date: Monday, May 1, 2017 at 4:15 PM
To: "Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC]" <jian.su at nasa.gov>
Cc: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject: Re: [ncl-talk] change dimensions to lat/lon

Hi Jay,
There are probably several ways to do this. One that occurs to me is to create the dimensions in the new file with the "filedimdef" procedure:

    http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml
So in your case, that might look something like:

    filedimdef(f,(/"lat","lon"/),(/1440, 720/), (/False,False/))
You can add the other information directly as global attributes of the file:
    f->LatitudeResolution=0.25
    f->LongitudeResolution=0.25
    ...etc...
Hope that helps...
Rick

On Mon, May 1, 2017 at 12:28 PM, Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC] <jian.su at nasa.gov<mailto:jian.su at nasa.gov>> wrote:
Hello,

I am using ncl to convert HDF5 files to netCDF, and one of them looks like this:

Variable: f
Type: file
filename:         out
path:    out.nc4
   file global attributes:
   dimensions:
      DIM_001 = 1440
      DIM_002 = 720
   variables:
      integer pixTot ( DIM_001, DIM_002 )
         CodeMissingValue :       -9999
         DimensionNames :         nlon,nlat


How can I change DIM_001 and DIM_002 to lat/lon, and add the grid information eg,

LatitudeResolution=0.25;
LongitudeResolution=0.25;
NorthBoundingCoordinate=90;
SouthBoundingCoordinate=-90;
EastBoundingCoordinate=180;
WestBoundingCoordinate=-180;

Thanks,
Jay



_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170502/8a478e94/attachment.html 


More information about the ncl-talk mailing list