Skip to content
Prev 24072 / 29559 Next

adapting spatial points and wrld_smpl to a reference system implicit in a .nc file

This looks like WRF <http://www.wrf-model.org/index.php> data. I just dealt
with this.
The data is on a sphere as opposed to WGS84 so you need +ellps=sphere
+a=6370000 +b=6370000 +units=m

+proj=lcc which is usually what wrf is run with.
The tricky part is:
+lat_1=25.0 +lat_2=45.0 +lat_0=38.0 +lon_0=-100.0
because every WRF run is different (the WRF Preprocessing System optimizes
the projection for the domain).
and then there is probably no shift so you need(?) +x_0=0 +y_0=0

This gives:
+proj=lcc +lat_1=25.0 +lat_2=45.0 +lat_0=38.0 +lon_0=-100.0 +ellps=sphere
+a=6370000 +b=6370000 +units=m +no_defs

But, wrf users like to give out lat and  long so you need to assign it:
+proj=longlat +ellps=sphere +a=6370000 +b=6370000 +units=m +no_defs

and then reproject the lat/long to lcc coordinates using this string:
+proj=lcc +lat_1=25.0 +lat_2=45.0 +lat_0=38.0 +lon_0=-100.0 +ellps=sphere
+a=6370000 +b=6370000 +units=m +no_defs

One word of caution, make sure you received the correct coordinates. Some
variables are run cell center while some are run at cell edge. It looks
like from your .nc file it was made by your collaborator so I assume they
are right.

That said, another word of caution, I found that the XLAT and XLONG
variables from WRF output aren't very precise. There is a "geogrid" file
from the preprocessing system that has the domain corners, resolution, nrow
and ncol from which you can make a better grid using the native projection
system (in my case it was a 4km grid). I suggest you try to get those.

I hope this helps... I have to run but wanted to save people too much head
scratching. I can get you running with more help tonight if you need.
Dominik


On Tue, Feb 23, 2016 at 11:27 AM, Agus Camacho <agus.camacho at gmail.com>
wrote:

  
  

Thread (18 messages)

Alex Mandel adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 22 Roger Bivand adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Michael Sumner adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Roger Bivand adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Dominik Schneider adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Chris Reudenbach adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Chris Reudenbach adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Michael Sumner adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Dominik Schneider adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Agus Camacho adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 23 Chris Reudenbach adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 24 Jonathan Greenberg adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 26 Jonathan Greenberg adapting spatial points and wrld_smpl to a reference system implicit in a .nc file Feb 26