Project

General

Profile

setting time axis unexpected attribute length

Added by Becca Rolph about 7 years ago

I am having trouble setting my time axis correctly, I get the error :

$ cdo selmon,1 1979_sfc_out.nc 1979_jan.nc
Warning (cdfScanVarAttributes) : Unexpected axis attribute length for time, ignored!
cdo selmonth: Processed 5617440 values from 1 variable over 8736 timesteps ( 0.83s )

I am using downscaled WRF output, with the lat/lon information in a separate file than the individual hourly files of data. I have tried to write new nc files which contain a CDO-supported grid (with python). I think this part was successful, except with setting the time axis. Since each nc file only contains one hour of data, I have globbed my hourly files by year, and looped reading each hourly file data so that the hourly data is appended into one yearly file with the supported grid. I have chosen my time units to be hours since 1979 Jan 2. The hours are read by taking a timedelta of the filename (which contains a timestamp) and converting it to number of hours since 1979 Jan 2.

What is CDO expecting for a time axis?

I have included my ncdump -h and cdo sinfo information below:

$ cdo sinfo 1979_sfc_out.nc
Warning (cdfScanVarAttributes) : Unexpected axis attribute length for time, ignored!
File format : NetCDF4
-1 : Institut Source Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown instant 1 1 7802 1 F32 : -1
Grid coordinates :
1 : curvilinear : points=7802 (83x94)
lon : -179.9836 to 179.9845 degrees_east
lat : 55.79358 to 73.85712 degrees_north
available : cellbounds
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 8736 steps
RefTime = 1979-01-02 00:00:00 Units = hours Calendar = standard
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
1979-01-02 00:00:00 1979-01-02 01:00:00 1979-01-02 02:00:00 1979-01-02 03:00:00

$ ncdump -h 1979_sfc_out.nc
netcdf \1979_sfc_out {
dimensions:
x = 83 ;
y = 94 ;
time = UNLIMITED ; // (8736 currently)
nv4 = 4 ;
variables:
float time(time) ;
time:axis = "time" ;
time:long_name = "time" ;
time:standard_name = "time" ;
time:units = "hours since 1979-1-2 00:00:00" ;
time:calendar = "standard" ;
float x(x) ;
x:axis = "x" ;
x:long_name = "X-coordinate in Cartesian system" ;
x:standard_name = "projection_x_coordinate" ;
x:units = "meters" ;
float y(y) ;
y:axis = "y" ;
y:long_name = "Y-coordinate in Cartesian system" ;
y:standard_name = "projection_y_coordinate" ;
y:units = "meters" ;
float lon(y, x) ;
lon:units = "degrees_east" ;
lon:valid_range = -180., 180. ;
lon:standard_name = "longitude" ;
lon:bounds = "lon_bnds" ;
float lat(y, x) ;
lat:units = "degrees_north" ;
lat:valid_range = -90., 90. ;
lat:standard_name = "latitude" ;
lat:bounds = "lat_bnds" ;
float lon_bnds(y, x, nv4) ;
lon_bnds:units = "degreesE" ;
float lat_bnds(y, x, nv4) ;
lat_bnds:units = "degreesN" ;
char mapping ;
mapping:false_easting = 0. ;
mapping:false_northing = 0. ;
mapping:grid_mapping_name = "polar_stereographic" ;
mapping:latitude_of_projection_origin = 90. ;
mapping:standard_parallel = 64. ;
mapping:straight_vertical_longitude_from_pole = -152. ;


Replies (1)

RE: setting time axis unexpected attribute length - Added by Becca Rolph about 7 years ago

Solved -- I did not put 'T' for the axis name, I had 'time' instead, which is not standard

time:axis = "time" ;

needed to be changed to

time:axis = "T";

    (1-1/1)