March 31 is day 90 [day_of_year(1987,3,31)]
November 1 is day 305 [day_of_year(1987,11,1) ]
There are 365 days in a climatological year.
iND = ispan(305,365,1) - 1 ; NCL subscripts start at 0
iJFM = ispan( 1, 90,1) - 1
niND = dimsizes(iND )
niJFM = dimsizes(iJFM)
i_NDJFM = new( niND+niJFM, "integer","No_FillValue")
i_NDJFM(0:niND-1) = iND
i_NDJFM(niND: ) = iJFM
print(i_NDJFM)
x_NDJFM = x(i_NDJFM,:,:,:) ; x is 4D
x_NDJFM = x(i_NDJFM,:,:) ; x is 3D
=================================
another approch, if x has a time coordinate variable:
TIME = cd_calendar(x&time, 0) ; units: "seconds/hours/days since...."
printVarSummary(TIME)
;;print(TIME(:,1)) ; print month (1=Jan, 2=Feb,...,12=Dec)
iND = ind(TIME(:,1).ge.11) ; indices
iJFM = ind(TIME(:,1).le. 3)
niND = dimsizes(iND )
niJFM = dimsizes(iJFM)
i_NDJFM = new( niND+niJFM, "integer","No_FillValue")
i_NDJFM(0:niND-1) = iND
i_NDJFM(niND: ) = iJFM
print(i_NDJFM)
x_NDJFM = x(i_NDJFM,:,:,:)
printVarSummary(x_NDJFM)
yyyymmdd = cd_calendar(x_NDJFM&time, -2)
print(yyyymmdd +" "+x_NDJFM(:,{500},{45},{270}))
On 8/23/13 1:59 PM, Xi Chang wrote:
> Hallo,,
> I have a daily climatology time series 1-366 (Jan-Dec),
> in my case, I want to plot the time series only from Nov to march,
> what should I do to set the axis with the starting point from Nov to March
> (11,12,1,2,3)
>
> Thanks
>
>
>
> _______________________________________________
> 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
Received on Sun Aug 25 20:59:33 2013
This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT