Re: overlay problem

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 09 2012 - 09:11:52 MST

Cheung,

When I ran your script, I got two error messages about needing to set gsnAddCyclic to False:

(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0) You may want to set gsnAddCyclic to False to avoid a warning
(0) message from the spline function.
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
(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0) You may want to set gsnAddCyclic to False to avoid a warning
(0) message from the spline function.
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

Once I did this for both res and res1, your script seemed to work fine. See attached EPS file.

--Mary

On Jan 9, 2012, at 9:03 AM, Cheung wrote:

> Hi, this is my scripts, My ncl version is 6.0.0, and I find the result may be also different when I use 5.2.1, but still wrong.
>
>
> THX
>
>
> At 2012-01-09 23:36:25,"Mary Haley" <haley@ucar.edu> wrote:
>
> What does the printVarSummary output report?
>
> It would help if you could provide the data file, so I can run your script here.
>
> If you set res1@tfDoNDCOverlay, then you have to be very careful that you've set the map projection *exactly* to match the map projection of your data. If you don't, you will get incorrect results. It's much better if you can provide lat/lon coordinate values for your data.
>
> - -Mary
>
> On Jan 9, 2012, at 8:27 AM, Cheung wrote:
>
>> I 've done as you said, and tail_prob does have coordinate info, but without res1@tfDoNDCOverlay, it still cannot be overlayed,
>>
>> But the res1@tfDoNDCOverlay may generate a unreasonable result.
>>
>>
>>
>> At 2012-01-09 22:49:13,"Mary Haley" <haley@ucar.edu> wrote:
>> I noticed you have:
>>
>>> plot1 = gsn_csm_contour(wks,gsn_add_cyclic_point(tail_prob), res1)
>>
>>
>> It is better to handle the cyclic point via the "gsnAddCyclic" resource:
>>
>>
>> ;res1@gsnAddCyclic = True
>> plot1 = gsn_csm_contour(wks,tail_prob, res1)
>>
>> You may also need to comment out:
>>
>>> ; res1@tfDoNDCOverlay = True
>>
>>
>>
>> Does "tail_prob" contain any coordinate information?
>>
>>
>> printVarSummary(tail_prob)
>>
>> This could be the source of your problem if it doesn't.
>>
>> --Mary
>>
>>
>> On Jan 9, 2012, at 7:22 AM, Cheung wrote:
>>
>>> Dear all:
>>>
>>> & amp; nbsp; I wanna plot a kind of figs like contour on contour, example 4, but for a regional domain.
>>>
>>> And I find I can not overlay my significant level dots plots onto the base map(like fig1), but if I set "res1@tfDoNDCOverlay = True", it's
>>>
>>> ok, but the edge of my plot lose some dots which definitely should be there(see fig2 right edge of my plot, a space which should not appear, I've
>>>
>>> checked the data).
>>>
>>> So does anyone know how to solve this ?
>>>
>>> Thanks a lot!
>>>
>>>
>>> And below is my ncl resources:
>>>
>>> res &nb sp; = True
>>> res@gsnSpreadColors = True
>>> res@gsnSpreadColorStart = 18
>>> res@gsnSpreadColorEnd = 2
>>> res@gsnDraw = False
>>> res@gsnFrame = False
>>> res@gsnAddCyclic = False
>>> res@mpFillOn = False
>>> res@mpLimitMode = "Corners"
>>> res@mpLeftCornerLatF = 10.
>>> &a mp;a mp;n bsp; res@mpRightCornerLatF = 45.
>>> res@mpLeftCornerLonF = 90.
>>> res@mpRightCornerLonF = 125.
>>> res@cnFillOn = True
>>> res@cnLinesOn = False
>>> res@cnLineLabelsOn = False
>>> res@cnLevelSelectionMode = "ManualLevels"
>>> res@cnLevelSpacingF = 1.
>>> res@cnMinLevelValF = -5.
>>> res@cnMaxLevelValF = 5.
>>> & amp; lt; div> res@gsnLeftString = ""
>>> res@gsnCenterString = ""
>>> plot = gsn_csm_contour_map(wks,below_avg(:,:),res)
>>>
>>> res1 = True
>>> res1@gsnDraw = False
>>> res1@gsnFrame = False
>>> ; res1@tfDoNDCOverlay = True
>>> res1@gsnAddCyclic = False
>>> res1@cnLevelSelect ion Mode = "ManualLevels" ; set manual contour levels
>>> res1@cnMinLevelValF = 0.00 ; set min contour level
>>> res1@cnMaxLevelValF = 1.05 ; set max contour level
>>> res1@cnLevelSpacingF = 0.01 ; set contour spacing
>>> res1@cnInfoLabelOn = False ; turn off info label
>>> res1@cnLinesOn = False ; do not draw contour lines
>>> res1@cnLineLabelsOn = False &am p;am p;nb sp; ; do not draw contour labels
>>> res1@cnFillScaleF = 0.6 ; add extra density
>>> res1@tiXAxisString = ""
>>> res1@tiYAxisString = ""
>>> plot1 = gsn_csm_contour(wks,gsn_add_cyclic_point(tail_prob), res1)
>>> plot1 = ShadeLtContour(plot1, 0.02, 17) ; shade all areas less than the
>>> overlay(plot, plot1)
>>> draw(plot)
>>> frame(wks)
>>>
>>>
>>>
>>> <fig1.tiff><fig2.tiff>_______________________________________________
>>> 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
>
>
>
> <NCL.tar>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 9 09:12:05 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST