[Thread Prev][Thread Next][Index]

Re: title of variable



Hi Hiroyuki Tomita,
                    Let us "ferretize" things. In your first mail you mensioned
that you are reading a netCDF file "created in Ferret". In this case you can get 
a proper title to the variable if you are assigning one, before writing it to the 
output file using "SAVE" command. So in that case there is no need to go for other 
tools or workarounds. I think it will be a good habit to assign a proper title
and unit to the variable (if it does't have these) when the variable is in its
final form (to be plotted or written).

Example : 

     set data monthly_navy_winds

     let uwnd_85 = uwnd[X=60,Y=0,T="02-JAN-1985":"30-DEC-1985"@SBX:3]
     set var/title="Zonal Wind Speed (From navy_winds : 3pts smoothed)"/units="m/s" uwnd_85
    
     plot uwnd_85

     sp rm -f uwnd_85_navy_60E_0N.nc  ! to remove previous version of the file
     save/file=uwnd_85_navy_60E_0N.nc/append uwnd_85 


 Hope This Helps

 With Regards

 Jaison



On Sat, 25 Sep 2004, Hiroyuki Tomita wrote:

> Dear Ferret users,
> 
> 
> 
> I'm sorry for my late reply and I want to thank you for your helps!
> My problem was solved.
> 
> I summarize the problem and its answers here.
> 
> 
> The additional string "(T=31-DEC-1991 12:00:31-DEC-1992 12:00)" was
> in my NetCDF file as following
> 
> yes? sho data
>       currently SET data sets:
>      1> ./NRA1_WND_6HR_DAILY_1992-2000.nc  (default)
>   name     title                             I         J         K       
>    L
>   WND      NRA1 Wind Speed                  1:192     1:94      ...      
>   1:3288
>         (T=31-DEC-1991 12:00:31-DEC-1992 12:00)
> 
> I want to erase this string.
> 
> This comes from that when we "regrid" a data or append some NetCDF 
> files.
> 
> Using command ncdump -h in Unix command line,
> I confirmed this string is stored in the attribute "long_name_mod".
> We can not edit this attribute in Ferret.
> 
> To avoid this problem, three methods are suggested by ferret users.
>    1. Using Ferret
>    2. Using command ncatted in NCO
>    3. Using command ncdump and ncgen
> 
> 1. Using Ferret
>    Define new variable with new title
>   (then "long_name_mod" is not inherited to new variable) as following
> 
>    let/title="NRA1 Wind Speed" new_var = var_with_unconvenient_title
>    save/file=new_file.nc/clobber new_var
> 
> This method is very easy but a changing variable name is required.
> 
> 
>   2. Using command ncatted in NCO
>    ncatted can edit any attriibute in NetCDF.
> To erase the strings stored in attribute "long_name_mod",
> 
> ncatted -a long_name_mod,WND,d,c,"" NRA1_WND_6HR_DAILY_1992-2000.nc 
> test.cdf
> 
> This method is very smart.  But we must install NCO in a system.
> 
> 
> 3. Using command ncdump and ncgen
>    If the file is small (some MB), we can also use ncdump and ncgen
>    ncdump your_file.nc > your_file.dta
> 
> Use a good ASCII-editor (nothing like word) to
> change the header as you like.
> 
> ncgen -b -o your_new_file.nc your_file.dta
> 
> 
> 
> Thank you.
> 
> Sincerely,
> 
> 
> Hiroyuki Tomita
> 
> On 2004/09/23, at 13:13, Hiroyuki Tomita wrote:
> 
> > Dear Ferret Users,
> >
> >
> > I have a small question for ferret.
> >
> > I read a NetCDF file created by ferret
> > and then the command "show data" gives following result.
> >
> > yes? sho data
> >      currently SET data sets:
> >     1> ./NRA1_WND_6HR_DAILY_1992-2000.nc  (default)
> >  name     title                             I         J         K      
> >    L
> >  WND      NRA1 Wind Speed                  1:192     1:94      ...     
> >   1:3288
> >        (T=31-DEC-1991 12:00:31-DEC-1992 12:00)
> >
> > yes?
> >
> > I want to erace the string "(T=31-DEC-1991 12:00:31-DEC-1992 12:00)"
> > because this string does not make sense in my NetCDF file.
> > How can I do it?
> >
> > I guessed this string is title of variable,
> > so I tried to re-title using follwing command
> > set var/title="NRA1 Wind Speed" WND
> > But the string was not erased.
> >
> >
> > Best,
> >
> > Hiroyuki Tomita
> >
> >
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement