Re: gsn_csm_lat_time

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 01 2013 - 14:21:03 MDT

Well I think you will need to rearrange the data along the time dimension. This would be most efficient to do prior to rearranging the dimensions.

obs1 = obs ; copies any metadata and coordinate information in obs to obs1
obs1(0:181,:,:,:) = (/ obs(183:364,:,:,:/) ; copy data only
obs1(183:364,:,:,:) = (/ obs(0:181,:,:,:/) ; copy data only -- element 182 stays the same

Then set up the coordinate variable. This depends how you want it displayed. The simplest thing might be to subtract 365 from your iJASOND array
iJASOND = ispan(182,365,1)- 366
etc.
obs1!0 = "i_NDJFM"
obs1&i_NDJFM = i_NDJFM

etc.
If you set the tmXBMode resource to "Explicit" you can set up appropriate strings for the tmXBLabels so the actual numbers you use for the coordinates will not be part of the plot.

Hope this helps.
 -dave

On Nov 1, 2013, at 12:51 PM, Ahmad Farsyud <a.farsyud@gmail.com> wrote:

> Hi Dave,
>
> Thanks, yes it is the output of daily climatology, it goes from 1st January to 31st Dec.
> But, I want to plot it with time axis (x) starting from July.., Aug,,, ,,,,,,,Dec,..,to June where y axis is Lat.
> I look forward to your suggestion,
>
> AF
>
>
> On Sat, Nov 2, 2013 at 2:48 AM, David Brown <dbrown@ucar.edu> wrote:
> Hi Ahmad,
> The error message is telling you what the problem is -- you are creating a non-monotonic time dimension which is not allowed for a contour plot (and for most purposes in NCL):
> Look at your print of the coordinate variable: between element 183 and 184 the value goes from 364 to 0.
> I am not exactly sure what you are trying to do. Presumably this is a daily output file. Does it start in July? Why not use the time coordinate that is in the file?
> -dave
>
>
> On Nov 1, 2013, at 9:18 AM, Ahmad Farsyud <a.farsyud@gmail.com> wrote:
>
> > Hallo,
> >
> > My codes always produced these errors once I want to plot my data using a plotting function "gsn_csm_lat_time" for a panel plot.
> >
> > warning:ScalarFieldSetValues: irregular coordinate array sfXArray non-monotonic: defaulting sfXArray
> > warning:ScalarFieldSetValues: irregular coordinate array sfXArray non-monotonic: defaulting sfXArray
> > warning:ScalarFieldSetValues: irregular coordinate array sfXArray non-monotonic: defaulting sfXArray
> > warning:ScalarFieldSetValues: irregular coordinate array sfXArray non-monotonic: defaulting sfXArray
> >
> > netcdf amp.obs.climo {
> > dimensions:
> > x = 2 ;
> > lat = 37 ;
> > level = 23 ;
> > time = UNLIMITED ; // (365 currently)
> > variables:
> > double lat(lat) ;
> > lat:standard_name = "grid_latitude" ;
> > lat:long_name = "latitude" ;
> > lat:units = "degrees_north" ;
> > lat:axis = "Y" ;
> > float level(level) ;
> > level:standard_name = "air_pressure" ;
> > level:long_name = "Pressure" ;
> > level:units = "mb" ;
> > level:positive = "down" ;
> > level:axis = "Z" ;
> > double time(time) ;
> > time:standard_name = "time" ;
> > time:units = "hours since 1958-01-01 00:00:00" ;
> > time:calendar = "proleptic_gregorian" ;
> > float amp(time, level, lat, x) ;
> >
> > yet i could not find what exactly the problem, everything seems OK for me.
> >
> > iJASOND = ispan(182,365,1)-1
> > iJFMAMJ = ispan( 1, 181,1)-1
> >
> > niJASOND = dimsizes(iJASOND)
> > niJFMAMJ = dimsizes(iJFMAMJ)
> >
> > i_NDJFM = new( niJASOND+niJFMAMJ, "integer","No_FillValue")
> >
> > i_NDJFM(0:niJASOND-1) = iJASOND
> > i_NDJFM(niJASOND: ) = iJFMAMJ
> > print(i_NDJFM)
> >
> > obsx = obs(lat|:,level|:,x|:,time|i_NDJFM)
> >
> > Thank you.
> > _______________________________________________
> > 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-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 1 14:21:14 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 09:45:33 MST