[Thread Prev][Thread Next][Index]

Re: title of variable



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




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement