Skip to content

"regridding" netCDF?

5 messages · Tom Roche, Tomislav Hengl

#
ping yang Thu, 18 Oct 2012 22:47:07 -0400
No, but I have done a reverse regridding (from lon-lat to LCC), which
could be quite similar. See code @

https://github.com/TomRoche/GEIA_to_NetCDF

esp

https://github.com/TomRoche/GEIA_to_netCDF/blob/master/regrid.global.to.AQMEII.r

HTH, Tom Roche <Tom_Roche at pobox.com>
#
I've produced some 3D interpolation examples in the experimental package 
GSIF (under construction). You can actually create some kind of voxels 
via the SpatialPixelsDataFrame class 
[http://gsif.r-forge.r-project.org/make.3Dgrid-method.html] and then 
predict at those locations. Here are some examples:

http://gsif.r-forge.r-project.org/tutorial_eberg.php

T. Hengl
http://www.wewur.wur.nl/popups/vcard.aspx?id=HENGL001
On 01/11/2012 07:21, Tom Roche wrote:
3 days later
#
summary: how to use GSIF::make.3Dgrid for general-purpose "reboxing," or
3D interpolation? Particularly, can one use varying vertical bounds
rather than the same "standard depths" for both input and output?

details:

Apologies if the following questions reveal a profound ignorance of
spatiality or geostatistics (which I'm learning slowly and "on-the-fly")
and if I'm missing something simple regarding GSIF; unfortunately the
tutorial

http://gsif.r-forge.r-project.org/tutorial_eberg.php

seems to require more geostatistical background than I currently have.

https://stat.ethz.ch/pipermail/r-sig-geo/2012-November/016573.html
To further specify: my global IC/BC estimates mass concentration for
each box/voxel in a regular, unprojected grid 1.875? x 2.5? x 56 levels.
I want to "rebox" from global IC/BCs to model-ready IC/BCs, where the
latter must estimate mass concentration over a regular grid that
horizontally projects to LCC over North America at 12-km resolution, and
which has 34 vertical levels. (Both the vertical and horizontal extents
of the model-ready IC/BC are subsets of the global extents.) I can
compute the sizes of the boxes, so I can compute the mass in each input
box, and recompute the output concentrations, presuming I can learn how
to rebox the masses.

https://stat.ethz.ch/pipermail/r-sig-geo/2012-November/016578.HTML
From

http://gsif.r-forge.r-project.org/make.3Dgrid-method.html

it appears one can provide as input

* an unprojected SpatialPixelsDataFrame or RasterBrick

* a PROJ.4 string defining the output CRS

* a "list of standard depths"

and get an output list of SpatialPixelsDataFrame's (one per standard
depth). From the description, it seems like GSIF::make.3Dgrid is doing a
2D regridding at each standard depth, such that the heights of the input
box/voxels must match that of the output box/voxels. Is that correct?

If not, how can one rebox from an input with one set of layer heights
(or vertical bounds) to an output with another set of layer heights?
Can `gdalwarp` do that, or is it (like, IIUC, raster::projectRaster)
restricted to 2D?

Your assistance is appreciated! Tom Roche <Tom_Roche at pobox.com>
#
On 05/11/2012 05:58, Tom Roche wrote:
Yes. You can predict at irregular locations by using 
SpatialPointsDataFrame object e.g.:

 > obj = data.frame(x = 100, y = 100, d = -.2, DEM = 122)
 > coordinates(obj) <- ~x+y+d

The names of coordinate fields in the gstatModel and for the new 
locations must correspond. See also:

http://gsif.r-forge.r-project.org/tutorial_eberg.php#visualizing_uncertainty
Yes. I'm also on the edge here :)
1 day later
#
Tom Roche Thu, Nov 1, 2012 at 2:21 AM
ping yang Tue, 6 Nov 2012 20:36:12 -0500 (rearranged)
Thanks to Dr Hijmans (and, presumably, his funders) for package=raster.
Hopefully this will free folks who run Eulerian models from having to
write Fortran merely to do this kind of one-off data assimilation. (And
hopefully we can figure out how to do this in 3D for boundary/initial
conditions.)
Feel free to ask questions and CC: r-sig-geo
Me too--I was only java and python until about a year ago.

FWIW, Tom Roche <Tom_Roche at pobox.com>