Hello:

I have been trying to plot a netcdf layer as a raster and have found one
single issue that I'd like know if I'm doing something wrong.  If I use the
function "image" from raster package there's no problem at all, the thing
is that I would like to handle this layer as a raster and be able to map it
correctly or save it as a geotif.

This is an example using both approaches to map the netcdf layer: as a
raster and using "image(x,y,z...).

library(ncdf)

library(maptools)

library(raster)

varRaster<-raster("SMOS_File.nc", varname="Soil_Moisture")

plot(varRaster)
data(wrld_simpl)
plot(wrld_simpl, add = TRUE)

# Resulting plot (some offset is occurring by opening the layer as a raster
 --> http://bit.ly/19IFfA2


#Using "image" there's no problem...

ex.nc = open.ncdf("SMOS_File.nc")

print(ex.nc)
summary(ex.nc)
y = get.var.ncdf( ex.nc, "lat")
x = get.var.ncdf( ex.nc, "lon")
z = get.var.ncdf( ex.nc, "Soil_Moisture")

image(x,y,z, zlim=c(-0.9,1), col = heat.colors(37))
plot(wrld_simpl, add = TRUE)

# Resulting plot --> http://bit.ly/1cJ0vXo

Is there anyway to handle the netcdf layer as a raster and be able to map
it correctly.  I already tried to write the raster as a geotif and open it
in other software such as GRASS or ArcMap and is still showing up with the
offset.


Thanks for any help with this.
Guillermo

-- 
*Guillermo E. Ponce-Campos*
*PGP Key ID*: 0x57EDC060

	[[alternative HTML version deleted]]

