Project

General

Profile

Reduce data after masking

Added by s r over 5 years ago

Hi,

I try to reduce/regrid data after masking.
Here, the command I use :

cdo ifthen mask.nc Data_BASE_1961.nc Data_BASE_1961_masked.nc
mask.nc contains 1 or missing value.
dimensions:
Nbre_lat = 1069 ;
Nbre_lon = 1069 ;
variables:
int Nbre_lat(Nbre_lat) ;
Nbre_lat:long_name = "Nbre_lat" ;
int Nbre_lon(Nbre_lon) ;
Nbre_lon:long_name = "Nbre_lon" ;
float mask(Nbre_lon, Nbre_lat) ;
mask:_FillValue = 1.e+32f ;

and Data_BASE_1961_masked.nc
dimensions:
Nbre_lat = 1069 ;
Nbre_lon = 1069 ;
time = UNLIMITED ; // (3 currently)
variables:
int Nbre_lat(Nbre_lat) ;
Nbre_lat:long_name = "Nbre_lat" ;
Nbre_lat:axis = "X" ;
int Nbre_lon(Nbre_lon) ;
Nbre_lon:long_name = "Nbre_lon" ;
Nbre_lon:axis = "Y" ;
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:units = "seconds since 1961-01-01 00:00:00" ;
time:calendar = "standard" ;
time:axis = "T" ;
double CO2air(time, Nbre_lon, Nbre_lat) ;
CO2air:long_name = "Near Surface CO2 Concentration" ;
CO2air:units = "kg/m3" ;
CO2air:_FillValue = -9.e+33 ;
CO2air:missing_value = -9.e+33 ;
double LAT ;
LAT:long_name = "latitude" ;
LAT:units = "degrees_north" ;
LAT:_FillValue = -9.e+33 ;
LAT:missing_value = -9.e+33 ;
double LON ;
LON:long_name = "longitude" ;
LON:units = "degrees_east" ;
LON:_FillValue = -9.e+33 ;
LON:missing_value = -9.e+33 ;

How to reduce the size and regrid Data_BASE_1961_masked.nc to keep only non missing value (and keep all variables) ?
I tried regrid/remap function unsuccessfully. Mask.nc is an irregular grid (selection of some points).

Thanks a lot,


Replies (1)

RE: Reduce data after masking - Added by Karin Meier-Fleischer over 5 years ago

Hi,

maybe you should use netCDF4 compression to reduce the size of the files.
Here is an example of the size difference:

cdo -f nc4 -z zip_4 copy Data_BASE_1961_masked.nc outfile.nc
Data_BASE_1961_masked.nc  45720392 bytes
outfile.nc                   82029 bytes

-Karin

    (1-1/1)