how can I do a inverse coordinate transformation in the netcdf file ?
I have a grid with 75 longitude values and 36 latitude values:
nc<-create.n("filename.nc")
#Dimentions
dim.def.nc(nc,"lon",75)
dim.def.nc(nc,"lat",36)
dim.def.nc(nc,"time",365)
#Vars
var.def.nc(nc,"Observation","NC_FLOAT", c(1,0,2))
var.def.nc(nc,"lon","NC_FLOAT", c(0))
var.def.nc(nc,"lat","NC_FLOAT", c(1))
var.def.nc(nc,"time","NC_FLOAT", c(2))
(...)
According to the documentation in unidata, it should be possible to have the netcdf doing the inverse transformation from (lat,lon) to (x,y), but I don’t have any idea how I can perform this. I want to transfor my lat long grid to a Lambert Conformal grid.
This is the way I proceed myself to reproject a netCDF file: basically I grab the longitude, the latitude and the data I want and create a shapefile that I can then work with with packages
rgdal,spandmaptools. (The example here uses data from NOAA downloaded here)