[Thread Prev][Thread Next][Index]

Re: [ferret_users] merging netcdf files



Hi Paul,
For these two files which are not large, it might be simplest to have Ferret write a new file with all of the data. Descriptor files or another kind of aggregation is very useful if there are many files, to avoid having to read and write a lot of data.  If you have more files to handle, then we might need to work on getting a good descriptor file.

Can you do this?

yes? use s1-3.cdf
yes? use s4-6.cdf

yes? save/file=1_6.cdf s[d=1]
yes? save/append/file=1_6.cdf  s[d=2]

This should work fine if the time axis specifications are compatible with each other.  If you run into trouble trying this, there may be some problem with the files - the error message from ncrcat makes me wonder if that is the case.  If the Ferret commands above do not work on your files, then looking at the output of the Unix command ncdump may help you understand what's going on with the files:

> ncdump -h s1-3.cdf
> ncdump -h
s4-6.cdf

And ncdump -c lists the coordinate values, which can also be helpful.

Ansley


On 10/27/2010 11:07 AM, STEEVEN PAUL YERRAGUNTLA wrote:
Dear ferreters,
     I want to merge two netcdf files, where second file having consecutive time steps to first file time steps.   I tried in three ways (1). I tried  to make Descriptive fle but resultant des file showing error as follows
 
    yes? use test.des
 **TMAP ERR: Error in namelist record
             Error in: STEPFILE_RECORD  1
             Data set: ./test.des

(2).I tried another command NCRCAT, which results in error as follows:  ncrcat: ERROR input file salt_600_8697.cdf lacks a record dimension.

(3). Followed an answer in archives, which is as follows. 
*************
def axis/t=.... taxm            ! define the merged time axis
def grid/like=v1[d=1]/t=taxm gm ! the merged grid
let/title="Merged variable" vm=if(L le 5)then v1[d=1} else v2[d=2]
**************

I am not clear about if condition checking, and tried above examples in the following way.

yes? sh da
     currently SET data sets:
    1> ./s1-3.cdf
 name     title                             I         J         K         L
 S        Salinity                         1:161     1:91      1:60      1:3
 
    2> ./s4-6.cdf  (default)
 name     title                             I         J         K         L
 S        Salinity                         1:161     1:91      1:60      1:3
 

yes? def grid/like=s[d=1]/t=taxm gm
yes? let/title="Merged Variable" sm=if(L le 3) then s[d=1] else s[d=2]
yes? save/file=stest.cdf  sm
 *** NOTE: Ambiguous coordinates on T axis: IF(L LE 3) THEN S[D=1] ELSE S[D=2]
 *** NOTE: Ambiguous coordinates on T axis: IF(L LE 3) THEN S[D=1] ELSE S[D=2]
 LISTing to file stest.cdf
But output files show only first file time steps only.

yes? sh da
         3> ./stest.cdf  (default)
 name     title                             I         J         K         L
 SM       Merged Variable                  1:161     1:91      1:60      1:3

How to add step file record in netcdf file, if it required to make descriptive file?. Is there any way to achieve merging in ferret itself.
Hope somebody will spare sometime and answer me.

thanks in advance.

regards,
- Paul.






--
Steeven Paul Y
Research Fellow
NIO RC Vizag
176 Lawsons Bay Colony
Visakhapatnam - 530017

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement