Dear all,
After calculating SPI, I need to have a xy plot. My problem is that SPI has
3 dimensional , as you know to plot a xy plot 1 dimensional variable is
needed. So my question is how can I convert 3 dimensinal SPI to 1
dimensinal. I need to plot SPI for whole Africa cntinent, not specific
lat/lon.
Thank you in advance.
______________________________________________________________________________________________________________________________________
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
f = addfile("precip.mon.total.v6.nc","r")
prc2 = f->precip({62456:77035},{-35:37},{344:50})
time = f->time({62456:77035} )
yyyymm_i = cd_calendar(time, -2)
ntim = dimsizes(time)
year = yyyymm_i/100
firstyr = year(0)
lastyr = year(ntim-1)
nyear = lastyr-firstyr+1
YYYYMM = yyyymm_time(firstyr,lastyr , "integer")
yrfrac = yyyymm_to_yyyyfrac(YYYYMM,0.0)
dimp = dimsizes(prc2)
ntim = dimp(0)
nlat = dimp(1)
mlon = dimp(2)
len = (/3,6,12,24/)
klen = dimsizes(len)
spi = new((/klen,ntim,nlat,mlon/),float)
do k=0,klen-1
spi(k,:,:,:) = dim_spi_n(prc2, len(k), False, 0)
end do
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Aug 4 00:50:21 2013
This archive was generated by hypermail 2.1.8 : Wed Aug 07 2013 - 13:59:00 MDT