Skip to contents

These functions streamline the process of using slabR to summarise arrays contained within netcdf files

Usage

scheme_to_start(slabr_scheme = scheme, fill = 1)

scheme_to_count(slabr_scheme = scheme, fill = -1)

scheme_reframe(slabr_scheme)

Arguments

slabr_scheme

a dataframe containing a slabR summary scheme.

fill

a vector of values to add to the end of start or count objects to control extra dimensions.

Details

ncdf4 uses a convention of 2 vectors, start and count, to read in a subset of a file. `sceheme_to_start()` and `scheme_to_count` create the vectors to read in the minimum amount of data that contains the points needed in the summary scheme. The `fill` argument allows you to add additional elements to the end of these vectors if necessary. NEMO_MEUDSA model outputs have a useless 4th dimension of length 1. The `fill` default accounts for this.

Reading in a subset of data may change the indices needed in the summary scheme. If the X, Y and layer vectors used to generate the scheme were from the whole netcdf file, then using it on a smaller subset will result in index out of bound errors. `scheme_reframe()` fixes this by rescaling the indices to start from the smallest in each dimension, now matching the netcdf subset.