startR (version 0.0.1)

NcDataReader: NetCDF File Data Reader for 'startR'

Description

This is a data reader function for NetCDF files, intended for use as parameter file_data_reader in a call to the function Start() in the package 'startR'. This function complies with the input/output interface required by Start() defined in the documentation for the parameter file_data_reader of that function.

This function uses the function NcToArray() in the package 'easyNCDF', which in turn uses nc_var_get() in the package 'ncdf4'.

Usage

NcDataReader(file_path = NULL, file_object = NULL, file_selectors = NULL, 
             inner_indices = NULL, synonims)

Arguments

file_path

Character string with the path to the data file to read. See details in the documentation of the parameter file_data_reader of the function Start().

file_object

Open connection to a NetCDF file, optionally with additional header information. See details in the documentation of the parameter file_data_reader of the function Start().

file_selectors

Information on the path of the file to read data from. See details in the documentation of the parameter file_data_reader of the function Start().

inner_indices

Named list with the numeric indices to take from each of the inner dimensions in the requested file. See details in the documentation of the parameter file_data_reader of the function Start().

synonims

Named list with synonims for the dimension names to look for in the requested file, exactly as provided in the parameter synonims in a call to the function Start(). See details in the documentation of the parameter file_data_reader of the function Start().

Value

A multidimensional data array with the named dimensions and indices requested in inner_indices, potentially with the attribute 'variables' with additional auxiliary data. See details in the documentation of the parameter file_data_reader of the function Start().

See Also

NcOpener, NcCloser, NcDimReader, NcVarReader

Examples

Run this code
# NOT RUN {
## Check https://earth.bsc.es/gitlab/es/startR for step-by-step examples 
## of Start() that use NcDataReader().
# }

Run the code above in your browser using DataLab