Learn R Programming

synoptReg (version 0.2.2)

read_nc: Read a NetCDF file

Description

This function read a NetCDF file through ncdf4 package, to extract the atmospheric or environmental variable, longitudes, latitudes and dates. A continuous NetCDF withouth date gaps is required.

Usage

read_nc(nc_input, name_coord, initial_date)

Arguments

nc_input

NetCDF path with atmospheric or environmental field (mean sea level pressure, geopotential height, precipitation, ...).

name_coord

Character. Names of longitude, latitude and time coordinates.

initial_date

Character. Start date of the NetCDF. As character format.

Value

a list with:

  • A 3D-array (lon, lat, times) of atmospheric variable.

  • A numeric with longitude values.

  • A numeric with latitude values.

  • A Date format vector containing dates.