ebv_add_data {ebvcube}R Documentation

Add data to your EBV netCDF

Description

Add data to your EBV netCDF from GeoTiffs or in-memory arrays. First, create a new EBV netCDF using ebv_create().

Usage

ebv_add_data(
  filepath_nc,
  datacubepath,
  entity = NULL,
  timestep = 1,
  data,
  band = 1,
  ignore_RAM = FALSE,
  verbose = TRUE
)

Arguments

filepath_nc

Character. Path to the self-created netCDF file.

datacubepath

Character. Path to the datacube (use ebv_datacubepaths()).

entity

Character or Integer. Default is NULL. If the structure is 3D, the entity argument is set to NULL. Else, a character string or single integer value must indicate the entity of the 4D structure of the EBV netCDFs. The character string can be obtained using ebv_properties(). Choose the entity you are interested in from the slot general and the list item entity_names.

timestep

Integer. Default: 1. Define to which timestep or timesteps the data should be added. If several timesteps are given they have to be in a continuous order. Meaning c(4,5,6) is right but c(2,5,6) is wrong.

data

Character or matrix or array. If character: Path to the GeoTiff file containing the data. Ending needs to be *.tif. If matrix or array: in-memory object holding the data.

band

Integer. Default: 1. Define which band(s) to read from GeoTiff. Can be several. Don't have to be in order as the timesteps definition requires.

ignore_RAM

Logical. Default: FALSE. Checks if there is enough space in your memory to read the data. Can be switched off (set to TRUE). Ignore this argument when you give an array or a matrix for 'data' (it will do nothing).

verbose

Logical. Default: TRUE. Turn off additional prints by setting it to FALSE.

Value

Adds data to the EBV netCDF. Check your results using ebv_read() and/or ebv_analyse() and/or ebv_map() and/or ebv_trend().

Note

If the data exceeds your memory the RAM check will throw an error. No block-processing or other method implemented so far. Move to a machine with more capacities if needed.

Examples

#set path to EBV netCDF
file <- system.file(file.path("extdata","test.nc"), package="ebvcube")
#get all datacubepaths of EBV netCDF
datacubepaths <- ebv_datacubepaths(file, verbose=FALSE)
#set path to GeoTiff with data
tif <- system.file(file.path("extdata","entity1.tif"), package="ebvcube")

# add data to the timestep 1, 2 and 3 using the first three bands of the GeoTiff
## Not run: 
ebv_add_data(filepath_nc = file, datacubepath = datacubepaths[1,1],
             entity = 1, timestep = 1:3, data = tif, band = 1:3)

## End(Not run)

[Package ebvcube version 0.1.7 Index]