Project

General

Profile

Add the units of the variables of the longitude and latitude

Added by YUU YAN about 5 years ago

Hi,

How can I add the units of the variables of the longitude and latitude(e.g. nav_lon:units = "degrees_east" )?

1.nc
double nav_lon(y, x) ;
nav_lon:valid_min = 17.9719734191895 ;
nav_lon:valid_max = 105.405693054199 ;
double nav_lat(y, x) ;
nav_lat:valid_min = 63.7000007629395 ;
nav_lat:valid_max = 80.1666641235352 ;

2.nc
double nav_lon(y, x) ;
nav_lon:units = "degrees_east" ;
nav_lon:valid_min = 17.9719734191895 ;
nav_lon:valid_max = 105.405693054199 ;
double nav_lat(y, x) ;
nav_lat:units = "degrees_north" ;
nav_lat:valid_min = 63.7000007629395 ;
nav_lat:valid_max = 80.1666641235352 ;

Thanks,

Yu


Replies (1)

RE: Add the units of the variables of the longitude and latitude - Added by Karin Meier-Fleischer about 5 years ago

Hi Yu,

try

cdo -setattribute,nav_lon@units="degrees_east",nav_lat@units="degrees_north" infile outfile

or if this won't work try NCO's ncatted program

ncatted -O -a coordinates,nav_lon,a,c,"degrees_east" -a coordinates,nav_lat,a,c,"degrees_north" infile outfile

-Karin

    (1-1/1)