[Thread Prev][Thread Next][Index]

Re: [ferret_users] time axis issue / appending netcdf files



Hi Vincent,

> I would like to append two netcdf files that follow up on time, but in
> which t starting index is same:

I've had trouble with this as well.  You could try concatenating the
files with ncrcat, then re-writing the time axis manually with Ferret.
The following may work directly from Ferret (but I'm afraid it won't):

! N:M should span the whole data range
define axis /t=N:M  my_new_common_time_axis      

use data1.nc
! you may have to specify l=N:M   here as well
! N:M would be just the time range in file 1
save /file=new.nc myvar[gt=my_new_common_time_axis]

use data2.nc
! you may have to specify l=N:M   here as well
! N:M would be just the time range in file 2
save /append /file=new,nc myvar[gt=my_new_common_time_axis]


The alternative is (probably the easiest):

ncrcat file1.nc file2.nc catenated.nc

use catenated.nc     ! will probably complain about invalid time axis
define axis /t=blabla  my_new_common_time_axis   ! full time range
save /file=new.nc myvar[gt=my_new_common_time_axis@asn]


A final alternative is to try to re-write each file with ferret to a
common time axis base, then use ncrcat to concatenate them:


! repeat for each file
define axis /t=N:M  /t0="01-jan-1970"  my_new_common_time_axis
use file1.nc
save /file=file1_fixed.nc my_var[gt=my_new_common_time_axis]

! now catenate
ncrcat file*_fixed.nc  catenated_fixed.nc



Kind regards,

     Hein Zelle


-- 

Dr. Hein Zelle
Advisor Meteorology & Oceanography

Tel:        +31 (0)527-242299
Fax:        +31 (0)527-242016
E-mail:     hein.zelle@xxxxxxxxxxxxx
Website:    www.bmtargoss.com
	    
BMT ARGOSS b.v.

Voorsterweg 28, 8316 PT Marknesse, the Netherlands
Postal address: P.O. Box 61, 8325 ZH Vollenhove, the Netherlands

Registered in The Netherlands, Registered no. 39060160.

Unless otherwise agreed by BMT ARGOSS in writing, all work,
services, goods or products supplied by BMT ARGOSS shall be subject
to and governed by BMT ARGOSS' own terms and conditions which are
available for inspection from BMT ARGOSS on request.

----Confidentiality Notice & Disclaimer---- 

The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement