Hi Robert,

Apparently I did not explain myself properly.
I have 4 files that each make up a quandrant of on large spatial domain 
(Eg. NW, NE, SE, SW).
And each of these 4 files have the same variables, in which each of 
these variables have the same dimensions. (A, B, C and D of previous post)

So I was looking for a way in which these 4 files (quandrants) could be 
merged to 1 large spatial file, so that all variable dimensions and 
values are merged as well. And yes, some variables do not have a spatial 
reference (e.g. the 1D variable).

Hope this is clear now?
Regards,
Matthias

On 07/12/11 18:06, Robert J. Hijmans wrote:
> Matthias,
>
> > I have tried with the raster package (merge function), but it seems you
> > can only read 1 variable at the time (when reading .nc file with
> > raster())?
>
> Correct, because raster() returns a RasterLayer object. But you can 
> use brick() instead to get a multulayer RasterBrick object
>
> > Furthermore, raster() seems unable to deal with 1D variables (as eg. D)?
>
> Correct, it has no spatial reference. How would you want to merge it?
>
> I do not understand how these four variables can represent four 
> (spatial) quadrants. They either overlap (have the same lon/lat) or 
> they have no spatial reference.
>
> Robert
>
> On Mon, Dec 5, 2011 at 8:49 PM, Matthias Demuzere 
> <Matthias.demuzere@ees.kuleuven.be 
> <mailto:Matthias.demuzere@ees.kuleuven.be>> wrote:
>
>     Hi all,
>
>     I have some large netcdf files that present 4 quadrants (that
>     neatly fit
>     together) of a large domain (eg. NW, NE, SE, SW).
>     Let's assume for example that all the files contain the following
>     variables with dimensions:
>         float A(lat, lon) ;
>             A:units = "unitless" ;
>             A:long_name = "none" ;
>         float B(pft, lat, lon) ;
>             B:units = "unitless" ;
>             B:long_name = "nonet" ;
>         float C(time, pft, lat, lon) ;
>             C:units = "unitless" ;
>             C:long_name = "none" ;
>        float D(layers) ;
>             D:long_name = "thickness" ;
>             D:units = "m" ;
>     So as you can see, 4 variables (A, B, C and D) which all have
>     different
>     dimensions (lat,lon), (pft,lat,lon), (time,pft,lat,lon) and (layers).
>     But these variables are the same over all 4 quadrants.
>
>     Now my question is whether there is an easy way to merge these 4
>     quadrants into 1 file, and write it out as a netcdf file again,
>     with the
>     same metadata as the original files.
>
>     I have tried with the raster package (merge function), but it
>     seems you
>     can only read 1 variable at the time (when reading .nc file with
>     raster())? Furthermore, raster() seems unable to deal with 1D
>     variables
>     (as eg. D)?
>     The reason I would like to get it working with raster is that I
>     like the
>     fact is handles large datasets really well.
>
>     So if anyone could point me in the right direction how to deal
>     with this
>     properly, that would be great!
>
>     Kind regards,
>     Matthias
>
>     -- 
>     -------------------------------------------------------------
>     FWO Post-doctoral Research Fellow
>     School of Geography and Environmental Science
>     Monash University
>     Melbourne, Victoria
>     Australia
>     Matthias.Demuzere@monash.edu <mailto:Matthias.Demuzere@monash.edu>
>
>     Department of Earth&   Environmental Sciences
>     Physical and Regional Geography Research Group
>     Regional climate studies
>
>     Celestijnenlaan 200E
>     3001 Heverlee (Leuven)
>     BELGIUM
>
>     Tel: + 32 16 326424 <tel:%2B%2032%2016%20326424>
>     Fax: + 32 16 322980 <tel:%2B%2032%2016%20322980>
>     matthias.demuzere@ees.kuleuven.be
>     <mailto:matthias.demuzere@ees.kuleuven.be>
>     http://geo.kuleuven.be/aow/
>     www.kuleuven.be/geography <http://www.kuleuven.be/geography>
>
>     _______________________________________________
>     R-sig-Geo mailing list
>     R-sig-Geo@r-project.org <mailto:R-sig-Geo@r-project.org>
>     https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

-- 
-------------------------------------------------------------
FWO Post-doctoral Research Fellow
School of Geography and Environmental Science
Monash University
Melbourne, Victoria
Australia
Matthias.Demuzere@monash.edu

Department of Earth&   Environmental Sciences
Physical and Regional Geography Research Group
Regional climate studies

Celestijnenlaan 200E
3001 Heverlee (Leuven)
BELGIUM

Tel: + 32 16 326424
Fax: + 32 16 322980
matthias.demuzere@ees.kuleuven.be
http://geo.kuleuven.be/aow/
www.kuleuven.be/geography
-------------------------------------------------------------


	[[alternative HTML version deleted]]

