[ncl-talk] Coordinate Subscripting
Adam Phillips
asphilli at ucar.edu
Fri Jan 18 12:19:21 MST 2019
Hi Jalal,
Within your script you are calling cd_calendar, and then subsequently
calling day_of_year.
time at units = "days since 1998-1-1 12:00:00"
utc_date = cd_calendar(time, -5)
dyear = day_of_year(utc_date(:,0),utc_date(:,1),utc_date(:,2))
day_of_year will return numbers ranging from 1-365, and thus the values can
repeat if you have multiple years. This is not the type of array that
should be used for coordinate subscripting. I would recommend calling
cd_calendar, but retrieving the values in YYYYMMDD format, then assign this
array as a coordinate variable to your prc_reorder array:
delete(prc_reorder&time) ; may not be needed
prc_reorder&time = cd_calendar(time, -2)
then you should be able to use the following coordinate subscripting to
plot:
plot = gsn_csm_contour_map(wks,prc_reorder({19980422},:,:),res)
Hope that helps. If you have any further questions let ncl-talk know.
Adam
On Wed, Jan 16, 2019 at 11:11 PM Md. Jalal Uddin <dmjalal90 at gmail.com>
wrote:
> Hi all,
>
> I used cd_calendar to convert utc_date and day_of_year to find the day of
> year. Now, I want to subscript the time coordinate and plot. Could anyone
> help me? Please find the script in the attached.
>
> Variable: time
> Type: double
> Total Size: 22776 bytes
> 2847 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 2847]
> Coordinates:
> time: [ 120..6939]
> Number Of Attributes: 5
> standard_name : time
> long_name : Time
> units : days since 1998-1-1 12:00:00
> calendar : standard
> axis : T
>
> Best regards,
> Jalal
>
> --
> *Md. Jalal Uddin*
> MSc in Applied Meteorology (English Language)
> Nanjing University of Information, Science and Technology, China
> B.Sc. in Disaster Management (Hons.)
> Patuakhali Science and Technology University, Bangladesh.
> Cell: +8613260859092, +8801792052662
> Web: www.dmjalal90.weebly.com
> Facebook: jalal.hossen.39
> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
> Twitter: dmjalal90
> Skype: dmjalal90
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190118/ebd9bde0/attachment.html>
More information about the ncl-talk
mailing list