[ncl-talk] set_dimension_query

Kunal Bali kunal.bali9 at gmail.com
Wed Sep 13 08:38:13 MDT 2017


Dear NCL

I have a file with the variable summary. The dimensions are in 2D.

ncl 2>  printVarSummary(var)

Variable: var
Type: short
Total Size: 2880000 bytes
            1440000 values
Number of Dimensions: 2
Dimensions and sizes:    [*YDim_grid1km | 1200] x [XDim_grid1km | 1200]*
Coordinates:
Number Of Attributes: 7
  long_name :    AOT at 0.55 micron
  scale_factor :    0.001
  add_offset :       0
  unit :    None
  _FillValue :    -28672
  valid_range :    ( -100, 5000 )
  hdf_name :    Optical_Depth_055


I am trying to read the dimensions of this file as

begin
;---Read data
         a = addfile("/media/Local
Disk/NPL/MODIS_FPC/MAIACTAOT.h00v02.20000570505.hdf","r")

            var  = a->Optical_Depth_055(:,:)

         var&XDim_grid1km = lat
         var&YDim_grid1km = lon

        nlat = 1200
         nlon = 1200
            lat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
        lon = lonGlobeFo(nlon, "lon", "longitude", "degrees_east")
            lat = lat(::-1)
            lon = (/ lon - 180. /)  ; subtract 180 from all values
            lon&lon = lon           ; update coordinates


        var!0 = "lat"
        var!1 = "lon"


But the error appeared as
*fatal:Variable (lat) is undefined*


So, could anyone please let me know that how to read dimension of this
file.

Thank You


Regards
Kunal Bali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170913/c8184a7e/attachment.html>


More information about the ncl-talk mailing list