[R-sig-Geo] netcdf data from Antarctica in rotated latlong - how to reproject to normal geographical coordinate system
Matthias Boer
M.Boer at westernsydney.edu.au
Thu Apr 5 09:38:31 CEST 2018
Hi all
I am having trouble extracting some climate time series for a series of field sites in Antarctica from a netcdf file with a rotated pole projection. The file (gridded monthly temperatures for 1979-2016) includes these details about the projection:
float rotated_pole[]
grid_mapping_name: rotated_latitude_longitude
grid_north_pole_latitude: -180
grid_north_pole_longitude: -150
proj4_params: -m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0
proj_parameters: -m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0
projection_name: rotated_latitude_longitude
long_name: projection details
EPSG_code:
I can read the netcdf file into R:
tst.s <- stack("filename.nc", varname="var1")
but this gives a couple of warnings that raster can't understand the projection:
Warning messages:
1: In .stackCDF(x, varname = varname, bands = bands) :
tskin has 4 dimensions, I am using the last one
2: In .getCRSfromGridMap4(atts) : cannot process these parts of the CRS:
grid_north_pole_latitude=-180; grid_north_pole_longitude=-150; proj4_params=-m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0; proj_parameters=-m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0; projection_name=rotated_latitude_longitude; long_name=projection details; EPSG_code=
3: In .getCRSfromGridMap4(atts) : cannot create a valid CRS
grid_north_pole_latitude=-180; grid_north_pole_longitude=-150; proj4_params=-m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0; proj_parameters=-m 57.295779506 +proj=ob_tran +o_proj=latlon +o_lat_p=-180.0 +lon_0=30.0; projection_name=rotated_latitude_longitude; long_name=projection details; EPSG_code=
Could anyone point me to some code to assign the correct CRS to the imported stack 'tst.s' and then to project it to the 'normal' geographical coordinate system, so I can extract time series for the field site coordinates which are in 'normal' latlong.
Thanks a lot for your time.
Cheers,
Matthias
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dr. Matthias M Boer
Hawkesbury Institute for the Environment<http://www.westernsydney.edu.au/hie> | Western Sydney University | Hawkesbury Campus, Richmond, NSW 2753, AUSTRALIA
P: +61-(0)2-4570-1373 (direct) | P: +61-(0)2-4570-1941 (admin) | E: m.boer at westernsydney.edu.au
Postal address: Locked Bag 1797 | Penrith, NSW 2751, AUSTRALIA
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list