[ncl-talk] Missing grid lines at zero degree
Mary Haley
haley at ucar.edu
Wed May 27 07:31:12 MDT 2015
Hi all,
Unfortunately, gsnAddCyclic isn't seen by gsn_coordinates. This is an
omission that should be fixed. I'll make a ticket for this.
Meanwhile, you can try the gsn_add_cyclic_point function, which is
unadvertised (and hence not guaranteed to live forever). This function
increases the input array by 1 point in the longitude dimension and it
increases the longitude array associated with it. I think it should work
with coordinate arrays and lat2d/lon2d attributes.
pres = True
pres at gsnCoordsAsLines = True ; Default is points
pres at gsLineThicknessF = .1
pres at gsLineColor = "Gray25"
pres at gsnCoordsAttach = True
gsn_coordinates(wks,plot1,gsn_add_cyclic_point(vMTemp),pres)
I didn't actually try this (because I'm running out the door as I type
this), so let me know if it doesn't work.
--Mary
On Wed, May 27, 2015 at 7:20 AM, Alan Brammer <abrammer at albany.edu> wrote:
> Didn't Kyle Griffin reply to this message 2 days ago?
> Did his suggestion not work?
>
> "Hi Arnold,
>
> Have you tried also setting
>
> pres at gsnAddCyclic = True
>
> This resource defaults to true in some of the newest versions of NCL, but
> defaulted to False for a long time and produces issues like this.
> gsnAddCyclic basically tells NCL to contour between the first (longitude=0)
> and last (longitude=191 in your case) the same as it does other adjacent
> points, despite these points not technically being adjacent in the dataset.
>
> If there is still an issues after trying that, let us know and be sure to
> include the list.
>
>
> Kyle
>
> ----------------------------------------
> Kyle S. Griffin
> Department of Atmospheric and Oceanic Sciences
> University of Wisconsin - Madison
> Room 1421
> 1225 W Dayton St, Madison, WI 53706
> Email: ksgriffin2 at wisc.edu
> "
>
>
> On 27 May 2015 at 02:48, <Arnold.Sullivan at csiro.au> wrote:
>
>> Hi there,
>>
>>
>>
>> Somehow I get a gap along the zero degree while plot polar region plus
>> using gsn_coordinates to plot grid lat/lon lines.
>>
>>
>>
>> Is there any way to fill that gap?
>>
>>
>>
>> The code that I use to plot the grid lines:
>>
>> ;---Data and grid read in:
>>
>> mskFile = addfile("access.n96.newu2.nc","r")
>>
>> vTemp = rm_single_dims(mskFile->NEWVAR2(0,0,:,::2))
>>
>> vMTemp = vTemp
>>
>>
>>
>> ;---Call function to attach lat/lon lines.
>>
>> pres = True
>>
>> pres at gsnCoordsAsLines = True ; Default is points
>>
>> pres at gsLineThicknessF = .1
>>
>> pres at gsLineColor = "Gray25"
>>
>> pres at gsnCoordsAttach = True
>>
>> gsn_coordinates(wks,plot1,vMTemp,pres)
>>
>>
>>
>>
>>
>> The input file information:
>>
>> ;---Ncdump the netcdf file:
>>
>> dimensions:
>>
>> LONGITUDE = 192 ;
>>
>> LATITUDE_1 = 144 ;
>>
>> HYBRID_HT = 85 ;
>>
>> variables:
>>
>> double LONGITUDE(LONGITUDE) ;
>>
>> LONGITUDE:units = "degrees_east" ;
>>
>> LONGITUDE:point_spacing = "even" ;
>>
>> LONGITUDE:modulo = " " ;
>>
>> LONGITUDE:axis = "X" ;
>>
>> double LATITUDE_1(LATITUDE_1) ;
>>
>> LATITUDE_1:units = "degrees_north" ;
>>
>> LATITUDE_1:point_spacing = "even" ;
>>
>> LATITUDE_1:axis = "Y" ;
>>
>> float NEWVAR2(T, HYBRID_HT, LATITUDE_1, LONGITUDE) ;
>>
>> NEWVAR2:missing_value = -1.e+34f ;
>>
>> NEWVAR2:_FillValue = -1.e+34f ;
>>
>> NEWVAR2:long_name = "U[G=NEW_GRID]" ;
>>
>> NEWVAR2:history = "From access.n96.uv" ;
>>
>>
>>
>>
>>
>> Regards,
>>
>>
>>
>> Arnold
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20150527/3752a267/attachment.html
More information about the ncl-talk
mailing list