[Thread Prev][Thread Next][Index]

[ferret_users] Re: ferret netcdf



Arindam,

that didn't work but it led me to the answer (on reflection, I
realise that I did not ask the question clearly). In case
anyone is interested, here's how it works.

Say for example the original data has variables:
x,y,z,h,a,b,c
and you want to create a new data set (new.nc) with:
x,y,z,h',a,b,c   (where h' is the smoothed h)

So you read in the data and smooth h. The original data is now
considered data set 1 in ferret, and h is now in data set 2
(using the procedure as outlined in the previous email but not
having cancelled either data set). Then

save/clobber/d=1/file=new.nc x,y,z
save/append/d=2/file=new.nc h
save/append/d=1/file=new.nc a,b,c 

It's ugly, but it works, and judging by the single response to
my question (yours), it may be the only way. 

Thanks very much,

John

---- Original message ----
>Date: Mon, 17 Oct 2005 10:56:08 -0400 (EDT)
>From: Arindam Chakraborty <arch@io.met.fsu.edu>  
>Subject: Re: [ferret_users] ferret netcdf  
>To: John Luick <john.luick@jcu.edu.au>
>
>hi John,
>	I use ferret 5.81. This example is working for me for my own 
>data, but the operations are same as you've quoted. So, that
should 
>work for you too most probably. Good luck.
>
>arindam
>----------------------------
> ARINDAM CHAKRABORTY
> Department of Meteorology
> Florida State University
> Tallahassee, FL-32306, USA
> Tel: +001-850-6443524 (Off)
>      +001-850-5758550 (Res)
> Fax: +001-850-6449642
>____________________________
>
>On Mon, 17 Oct 2005, John Luick wrote:
>
>> Arindam
>> 
>> thank you - I'll try that tomorrow when I get back to that
>> computer. But if anyone has alternative solutions I'd still
>> love to hear them because I have already tried almost every
>> imaginable variation on that theme (so I may have already done
>> that suggestion). Isn't there something less inelegant?
>> 
>> Thanks again
>> 
>> John 
>> 
>> 
>> ---- Original message ----
>> >Date: Mon, 17 Oct 2005 00:09:35 -0400 (EDT)
>> >From: Arindam Chakraborty <arch@io.met.fsu.edu>  
>> >Subject: Re: [ferret_users] ferret netcdf  
>> >To: John Luick <john.luick@jcu.edu.au>
>> >Cc: ferret_users@noaa.gov
>> >
>> >hi John,
>> >	instead of cancelling junk.nc (which contains your modified 
>> >variable to be renamed as h), cancell the original file
(test.nc)
>> >
>> >...
>> >use junk.nc
>> >let h=hsmo
>> >can dat 1
>> >list h
>> >
>> >hope this works.
>> >
>> >----------------------------
>> > ARINDAM CHAKRABORTY
>> > Department of Meteorology
>> > Florida State University
>> > Tallahassee, FL-32306, USA
>> > Tel: +001-850-6443524 (Off)
>> >      +001-850-5758550 (Res)
>> > Fax: +001-850-6449642
>> >____________________________
>> >
>> >On Mon, 17 Oct 2005, John Luick wrote:
>> >
>> >> Re a recent question I put to the forum, in cae anyone is
>> interested, it 
>> >> has been solved. Seems that with Version 5.51, if you try
>> to write a 
>> >> null string or a logical to a netcdf file, it causes ferret
>> to crash. 
>> >> But if you first re-define them it writes okay. Now I have
>> another problem:
>> >> 
>> >> I want to read in a netcdf file, smooth a 2d variable, and
>> write a new 
>> >> netcdf file with the smoothed variable. The tricky part is
>> doing it 
>> >> without changing the name of the saved variable. For
>> example (highly 
>> >> simplified):
>> >> 
>> >> use test.nc  (contains many variables including "h")
>> >> let hsmo = h[x=@shn:7,y=@shn:7]
>> >> save/clobber/file=junk.nc hsmo
>> >> can var hsmo
>> >> use junk.nc
>> >> let h=hsmo
>> >> can dat junk.nc
>> >> list h (causes error, because h is still associated with
>> hsmo, which was 
>> >> canned - but if you don't can hsmo, then you get a
>> recursion error instead.)
>> >> 
>> >> I could save hsmo, but of course variable names are an
>> important part of 
>> >> netcdf files so it has to be the original name (h). Surely
>> there is  a 
>> >> simple solution just beyond my fingertips.
>> >> 
>> >> Thanks
>> >> 
>> >> John
>> >>  
>> >> 
>> >
>> 
>

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement