Hello

I have an output from R-script in the form of a rasterbrick with 3
dimensions (time, latitude, longitude). I want to be able to write it to a
netCDF format, add another dimension (time, level, latitude, longitude), and
be able to edit dimension attributes.
Below you will see the properties when I write my rasterbrick to a netCDF
format using writeRaster.
I would like to change 'value' dimension to time, and edit time:units as
well.
Alternatively, is there a way I can copy dimensions and attributes from
another netCDF template and put my rasterbrick in that empty netCDF file?
Any help is greatly appreciated.

Sincerely,
Prajjwal


dimensions:
        longitude = 720 ;
        latitude = 360 ;
        value = UNLIMITED ; // (12 currently)
variables:
        double longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        double latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        int value(value) ;
                value:units = "unknown" ;
                value:long_name = "value" ;
        float prec(value, latitude, longitude) ;
                prec:_FillValue = -3.4e+38 ;
                prec:missing_value = -3.4e+38 ;
                prec:long_name = "prec" ;
                prec:projection = "+proj=longlat +datum=WGS84 +ellps=WGS84 
+towgs84=0,0,0"
;
                prec:projection_format = "PROJ.4" ;
                prec:min = 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. ;
                prec:max = 663.033325195312, 553.867553710938, 595.225219726562,
577.460388183594, 688.026123046875, 1178.05859375, 1098.39819335938,
1269.41442871094, 1184.70092773438, 1013.62524414062, 755.313537597656,
633.667541503906 ;

// global attributes:
                :Conventions = "CF-1.4" ;
                :created_by = "R, packages ncdf and raster (version 2.0-31)" ;
                :date = "2013-01-24 15:58:09" ;







--
View this message in context: 
http://r-sig-geo.2731867.n2.nabble.com/Rasterbrick-to-netCDF-tp7582376.html
Sent from the R-sig-geo mailing list archive at Nabble.com.

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to