nclist_to_df: Extracts full time series

View source: R/nclist_to_df.R

nclist_to_dfR Documentation

Extracts full time series

Description

Extracts full time series from a list of NetCDF files, provided for time steps (can be one time step or multiple time steps) separately and writes .RData files for each longitude index.

Usage

nclist_to_df(
  nclist,
  outdir,
  fileprefix,
  varnam,
  ilon = NA,
  lonnam = "lon",
  latnam = "lat",
  timenam = "time",
  timedimnam = "time",
  ncores = 1,
  single_basedate = FALSE,
  fgetdate = NA,
  overwrite = FALSE
)

Arguments

nclist

A vector of character strings specifying the complete paths to files.

outdir

A character string specifying output directory where data frames are written using the save statement.

fileprefix

A character string specifying the file name prefix.

varnam

The variable name(s) for which data is to be read from NetCDF files.

ilon

An integer specifying an individual longitude index. If provided, it overrides that the function extracts data for all longitude indices.

lonnam

The dimension name of longitude.

latnam

The dimension name of latitude

timenam

The name of dimension variable used for time. Defaults to "time".

timedimnam

The name of the dimension (axis) used for time. Defaults to "time".

ncores

Number of cores for parallel execution (distributing extraction of longitude slices). When set to "all", the number of cores for parallelisation is determined by parallel::detectCores(). Defaults to 1 (no parallelisation).

single_basedate

A logical specifying whether all files in the file list have the same base date (e.g., time units given in 'days since <basedate>').

fgetdate

A function to derive the date used for the time dimension based on the file name.

overwrite

A logical indicating whether time series files are to be overwritten.

Value

Nothing. Writes data to .RData files for each longitude index.


stineb/rbeni documentation built on Feb. 24, 2023, 5:40 a.m.