Tom,

It would be useful to provide a simple self-contained example (of R code)
of what you are trying to achieve. Apparently something involving
projecting, plotting, and writing to ncdf files. It appears you start with
a global long/lat raster. So you could start the example with:

library(raster)
r <- raster()
r[] <- 1:ncell(r)

now what do you want to do next?

Robert



On Mon, Oct 22, 2012 at 9:00 PM, Tom Roche <Tom_Roche@pobox.com> wrote:

>
> Could I get one or more spatial-plotting experts to examine defective
> output produced when I try to plot a RasterLayer? I believe I'm pretty
> close to solving these problems, but am very much a beginner, and at
> the limit of my competence in this domain. I've tried to do this with
> both raster::plot
>
>
> http://stackoverflow.com/questions/13005181/rasterplot-problems-unwanted-rotation-extents
>
> and with fields::image.plot
>
>
> http://stackoverflow.com/questions/13022919/r-problems-visualizing-a-raster-with-fieldsimage-plot
>
> In either case, the defective output (in a single 4-page PDF
>
>
> https://github.com/downloads/TomRoche/GEIA_to_netCDF/GEIA_N2O_oceanic_regrid.pdf
>
> where pages 1-3 are from raster::plot, and page 4 is from
> fields::image.plot) can be generated by
>
> 1 Cloning
>
> git://github.com/TomRoche/GEIA_to_netCDF.git
>
>   onto a box with bash and an appropriately-configured R (notably,
>   with packages=fields, ncdf4, raster).
>
> 2 `cd` to the cloned git repo (probably `cd ./GEIA_to_netCDF`)
>
> 3 Converting the ASCII input to netCDF, and plotting that netCDF, by
>   running `./GEIA_to_netCDF.sh`, which calls
>
> https://github.com/TomRoche/GEIA_to_netCDF/blob/master/GEIA.to.netCDF.r
>
> 4 Regridding the netCDF, and plotting that regridded output, by
>   running `./regrid_GEIA_netCDF.sh`, which calls
>
>
> https://github.com/TomRoche/GEIA_to_netCDF/blob/master/regrid.global.to.AQMEII.r
>
> In each case the image extents are not as desired, and there is a
> rotation problem (either involving the entire image, or just the
> relation between an added map and the regridded data).
>
> Your assistance is appreciated, 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
>

	[[alternative HTML version deleted]]

