[ncl-talk] Not getting the original lat-lon label in contour map

Atul Saini atulsainimail at gmail.com
Thu Dec 5 09:04:10 MST 2019


Thank you, I will do that.

On Thu, Dec 5, 2019, 20:21 Dennis Shea <shea at ucar.edu> wrote:

> You must study the excellent document by Karin and Michael Böttinger of
> DKRZ <https://www.dkrz.de/>
>   *http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/*
> <http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/>
>
> [1] You used *gsn_csm_contour* which contours the values *but does not
> draw a map!*
>                 plot = gsn_csm_contour(wks,cv,res)
>      You must use *gsn_csm_contour_map *to get a map background
>                 plot = gsn_csm_contour*_map*(wks,cv,res)
>
> [2] Basic to NCL: the 'cv' variable **must* *have the lat/lon coordinates
> associated with it.
>      This is how the mapping knows where to plot the data.
>
> Please *study* the attached. The printVarSummary are there for you to look
> at the output.
>
>
>
> On Thu, Dec 5, 2019 at 7:38 AM Atul Saini via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>>
>> *lat=a->latprintVarSummary(lat)*
>>
>> The above given code in ncl itself results into following detail, which
>> contain the units and other things-
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Variable: latType: floatTotal Size: 200 bytes            50 valuesNumber
>> of Dimensions: 1Dimensions and sizes: [lat | 50]Coordinates:
>> lat: [ 8..20.25]Number Of Attributes: 4  standard_name : latitude
>> long_name : latitude  units : degrees_north  axis : Y*
>>
>> Regards,
>>
>>
>>
>>
>>
>> On Thu, Dec 5, 2019 at 7:59 PM Atul Saini <atulsainimail at gmail.com>
>> wrote:
>>
>>> Hi dear Karin,
>>>               I followed the same as suggested by you but it could not
>>> result into expected output. On the other hand I did 'ncdump -h' on the
>>> data file and it shows that data file contain the detail of unit of
>>> coordinate variable. May be I am still doing mistake somewhere, please
>>> suggest what should be done now, when setting lat lon unit do not work?
>>>
>>>
>>> a=addfile("WesternAgroClimRegion_MonthlySum_1901_2017Jan.nc","r")
>>> b=a->rf
>>> lat at units = "degrees_north"
>>> lon at units = "degrees_east"
>>> aveg=dim_avg_n(b,0)
>>> stdev=dim_stddev_n(b,0)
>>> ;stdev = where(stdev.ne.0,stdev,stdev at _FillValue)
>>> cv=(stdev/aveg)*100
>>> ;*****************************************
>>> ;create plot
>>> ;*****************************************
>>>   wks  = gsn_open_wks("png","CV_map")   ; send graphics to PNG file
>>>   res                     = True          ; plot mods desired
>>>   res at cnFillOn            = True          ; turn on color
>>>   res at cnLinesOn           = False
>>>   res at cnFillMode          = "RasterFill"       ; Raster Mode
>>>   res at cnFillPalette       = "gui_default" ; set color map
>>>   ;res at vpWidthF           = 0.5          ; change aspect ratio of plot
>>>   ;res at vpHeightF          = 0.3
>>>   res at gsnMaximize         = False          ; maximize plot size
>>>   ;res at gsnDraw            = False
>>>   ;res at gsnFrame           = False
>>>   plot = gsn_csm_contour(wks,cv,res)       ; contour the variable
>>>   frame(wks)
>>>   end
>>>
>>> Regards,
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Dec 5, 2019 at 7:16 PM Karin Meier-Fleischer via ncl-talk <
>>> ncl-talk at ucar.edu> wrote:
>>>
>>>> The lat and lon variables don't have a units attribute.
>>>>
>>>> lat at units = "degrees_north"
>>>> lon at units = "degrees_east"
>>>>
>>>> -Karin
>>>>
>>>> Am 05.12.19 um 13:50 schrieb Atul Saini via ncl-talk:
>>>>
>>>> Hi NCL,
>>>>               In spite of getting the real lat-lon label, I am getting
>>>> the serial number of lat-lon. Please suggest the solution!
>>>>
>>>> Please find the script and data attached with this mail.
>>>> Thanks in advance.
>>>>
>>>> Regards,
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing listncl-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
>>>
>>> _______________________________________________
>> 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/20191205/63a3e543/attachment.html>


More information about the ncl-talk mailing list