[ncl-talk] help

Alan Brammer abrammer at albany.edu
Tue Sep 8 21:04:27 MDT 2015


http://www.ncl.ucar.edu/Document/Functions/Contributed/latGauWgt.shtml
First result from googling
"ncl Gaussian weights"

2nd. Unless specified keep replies to the list.

Gd luck.
On 8 Sep 2015 10:36 p.m., "afwande juliet" <afwandej965 at gmail.com> wrote:

> dear Allan thanks alot for pointing this out for me. Actually the sst and
> CMAP data all have 3D(time,lat,lon) and I want to plot the two in
> timeseries anomalies. So that I have years running from 1978-2008, Y axiis
> I plot the anomalies something like this. This example script used gausian
> weights(gw) and yet my data has no gausian weights. How do I handle that.
>
> http://www.ncl.ucar.edu/Applications/Scripts/xy_18.ncl
>
>
>
> On Tue, Sep 8, 2015 at 10:48 PM, Alan Brammer <abrammer at albany.edu> wrote:
>
>>  sst(time.lat,lon)
>> * sst(ind_warm)*
>> You're defining a 3d variable with only 1 dimension.  What do you want to
>> happen with the spatial dimensions ?
>>
>> You need to reference the lat and the lon dimension in some form.
>> sst(ind_warm, :, :)   ;; select the whole grid.
>>
>> Now y is still 3 dimensions. Which you're not going to be able to plot in
>> any meaningful way on an xy plot.
>> y = dim_avg_n_Wrap( sst(ind_warm, :, :) , (/1,2/) )  ;; Now you have a
>> global average for each "warm year"
>>
>> Good luck.
>>
>>
>>
>> On Tue, Sep 8, 2015 at 9:42 AM, afwande juliet <afwandej965 at gmail.com>
>> wrote:
>>
>>> Hello
>>>
>>> I am doing timeseries for Warm years for sst and CMAP data.
>>> how do i make the left and right dimension be same especilly
>>> here........ * y       = sst(ind_warm*).........see it in main script.
>>> it complains about left and right dimension not same. my data is
>>> sst(time.lat,lon) and am plotting only warm years
>>>  thanks
>>>
>>> below is script
>>>
>>> begin
>>> ;************************************************
>>> ; Read in data
>>> ;************************************************
>>>   f     = addfile ("sst.mnmean.nc","r")
>>>   time  = f->time                                 ; access date
>>>   sst   = (f->sst)*0.1                            ; scale sst anomalies
>>> ;************************************************
>>> ; extract warm years from data
>>> ;************************************************
>>>   warm_yrs  = (/1951,1953,1957,1963,1965,1969,1972,1976,1982,1987,1991/)
>>>   warm_time_yrs = warm_yrs * 100 + 01             ; match format of date
>>> array
>>>   nwarm     = dimsizes(warm_yrs)                  ; how many warm years
>>>   ind_warm  = new(nwarm,integer)                  ; create array
>>>   do n=0,nwarm-1
>>>     ind_warm(n)  = ind(warm_time_yrs(n).eq.time)
>>>   end do
>>>  * y       = sst(ind_warm)*
>>>   x     = ispan(0,nwarm-1,1)
>>> ;************************************************
>>> ; create plot
>>> ;************************************************
>>>   wks   = gsn_open_wks ("x11","xy")                ; open ps file
>>>   res               = True                        ; plot mods desired
>>>
>>>   res at tmXBMode          = "Explicit"              ; explicit labels
>>>   res at tmXBValues        = x                       ; location of labels
>>>   res at tmXBLabels        = warm_yrs                ; labels themselves
>>>   res at tmLabelAutoStride = True                    ; nice stride on
>>> labels
>>>   res at tiMainString      = "Explicit axis labeling"; title
>>>   plot  = gsn_csm_xy(wks,x,y,res)
>>> end
>>>
>>> _______________________________________________
>>> 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/20150908/95515477/attachment.html 


More information about the ncl-talk mailing list