[ncl-talk] Problem with assigning coordinate
Rick Brownrigg
brownrig at ucar.edu
Sun Mar 8 08:15:49 MDT 2020
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
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200308/964304e1/attachment.html>
More information about the ncl-talk
mailing list