Ping yang,

On Tue, Oct 23, 2012 at 7:22 AM, ping yang <pingyang.whu@gmail.com> wrote:

> Hi Robert,
>
> Thank you. Can I find an example of the proj4string for a lat/lon
> rectlinear grid at 4 km (about 0.25 arcmin)?
>

proj4string is not related to resolution. Please study the sp and raster
packages a bit. E.g. the raster vignette:
http://cran.r-project.org/web/packages/raster/vignettes/Raster.pdf


>
> I also have a question on the adjacent data file merger, Which function
> can be used to merge the adjacent files into one file spatially?
>

"merge"   (raster package)


>
> Is here a function for regriding, can I regrid a bunch of file to a
> specified resolution without knowing the grid size?
>

projectRaster or resample but both need to be used with care.

On Tue, Oct 23, 2012 at 7:22 AM, ping yang <pingyang.whu@gmail.com> wrote:

> Hi Robert,
>
> Thank you. Can I find an example of the proj4string for a lat/lon
> rectlinear grid at 4 km (about 0.25 arcmin)?
>
> I also have a question on the adjacent data file merger, Which function
> can be used to merge the adjacent files into one file spatially?
>
> Is here a function for regriding, can I regrid a bunch of file to a
> specified resolution without knowing the grid size?
>
> Looking forward to hearing from you.
>
> Regards,
>
> Ping
>
>
> On Mon, Oct 22, 2012 at 2:25 AM, Robert J. Hijmans <r.hijmans@gmail.com>wrote:
>
>> Ping,
>>
>> See projectRaster (raster package). You will need to figure out the
>> proj4string for your input data (in the next version of raster, it is
>> attempted to automate that).
>>
>> Robert
>>
>> On Thu, Oct 18, 2012 at 7:47 PM, ping yang <pingyang.whu@gmail.com>wrote:
>>
>>> Hi R user,
>>>
>>> I want to do a transform (re-projection) from a Lambert Conformal Conic
>>> (grid, Daymet netCDF data) to Lat/lon grid. Has here someone already done
>>> this kind of transformation?
>>>
>>> I will be appreciated if I can get a piece of code (or instructions) for
>>> doing this.
>>>
>>> Looking forward to hearing from you.
>>>
>>> Best Regards,
>>>
>>> Ping
>>>
>>> On Thu, Jul 5, 2012 at 1:03 PM, Tom Roche <Tom_Roche@pobox.com> wrote:
>>>
>>> >
>>> > I'd appreciate advice regarding tools and methods for transforming
>>> > values "contained" in a netCDF spatial grids in one {projection,
>>> > resolution} to another, or pointers to other resources to consult.
>>> > Apologies if the following is too verbose (I'm hoping this is a common
>>> > usecase) or uses the wrong vocabulary (please correct where needed),
>>> > but here's what I mean:
>>> >
>>> > I'm a student attempting to work on N2O using a particular atmospheric
>>> > model (CMAQ). My group want to take N2O emissions from various sources
>>> > in the continental US (CONUS) and then "blow them around" (and do some
>>> > chemistry and photolysis) with CMAQ. We have other CMAQ inputs for our
>>> > usecase on a 12 km x 12 km Lambert conformal conic (LCC) grid, so we
>>> > need to get our N2O emissions on the same grid (i.e., "regrid" them).
>>> > However, most of my emissions will be coming from global inventories
>>> > (EDGAR, GEIA, GFED) which are gridded lat-lon at differing resolutions
>>> > (e.g., 0.1°x0.1°, 1°x1°).
>>> >
>>> > I know how to reproject grid *points* (corners, centers) from lat-lon
>>> > to 12-km LCC using R package=M3
>>> >
>>> > http://cran.r-project.org/web/packages/M3/
>>> >
>>> > What I don't understand yet (algorithmically, anyway--mental picture
>>> > below) is how to reallocate gridded *values* from any one given
>>> > {projection, resolution} tuple to another. E.g.:
>>> >
>>> > EDGAR 4.2 gives the mass emitted from each 0.1°x0.1° lat-lon gridcell
>>> > over the globe. At 40° N (a middle latitude of CONUS), 0.1°x0.1° is
>>> > approx 11 km N-S x 8.5 km E-W. I need to transform the values from
>>> > those gridcells into those for a 12x12 km LCC CMAQ grid (which of
>>> > course will deviate slightly from those exact dimensions--we have the
>>> > exact grid centers and corners) over CONUS, such that, over the same
>>> > area, the sum of the masses in the CMAQ grid matches that of the EDGAR
>>> > grid.
>>> >
>>> > In the general case, each transformed/CMAQ gridcell will intersect/
>>> > overlap parts of 4 source/EDGAR gridcells, so the emissions captured
>>> > within the CMAQ gridcell will be the sum of the 4 products (for each
>>> > of the overlappings)
>>> >
>>> > overlap area *
>>> > total emissions from overlapped EDGAR gridcell /
>>> > total area of overlapped EDGAR gridcell
>>> >
>>> > Calculating that for a large grid sounds like work, but also sounds
>>> > like work someone has previously needed to do. (This doesn't sound to
>>> > me like a unique task--am I missing something?) As a coder, I'm more
>>> > than willing to reuse :-) but am wondering where to look.
>>> >
>>> > Your coding recommendations are appreciated, as would be pointers to
>>> > helpful resources. Thanks in advance, and feel free to forward,
>>> > Tom Roche <Tom_Roche@pobox.com>
>>> >
>>> > _______________________________________________
>>> > R-sig-Geo mailing list
>>> > R-sig-Geo@r-project.org
>>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>> >
>>>
>>>
>>>
>>> --
>>> Ping Yang, Ph.D.
>>> CUNY Environmental Crossroads Initiative
>>> Marshak Science Building - Suite 925
>>> The City College of New York - CUNY
>>> 160 Convent Avenue, New York NY 10031
>>> Phone: 212-650-5769
>>> Fax: 212-650-7064
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>>
>>
>
>

	[[alternative HTML version deleted]]

