Re: mergetime with different time units

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 25 2013 - 13:28:31 MDT

Adam's NCL solution is better than mine. But if your objective is
simply to make a concatenated Netcdf file, NCO is the simplest way.

--Dave

On Wed, Sep 25, 2013 at 1:21 PM, Dave Allured - NOAA Affiliate
<dave.allured@noaa.gov> wrote:
>
> NCO utilities have this capability built in to recent versions. It is
> an extremely simple and robust solution for this problem, if you do
> not mind creating a new concatenated file. They call this "time
> rebasing".
>
> Here is an overview of a straightforward method for NCL. There is
> more than one way to do this:
>
> 1. Use the cd_calendar function to decode the time coordinates of
> each file into time series of separate date numbers year, month, day,
> hour, etc. You will get arrays (N1, 6) and (N2, 6). See the function
> documentation.
>
> 2. Concatenate these two decoded arrays. You should now have a
> single array (N, 6) where N is the total number of time steps (N1 +
> N2), and 6 is the dimension for the separated year, month, day, etc.
> numbers.
>
> 3. As needed, concatenate the associated data arrays along the time dimension.
>
> 4. If needed, you can re-encode the time coordinates back to CF-style
> time coordinates, by using cd_inv_calendar on the concatenated
> date/time array from step (2). For the unit string, recycle the time
> unit string from the EARLIEST data being concatenated. You could also
> use a different unit string of your choice, if you are careful about
> roundoff error. HTH.
>
> Please reply only to the user list.
>
> --Dave
>
> On Wed, Sep 25, 2013 at 12:38 PM, Xi Chang <xi.chang01@gmail.com> wrote:
>> Hallo NCL,,
>>
>> Is there any solution in NCL to merge two netcdf data with different time
>> units?
>> for instance I have two daily datasets, say:
>>
>> X.nc: 1990-2010 time units hours since 1955-01-01 00:00:00
>> Y.nc: 2011-2013 time units hours since 1980-01-01 18:00:00
>>
>> how could I combine or merge the time in these two datasets?
>> Thank you for any hints..
>>
>> Xi
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 25 13:28:38 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 01 2013 - 14:41:43 MDT