Skip to contents

Returns a data.table with information by splitting the netcdf files into their components (GCM, RCM, variable, experiment, ...) and aggregates over years.

Usage

get_inventory(path, add_files = TRUE)

Arguments

path

Path that will be searched recursively for .nc files.

add_files

Boolean (default TRUE), if TRUE, will add a column containing lists of associated files with their full paths (useful e.g. for further processing).

Value

A data.table with the inventory information.

See also

check_inventory for performing some checks.

Examples

# some empty example files
fn_zip <- system.file("extdata", "inv-test-files.zip", package = "eurocordexr")
tmpdir <- tempdir()
unzip(fn_zip, exdir = tmpdir)

dat_inv <- get_inventory(fs::path(tmpdir, "testdata", "mixed-vars"))
print(dat_inv)
#>    variable domain                   gcm                institute_rcm
#>      <char> <char>                <char>                       <char>
#> 1:     orog EUR-11        ICHEC-EC-EARTH                KNMI-RACMO22E
#> 2:     orog EUR-11     IPSL-IPSL-CM5A-LR              GERICS-REMO2015
#> 3:       pr EUR-11 CNRM-CERFACS-CNRM-CM5 CLMcom-ETH-COSMO-crCLIM-v1-1
#> 4:   tasmax EUR-11 CNRM-CERFACS-CNRM-CM5 CLMcom-ETH-COSMO-crCLIM-v1-1
#> 5:   tasmin EUR-11 CNRM-CERFACS-CNRM-CM5 CLMcom-ETH-COSMO-crCLIM-v1-1
#>    experiment ensemble downscale_realisation timefreq date_start   date_end
#>        <char>   <char>                <char>   <char>     <Date>     <Date>
#> 1:      rcp45   r1i1p1                    v1       fx       <NA>       <NA>
#> 2:      rcp26   r0i0p0                    v1       fx       <NA>       <NA>
#> 3: historical   r1i1p1                    v1      day 1951-01-01 2005-12-31
#> 4: historical   r1i1p1                    v1      day 1951-01-01 2005-12-31
#> 5: historical   r1i1p1                    v1      day 1951-01-01 2005-12-31
#> 4 variables not shown: nn_files <int>, total_simulation_years <int>, period_contiguous <lgcl>, list_files <list>