[ncl-talk] Error with lonFlip

Ipsita Putatunda ipsita.putatunda at gmail.com
Sat Jun 16 11:07:10 MDT 2018


Hi,
As per Dennis's suggestion I tried commenting  commenting out the following
line:
   *;; *res at mpCenterLonF  =  -5,
But it is not working.
Adam, yes I have checked by printing out the longitudes, where I am getting
two longitudes at 0 when I lonFlip the array.
Instead of only plotting, I need to get the data for the region 20W to 10E
in an output file, in that case I think I need to lonFlip my data.
I modified my script by eliminating the cyclic point (@360 degrees), and
now it is working absolutely fine.
Thanks a lot Adam for your suggestions.

Thanks,
Ipsita


On Fri, Jun 15, 2018 at 10:03 PM, Adam Phillips <asphilli at ucar.edu> wrote:

> Hi Ipsita,
> So you know: You do not need to lonFlip the data if you are plotting
> across the original cyclic point. Thus, if your data originally runs from
> 0-360, and you want to plot the region 20W:20E, there's no need to lonFlip
> it just to plot it.
>
> I wonder though if this is the problem: According to your printVarSummary
> of the original data the cyclic point was already included:
> Variable: rl
> Type: float
> Total Size: 221184000 bytes
>             55296000 values
> Number of Dimensions: 4
> Dimensions and sizes:    [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x [LON
> | 1440]
> Coordinates:
>             LAT: [-40..40]
>         *    LON: [ 0..360]*
>
> I would try eliminating the cyclic point (@360 degrees) upon read in. Then
> proceed with your script. I bet your error message is happening because you
> have two longitudes at 0 when you lonFlip the array. You can see if this is
> true by printing out the longitudes: print(rr&LON)
>
> Hope that helps!
> Adam
>
> On Fri, Jun 15, 2018 at 7:59 AM Dennis Shea <shea at ucar.edu> wrote:
>
>> I have no idea why your script is encountering  is not working.
>>
>> *Warning:*_NhlCreateSplineCoordApprox: Attempt to create spline
>> approximation for X axis failed:
>>
>> You have:
>> *res at gsnAddCyclic  = False *
>> which is appropriate for the regional grid.
>>
>> As a wild guess, try commenting out  or deleting the following line:
>>
>>    *;; *res at mpCenterLonF  =  -5
>>
>> [SNIP]
>>  printVarSummary(rr)           ; [ncl0 | 6] x [LAT | 42] x [LON | 122]
>>
>>
>> *                                ;
>> Coordinates:                                ; LAT:
>> [-19.9373..-9.655172]                                ; LON:
>> [-19.76373..10.25712*]
>>   printMinMax(rr,0)
>> ;============================================================
>>  wks = gsn_open_wks("png","SATL")          ; send graphics to PNG file
>>   cmap = read_colormap_file("gui_default") ; read color data
>>
>>    res                 = True                             ; plot mods
>> desired
>>    res at gsnMaximize      = True                ; Maximize plot size
>>    res at cnLinesOn          = False              ; No contour lines
>>    res at cnFillOn              = True                ; color plot desired
>>    res at cnFillPalette        = cmap(:15,:)     ; set color map
>>    res at cnLineLabelsOn  = False
>>
>>    *res at gsnAddCyclic  = False *         * ; regional data ... not global*
>>    res at mpMinLatF     = -20                  ; zoom in on map
>>    res at mpMaxLatF     = -10
>>    res at mpMinLonF     = -20
>>    res at mpMaxLonF     =  10
>> *;;* res at mpCenterLonF  =  -5
>>    plot = gsn_csm_contour_map(wks,rr(0,:,:),res)
>> [SNIP]
>>
>>
>>
>>
>> On Thu, Jun 14, 2018 at 10:02 PM, Ipsita Putatunda <
>> ipsita.putatunda at gmail.com> wrote:
>>
>>> Hi Dennis,
>>> The output of my script (attached herewith) is coming as below:
>>> ***************************************
>>> Variable: rl
>>> Type: float
>>> Total Size: 221184000 bytes
>>>             55296000 values
>>> Number of Dimensions: 4
>>> Dimensions and sizes:    [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x
>>> [LON | 1440]
>>> Coordinates:
>>>             LAT: [-40..40]
>>>             LON: [ 0..360]
>>> Number Of Attributes: 1
>>>   _FillValue :    9.96921e+36
>>>
>>> Variable: rflip
>>> Type: float
>>> Total Size: 221184000 bytes
>>>             55296000 values
>>> Number of Dimensions: 4
>>> Dimensions and sizes:    [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x
>>> [LON | 1440]
>>> Coordinates:
>>>             LAT: [-40..40]
>>>             LON: [-179.8749..179.8749]
>>> Number Of Attributes: 2
>>>   _FillValue :    9.96921e+36
>>>   lonFlip :    longitude coordinate variable has been reordered via
>>> lonFlip
>>>
>>> Variable: rh
>>> Type: float
>>> Total Size: 2459520 bytes
>>>             614880 values
>>> Number of Dimensions: 4
>>> Dimensions and sizes:    [ncl_join | 20] x [ncl0 | 6] x [LAT | 42] x
>>> [LON | 122]
>>> Coordinates:
>>>             LAT: [-19.9373..-9.655172]
>>>             LON: [-19.76373..10.25712]
>>> Number Of Attributes: 2
>>>   lonFlip :    longitude coordinate variable has been reordered via
>>> lonFlip
>>>   _FillValue :    9.96921e+36
>>>
>>> Variable: rr
>>> Type: float
>>> Total Size: 122976 bytes
>>>             30744 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes:    [ncl0 | 6] x [LAT | 42] x [LON | 122]
>>> Coordinates:
>>>             LAT: [-19.9373..-9.655172]
>>>             LON: [-19.76373..10.25712]
>>> Number Of Attributes: 3
>>>   _FillValue :    9.96921e+36
>>>   lonFlip :    longitude coordinate variable has been reordered via
>>> lonFlip
>>>   average_op_ncl :    dim_avg_n over dimension(s): ncl_join
>>> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
>>> approximation for X axis failed: consider adjusting trXTensionF value
>>> warning:IrTransInitialize: error creating spline approximation for
>>> trXCoordPoints; defaulting to linear
>>> ***********************************************
>>>
>>> Thanks,
>>> Ipsita
>>>
>>> On Thu, Jun 14, 2018 at 11:22 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> Without knowing the 'structure' of the original variable, it is hard to
>>>> offer any help.
>>>>
>>>> As ncl-talk suggests, the user should **always include* t*he output
>>>> from *printVarSummary *of the original variable.
>>>>
>>>>   rl=f[:]->rh                          ; do *not* use (:,:,:,:) when
>>>> importing entire variable; it is inefficient
>>>>   *printVarSummary(rl)*
>>>>   rflip=lonFlip(rl)
>>>>
>>>>
>>>> *printVarSummary(rflip)*  rh=rflip(:,:,80:121,640:761); [-20S to -10S,
>>>> 20W to 10E]
>>>>
>>>>   lat=rh&LAT
>>>>   lon=rh&LON
>>>>
>>>>   rh&LAT at units = "degrees north"
>>>>   rh&LON at units = "degrees east"
>>>>   *printVarSummary(rh)*
>>>>   rr=dim_avg_n_Wrap(rh,0)
>>>>   *printVarSummary(rr)*
>>>>
>>>>
>>>> On Thu, Jun 14, 2018 at 4:57 AM, Ipsita Putatunda <
>>>> ipsita.putatunda at gmail.com> wrote:
>>>>
>>>>> Dear all,
>>>>> I want to plot a region [10S to 20S;20W to 10E] over South Atlantic,
>>>>> my script is attached herewith, which is giving warning message like below-
>>>>>
>>>>> *****************************************
>>>>> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
>>>>> approximation for X axis failed: consider adjusting trXTensionF value
>>>>> warning:IrTransInitialize: error creating spline approximation for
>>>>> trXCoordPoints; defaulting to linear
>>>>> ********************************************
>>>>> Please help me in this issue. Any suggestions 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
>>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180616/29b51251/attachment.html>


More information about the ncl-talk mailing list