[GRASS-user] "reboxing," or 3D regridding

Benjamin Ducke benducke at fastmail.fm
Wed Nov 14 19:52:13 PST 2012


Tom -- this is an interesting use case.

I think you need to separate the reprojection step from
the resampling step. Maybe you could first
extract and reproject each one of the 56 lat/lon data slice
as an individual 2D raster layer, then stack the levels
into a new GRASS 3D raster.

For the next step, you would need some method to
resample/interpolate the voxel data to your target resolution.
Since you want fewer output than input slices, the easiest
option would be to just set the the GRASS region's Z resolution
to the number of output levels and let GRASS do a simple
linear resampling. But I am not sure that will give
a quality that's good enough for your purposes. Try it.

Best,

Ben

-- 
Benjamin Ducke
{*} Geospatial Consultant
{*} GIS Developer
  
  benducke AT fastmail.fm

On Wed, Nov 14, 2012, at 19:27, Tom Roche wrote:
> 
> summary: I'd appreciate advice regarding tools and methods for
> transforming data attributed to voxels in an unprojected global grid
> onto a projected 3D grid with different horizontal and vertical
> resolution (or pointers to other resources to consult).
> 
> details:
> 
> ESMF defines well (if somewhat oddly) the general problem:
> 
> http://www.earthsystemmodeling.org/esmf_releases/public/ESMF_5_2_0rp1/ESMF_refdoc/node3.html#SECTION03020000000000000000
> > Regridding, also called remapping or interpolation [or resampling], is
> > the process of changing the grid that underlies data values while
> > preserving qualities of the original data.
> 
> ESMF seems to provide excellent tools for doing 2D regridding (or
> interpolating data values from the cells/pixels of one 2D/horizontal
> spatial grid to another), as does GRASS::r.proj
> 
> http://grass.osgeo.org/grass64/manuals/html64_user/r.proj.html
> 
> though I have not used either, and am quite new to GRASS. (My current
> personal favorite regridding tool is the R package 'raster': see code @
> 
> https://github.com/TomRoche/GEIA_to_netCDF/
> 
> ) However I'm not seeing tools for "reboxing," or interpolating data
> values from the boxes/voxels of one 3D/horizontal+vertical spatial grid
> to another. Am I missing something? I _do_ see (thanks, Doug Newcomb)
> raster3D
> 
> http://grass.osgeo.org/grass64/manuals/html64_user/raster3D.html
> 
> but I don't see r3 API that does what I want:
> 
> I have output from a global atmospheric model that I'd like to use as
> initial/boundary conditions for a regional model. This unprojected
> "global input" (from the perspective of this usecase) netCDF has
> dimensions=2.5° lon x 1.875° lat x 56 vertical levels. The regional
> model covers North America using a 12-km grid projected LCC (Lambert
> Conic Comformal), with 34 vertical levels: details @
> 
> https://github.com/TomRoche/cornbeltN2O/wiki/AQMEII-North-American-domain#wiki-EPA
> 
> The top height of the "regional output" is less than that of the global
> input; i.e., the input domain fully contains the output domain, in all
> 3 dimensions.
> 
> Each box/voxel of the global input grid contains an estimate of its N2O
> concentration. From those data I want to compute the concentrations for
> each output box. I'd appreciate your recommendations for tools that can
> do this. The best tool I've seen so far is R package=gstat, but (IIUC)
> 
> - gstat expects projected input. I'm not sure if I can work around that
>   for this usecase. Is there a conservative projection over North
>   America to which I could safely transform values from lon-lat
>   (essentially via cropping?) in order to input them to gstat?
> 
> - as the name implies, 'gstat' is doing geostatistical (variogram- and
>   covariance-based) modeling. I'm not sure either how to setup the
>   distance weighting for my usecase. I'm also unconvinced that a
>   statistical approach is necessary for this usecase, though it may be a
>   sufficient, or the best-available, approach; furthermore my position
>   may just be a prejudice due to my statistical ignorance.
> 
> TIA, Tom Roche <Tom_Roche at pobox.com>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list