[ncl-talk] sub: Time selection
Will Hobbs
will.hobbs at utas.edu.au
Sun Mar 28 16:08:52 MDT 2021
Since nobody else has bitten;
There are several approaches to the problem of getting non-standard seasonal averages; my personal experience is that the most universally-convenient way (if not necessarily the most computationally-efficient) is to reshape the array from a (time, location) format to (year,<month or day>,locn..), where obviously the <month or day> depends on whether you’re using monthly or daily data. You can then simply average across the 2nd dimension for the time indices that you want.
I’ve attached a function that will do this for monthly data, - if you have daily data you’ll need to edit it. NB this is not an official NCL function, and I take no responsibility if it breaks your machine, your data, or your career 😊
Will
From: ncl-talk <ncl-talk-bounces at mailman.ucar.edu> on behalf of dale zuri via ncl-talk <ncl-talk at mailman.ucar.edu>
Reply to: dale zuri <dalezuri at gmail.com>
Date: Saturday, 27 March 2021 at 1:46 pm
To: Ncl-talk <ncl-talk at ucar.edu>
Subject: [ncl-talk] sub: Time selection
Hi NCL users,
How to choose JJAS to compute the seasonal average from 1981-2005. ?
I would appreciate any help.
Thanks
DZ
names = getfilevarnames(f)
print(names)
x = f->ice
time = f->T
printVarSummary(x)
utc_date = cd_calendar(time, -2)
print(utc_date)
Number of Dimensions: 4
Dimensions and sizes: [T | 14086] x [zlev | 1] x [lat | 720] x [lon | 1440]
Coordinates:
T: [1358..15443]
zlev: [ 0.. 0]
lat: [-89.875..89.875]
lon: [0.125..359.875]
Number Of Attributes: 8
pointwidth : 1
valid_max : 100
scale_factor : 0.01
missing_value : -999
units : percentage
valid_min : 0
long_name : Sea ice concentration
standard_name : sea_ice_area_fraction
Variable: utc_date
Type: integer
Total Size: 56344 bytes
14086 values
Number of Dimensions: 1
Dimensions and sizes: [14086]
Coordinates:
Number Of Attributes: 1
calendar : standard
(0) 19810920
(1) 19810921
(2) 19810922
(3) 19810923
(14085) 20200413
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210328/359f5d36/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: month_to_monyear.ncl
Type: application/octet-stream
Size: 1660 bytes
Desc: month_to_monyear.ncl
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210328/359f5d36/attachment.obj>
More information about the ncl-talk
mailing list