Project

General

Profile

polar_steorographic projection in sea ice datasets

Added by Carlos Moffat 6 months ago

Hi,

I'm trying to use CDO to calculate some regional averages of sea ice. The data is provided by NSDIC in the US (https://nsidc.org/data/nsidc-0079/versions/3). I've attached an example dataset from the southern ocean.

I have two versions of CDO: 2.4.0 provided by homebrew on the Mac, which I just discovered doesn't include proj4 support:

Features: 32GB 10threads c++20 Fortran pthreads HDF5 NC4/HDF5 OPeNDAP sz

and 2.1.1 in a python's condo environment, which does:

Features: 32GB 10threads c++17 OpenMP45 Fortran pthreads HDF5 NC4/HDF5/threadsafe OPeNDAP udunits2 proj xml2 magics curl fftw3

Below I'm only using v2.1.1 given the other version doesn't have proj4 support.

This data comes on a polar_stereographic projection which I believe CDO should be able to deal with:

cdo griddes testdata.nc
#
# gridID 1
#
gridtype  = projection
gridsize  = 104912
xsize     = 316
ysize     = 332
xname     = x
xlongname = "x" 
xunits    = "meters" 
yname     = y
ylongname = "y" 
yunits    = "meters" 
xfirst    = -3937500
xinc      = 25000
yfirst    = 4337500
yinc      = -25000
grid_mapping = crs
grid_mapping_name = polar_stereographic
crs_wkt = 'PROJCS["NSIDC Sea Ice Polar Stereographic South",GEOGCS["Unspecified datum  based upon the Hughes 1980 ellipsoid",DATUM["Not_specified_based_on_Hughes_1980_ellipsoid", SPHEROID["Hughes 1980",6378273,298.279411123061,AUTHORITY["EPSG","7058"]], AUTHORITY["EPSG","6054"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]], UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4054"]], PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",70], PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0], PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]], AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3412"]]'
long_name = "NSIDC_SH_PolarStereo_25km" 
standard_parallel = -70.
inverse_flattening = 298.279411123064
proj4text = "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273  +b=6356889.449 +units=m +no_defs" 
straight_vertical_longitude_from_pole = 0.
false_easting = 0.
false_northing = 0.
semi_major_axis = 6378273.
latitude_of_projection_origin = -90.
GeoTransform = "-3950000 25000 0 4350000 0 -25000" 
longitude_of_prime_meridian = 0.
srid = "urn:ogc:def:crs:EPSG::3412" 
cdo    griddes: Processed 1 variable [0.04s 15MB]

I can average the entire sea ice field using fldmean just fine, but trying, say, to select a box fails:

cdo -sellonlatbox,-90,-70,-68,-65 -selname,F17_ICECON testdata.nc test.nc

Now, I noticed that this file contains a 'proj4text' attribute, not the 'proj4_params' as suggested in CDO's documentation, so I updated this using the setgrid command. I've attached the resulting testdata2.nc and grid.txt file I used. However, this doesn't solve the problem.

I'm sure I'm missing something glaringly obvious, but any ideas of what's going on here?

Thanks!

testdata.nc (55.6 KB) testdata.nc Original Sea Ice concentration data from NSDIC
grid.txt (1.49 KB) grid.txt Grid information with updated proj4_params
testdata2.nc (247 KB) testdata2.nc Data with updated grid description

Replies (3)

RE: polar_steorographic projection in sea ice datasets - Added by Carlos Moffat 6 months ago

I forgot to add the error message:

cdo -sellonlatbox,-90,-70,-68,-65  testdata.nc test.nc
cdo    sellonlatbox (Warning): Unsupported grid type: projection

cdo    sellonlatbox (Abort): No processable variable found!

I tried 'selname' before the sellonlatbox, but no luck.

RE: polar_steorographic projection in sea ice datasets - Added by Uwe Schulzweida 6 months ago

In sellonlatbox, projections are not automatically transformed into geographical coordinates. You can do this manually with "setgridtype,curvilinear":

cdo -sellonlatbox,-90,-70,-68,-65  -setgridtype,curvilinear  testdata.nc test.nc

RE: polar_steorographic projection in sea ice datasets - Added by Carlos Moffat 6 months ago

Hi Uwe,

Fantastic! That was it.

Carlos

    (1-3/3)