[ncl-talk] Problem with assigning coordinate

Dennis Shea shea at ucar.edu
Sun Mar 8 10:22:06 MDT 2020


*[1]*
I have tried opening the
  *3A-DAY.*GPM.DPR.GPM-SLH.20161231-S000000-E235959.366.*V06A.HDF5*
file with NCL versions 6.3.0, 6.5.0 and 6.6.2 and have encountered the same
errors as Rick.

Please place the file you are using "*3A-DAY.20161231.V06A.**HDF5*" onto to
ftp site

ftp ftp.cgd.ucar.edu
anonymous
your_email
cd incoming
put 3A-DAY.20161231.V06A.HDF5
quit

===
I tried to open a monthly '3A' file with no problems:

%> *ncl_filedump*
<https://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml> *3A-MO*
.GCOMW1.AMSR2.GRID2014R2.20150101-S000000-E235959.01.*V03C.HDF5*
===

*[2]*
A netCDF* coordinate variable*
<https://www.ncl.ucar.edu/Document/Language/cv.shtml> is a one-dimensional
array where the name of the variable is the same as the dimension name: EG:
time(time), level(level), lat(lat), longitude(longitude)
---
 layer=fspan(0.25,20,80)
 lon=fspan(-180,180,720)
 lat=fspan(-67,67,268)
 lat at long_name = "latitude"
 lon at long_name = "longitude"
 lat at units = "degrees_north"
 lon at units = "degrees_east"
 lon!0 = "lon"
 lat!0 = "lat"
 layer!0 = "layer"

QR1 = "/Grid/LHCndMean"
 QR=f->$QR1$
 QR!0="layer"       ; name dimensions
 QR!1="lon"
 QR!2="lat"
 QR&layer=layer    ; assign variables to named dimensions
 QR&lon=lon
 QR&lat=lat

  printVarSummary(QR)
 printVarSummary(QR&lat)
 printVarSummary(QR&non)

On Sun, Mar 8, 2020 at 8:16 AM Rick Brownrigg via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Unfortunately, I am unable to open this file. My version of NCL complains
> about mismatched headers/libraries, which would be an issue on my part.
> I'll have to wait until tomorrow when I have access to a different version
> of NCL.  That said, the various HDF5 command-line utilities I have
> installed also say they can not open the file (???)
>
> In the meantime, perhaps someone else can take a crack at it....
>
> Rick
>
>
>
> On Sat, Mar 7, 2020 at 10:13 PM Ipsita Putatunda <
> ipsita.putatunda at gmail.com> wrote:
>
>> Hi,
>> I think the length of the array "lat" is corresponding the dimension of
>> the variable. But am not sure where exactly I am making mistake to plot the
>> variable.
>> For your reference I have sent my file
>> (3A-DAY.GPM.DPR.GPM-SLH.20161231-S000000-E235959.366.V06A.HDF5) through ftp
>> in ftp.cgd.ucar.edu.
>>
>> Thanks in advance,
>> Ipsita
>>
>> On Sun, Mar 8, 2020 at 10:01 AM Rick Brownrigg <brownrig at ucar.edu> wrote:
>>
>>> Hi,
>>>
>>> Offhand, it looks like you are constructing the coordinate arrays
>>> properly. I notice you calculate the lat coordinate array with this
>>> statement:
>>>
>>>     lat=fspan(-67,67,268)
>>>
>>> Are you certain the length of this array lines up with the corresponding
>>> dimension of the variable QR?
>>>
>>> HTH...Rick
>>>
>>>
>>> On Sat, Mar 7, 2020 at 10:58 AM Ipsita Putatunda via ncl-talk <
>>> ncl-talk at ucar.edu> wrote:
>>>
>>>> Dear NCL users,
>>>> Getting warning message while trying to plot the variable.
>>>>
>>>> "Warning: Data either does not contain a valid latitude coordinate
>>>> array or doesn't contain one at all."
>>>> My script is as follows:
>>>> load "/usr/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>> load "/usr/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>>  begin
>>>>    netCDF=True
>>>>    plot=True
>>>>  diri="./"
>>>> ;==============================================================
>>>>  fn1="3A-DAY.20161231.V06A.HDF5"
>>>>  printVarSummary(fn1)
>>>>  lev=fspan(0.25,20,80)
>>>>  lon=fspan(-180,180,720)
>>>>  lat=fspan(-67,67,268)
>>>>  lat at long_name = "latitude"
>>>>  lon at long_name = "longitude"
>>>>  lat at units = "degrees_north"
>>>>  lon at units = "degrees_east"
>>>> ;-------------------------------------------------------------------
>>>>  f= addfile(fn1, "r")
>>>>  ;g=f->Grid
>>>>  QR1 = "/Grid/LHCndMean"
>>>>  QR=f->$QR1$
>>>>  QR!0="nlayer"
>>>>  QR!1="nlon"
>>>>  QR!2="nlat"
>>>>  QR&nlayer=lev
>>>>  QR&nlon=lon
>>>>  QR&nlat=lat
>>>>  QR&nlat at units="degrees_north"
>>>>  QR&nlon at units="degrees_east"
>>>>  printVarSummary(QR&nlat)
>>>>  printVarSummary(QR&nlon)
>>>> ;-------------------------------------------------------------------
>>>>  wks   = gsn_open_wks ("png","QR")
>>>>  gsn_define_colormap(wks,"rainbow")
>>>>
>>>> res                  = True
>>>> res at gsnMaximize      = True
>>>> res at cnFillOn         = True
>>>> res at cnLinesOn        = False
>>>> res at cnLineLabelsOn   = False
>>>> res at gsnSpreadColors  = True
>>>> res at gsnAddCyclic     = False
>>>>   res at mpMinLatF = min(QR&nlat)
>>>>   res at mpMaxLatF = max(QR&nlat)
>>>>   res at mpMinLonF = min(QR&nlon)
>>>>   res at mpMaxLonF = max(QR&nlon)
>>>> plot = gsn_csm_contour_map(wks,QR(0,:,:),res)
>>>>  end
>>>>
>>>>
>>>> Any help in this issue will be appreciated.
>>>> Thanks in advance,
>>>> Ipsita
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>> _______________________________________________
> 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/20200308/93fb1612/attachment.html>


More information about the ncl-talk mailing list