[ncl-talk] Fwd: Adding additional dimensions to an existing variable
Zachary Suriano
zsuriano at udel.edu
Wed Jun 10 09:58:00 MDT 2015
Thank you for the response. I will try and explain more clearly what I am
looking to achieve.
I would like to take my variable from x(time,lat,lon), where time is in
"days since YYYY-MM-DD", and make the variable be:
x(year,month,day,lat,lon), where year, month and day are their own
dimensions.
Ultimately I would like to pull out data from each month individually with
a statement such as: dec=x( : , 12 , : , : , : ). With leap days present
within the dataset, I cannot figure out a way to achieve this without
having year, month, day being their own dimensions.
Hopefully this is more clear.
Thanks!
Zac
---------- Forwarded message ----------
From: Dennis Shea <shea at ucar.edu>
Date: Tue, Jun 9, 2015 at 11:11 PM
Subject: Re: [ncl-talk] Adding additional dimensions to an existing variable
To: Zachary Suriano <zsuriano at udel.edu>
This is offline.
I am not sure of the question. It may be misleading
"Adding additional dimensions to an existing variable"
To me and I suspect others ... adding extra dimensions woylmean
x(time,lat,lon) ; 3D
Addin a fimension might be
x(ncase,time,lat,lon) ; 4D
or, even,
x(ncase,time,level,lat,lon) ; 5D
===================================
Adding extra **variables**
x(time,lat,lon)
date(time) ; (say) yyyymmdd
datesec(time) ; seconds into current date
yyyy(time)
month(time)
day(time)
hour(time)
Is this what you meant????
Please respond to ncl-talk only ...I get way too much email.
====================
You can use
f = addfile(..., "w")
f->date = date
etc
Make a copy of the file for testing purposes.
*ALWAYS* include what version of NCL u r using
ncl -V
Again ... ncl-talk only and please do not address me directly
Just make a post
Good luck
On Tue, Jun 9, 2015 at 1:25 PM, Zachary Suriano <zsuriano at udel.edu> wrote:
> Hello,
>
> I have a question regarding a ncl script I am writing. I have searched
> through the manual and online forums and have come back empty handed.
>
> I have a file of daily snow depth changes (time,lat,lon) and would like to
> add additional dimensions to the variable. Time is in "days since ..."
> format and I would like to add (in the form of additional dimensions) the
> year, month, day that correspond to the time stamp while keeping the
> original time dimension the same. This way I can quickly and easily filter
> the data by month/etc later on without having to worry about leap years
> messing with the indexing.
>
> I have the year/month/day arrays already generated from "calendar_decode2"
> but when I try to add/merge them I keep running into issues. Any
> suggestions or solutions would be very much appreciated.
>
> Thank you,
>
> Zac Suriano
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150610/ad033e19/attachment.html
More information about the ncl-talk
mailing list