[ncl-talk] Problem with assigning coordinate
Barry Lynn
barry.h.lynn at gmail.com
Sun Mar 8 08:31:38 MDT 2020
Hi:
Are you missing two lines?
*radar&lat = latitude ; these are the latitude values*
* radar&lon = longitude ; these are the longitude values*
radar&lat at units = "degrees_north"
radar&lon at units = "degrees_east"
If you printVarSummary a variable that you know maps okay, you can infer
which values might be missing. I did this in order to map radar data that
had no attributes attached.
On Sun, Mar 8, 2020 at 4:16 PM 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
--
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581
C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200308/808b01b1/attachment.html>
More information about the ncl-talk
mailing list