extract_netcdf_file: Extract data from one netCDF file.

View source: R/cdtExtractData_ncdf.R

extract_netcdf_fileR Documentation

Extract data from one netCDF file.

Description

Function to extract data over a set of points from one netCDF file.

Usage

extract_netcdf_file(
  ncdf_data = list(file = "", varid = "z", ilon = 1, ilat = 2),
  crd_points = list(type = "cdtStnData", file = "", sep = ",", na.strings = "-99"),
  out_file = NULL
)

Arguments

ncdf_data

named list, providing the input netCDF file to extract.

  • file: character, full path to the netCDF file.

  • varid: character, name of the variable to read from the netCDF data

  • ilon: integer, order for the longitude dimension of the variable. Example: if the variable "temp" has the dimension order [Lat, Lon] then ilon must be 2

  • ilat: integer, order for the latitude dimension of the variable.

crd_points

named list, providing the coordinates over which the data will be extracted.

  • type: character, the type of file containing the coordinates of the points. Valid options: "cdtStnData", "cdtCrdFile".

    • "cdtStnData": the coordinates are from a CDT station data file

    • "cdtCrdFile": the coordinates are from a CDT coordinates file

  • file: character, full path to the file containing the coordinates

  • sep: character, column separator of the data

  • na.strings: character, missing values flag

out_file

character, full path to the file in which the extracted data will be saved. Default NULL, the extracted data will be returned and not saved to a file.

Value

If out_file is NULL, returns a data.frame with columns id, lon, lat and value.


rijaf-iri/CDT documentation built on July 3, 2024, 2:54 a.m.