Hi Dona,
So, you want to merge a set of daily data into one file,
and a set of monthly data into another, is that correct?
For the set of files in units of days, I think Akshay's
idea should work - define a time axis for each file,
representing the days in that file, and then put the
data onto that time axis. The crucial thing there is to
use the same common time origin (Ferret sets a time
origin if you don't give one in the DEFINE AXIS
command), and the same time-axis name for all of the
input data files. Then the data from each file can be
appended to the big dataset.
However I think that instead of these commands,
let var1_with_T = t[g=gg]*0 + wnd10;\
let var2_with_T = t[g=gg]*0 + err;\
you would need to define the variables like this, to
transfer the data from the incoming time axis to the
time axis you're going to write the data on.
let var1_with_T = wnd10[gt=t_day@ASN];\
let var2_with_T = err[gt=t_day@ASN];\
I have something else to point out here. The files you
show don't have the time-axis attributes that Ferret,
and the CF standard uses to recognize calendar time
axes. The attributes must contain information in
standard attributes that spell out the time origin. Here
is the standard,
http://cf-pcmdi.llnl.gov/documents/cf-conventions/latest-cf-conventions-document-1
and the time-axis portion of the standard is here,
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/ch04s04.html
The time coordinates should have a time origin and
units, which for your data should probably be,
netcdf ws_oaflux_1985 {
dimensions:
time = UNLIMITED ; // (365 currently)
lat = 180 ;
lon = 360 ;
variables:
...
int time(time) ;
time:units = "days since 1-jan-1985" ;
...
If you wanted to do something along the lines that Hein
suggests, defining a new time axis and using Ferret
transformations to work with the time axes, these
individual yearly files would need to be first fixed
with a units attribute that specifies the time origin.
Ansley
On 4/3/2013
7:42 AM, Akshay Hegde wrote:
Hi ! Dona Clara,
try following may help you, if you modify as per
dataset, either monthly or daily
let ii=0
let yr=1984
let model={spawn:'ls *.nc '};
repeat/range=1:27 (let ii=`ii+1`; let
yr=`yr+1`;let a=model[i=`ii`];use `a`;\
let npts = `wnd10,RETURN=lsize`;\
def
axis/t="01-jan-`yr`":"31-dec-`yr`"/npoint=`npts`/units=days
t_day;\
def grid/t=t_day gg;\
let var1_with_T = t[g=gg]*0 + wnd10;\
let var2_with_T = t[g=gg]*0 + err;\
LET/units="`wnd10,RETURN=units`"/TITLE="Daily
mean neutral wind speed at 10m" Wind_Speed =
var1_with_T;\
LET/units="`err,RETURN=units`"/TITLE="Estimated
error of analysed neutral wind speed at 10m"
Error = var2_with_T;\
save/append/file=
output_filename.nc/format=cdf
Wind_Speed[l=1:`npts`],error[l=1:`npts`];\
canc data 1)
Akshay Hegde,
National Institute of Oceanography,
Goa, India.