Regridding to southern hemisphere only polar stereographic

79 views
Skip to first unread message

James Pope

unread,
Sep 13, 2016, 12:18:28 PM9/13/16
to Iris

Hi,

I am trying to regrid latitude-longitude gridded data onto a polar-stereographic projection for the southern hemisphere which can be saved as a NetCDF. 

   cs = iris.coord_systems.GeogCS(iris.fileformats.pp.EARTH_RADIUS)
   target_proj = iris.coord_systems.Stereographic(-90, 0, false_easting=0.0, false_northing=0.0, true_scale_lat=-71, ellipsoid=cs)
  
   (cube_seaice_U_all_PS,extents) =  iris.analysis.cartography.project(cube_seaice_U_all, target_proj, nx=1024, ny=284 )
   iris.save(cube_seaice_U_all_PS, '/home/users/japope/BAS_Climate/users/japope/Bootstrap/SeaIce/Winds/cube_seaice_U_all_PS.nc', netcdf_format='NETCDF3_CLASSIC')


Above is the code I run and it will produce a southern hemisphere polar stereographic projection.  However, the projection contains latitudes from -89.1 to +70.1, despite only having data for -90 to -45 degrees of latitude.  I was wondering if it is possible to set the regridding to only produce data for the southern hemisphere only?

Thanks

James

Carwyn Pelley

unread,
Sep 15, 2016, 5:18:30 AM9/15/16
to Iris
Hi James,

This is documented behaviour of `iris.analysis.cartography.project`, as strange as it is :)
"This function assumes global data and will if necessary extrapolate beyond the geographical extent of the source cube using a nearest neighbour approach. nx and ny then include those points which are outside of the target projection."
http://scitools.org.uk/iris/docs/latest/iris/iris/analysis/cartography.html?highlight=project#iris.analysis.cartography.project

This means that you will have to perform an extract on your `cube_seaice_U_all_PS` cube if using `iris.analysis.cartography.project`.

Are you using `project` because your source coordinates are multidimensional?  If they are 1D orthogonal coordinates, you should use `iris.analysis.Nearest` if you want to continue using nearest neighbour or `iris.analysis.Linear` for bilinear regrid.

Does that help?

James Pope

unread,
Oct 3, 2016, 9:19:37 AM10/3/16
to Iris
Hi Carwyn,

Apologies a slow response on our part, but your suggestion has proved very helpful.

Many thanks

James
Reply all
Reply to author
Forward
0 new messages