[ncl-talk] change dimensions to lat/lon

Rick Brownrigg brownrig at ucar.edu
Mon May 1 14:15:12 MDT 2017


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> 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
> 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/20170501/bfbe3a6d/attachment.html 


More information about the ncl-talk mailing list