rfile: Read NetCDF File

Description Usage Arguments Examples

View source: R/rfile.R

Description

Read NetCDF File

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
rfile(
  file,
  field,
  ...,
  navals = NA,
  lonmin = NA,
  lonmax = NA,
  latmin = NA,
  latmax = NA,
  zstart = 1,
  zcount = -1,
  tstart = 1,
  tcount = -1
)

Arguments

file

A character string specifying the NetCDF file location

field

A character string specifying the field to be read

...

An arbitrary number of character strings specifying additional fields to be read

navals

A float specifying NA values

lonmin

A float specifying longitude to start reading (optional)

lonmax

A float specifying longitude to stop reading (optional)

latmin

A float specifying latitude to start reading (optional)

latmax

A float specifying latitude to stop reading (optional)

zstart

An integer specifying first level to read (default: 1)

zcount

An integer specifying number of levels to read (default: -1)

tstart

An integer specifying first time-steps to read (default: 1)

tcount

An integer specifying number of time-steps to read (default: -1)

Examples

1
2
3
4
5
6
7
library(zeallot) # Need this to unpack data from rfile

# Read an entire field
c(lons, lats, APVTURBT)%<-%rfile("/net/thermo/atmosdyn2/atroman/stingjet/20140211_12/tra/APV12_20140212_07.nc","APVTURBT")

# Only read a specific subset of field
c(lons,lats,PV)%<-%rfile("/net/thermo/atmosdyn/atroman/phd/MAR18/cdf/S20180302_21","PV",lonmin=-60,lonmax=-20,latmin=46,latmax=86,zstart=2,zcount=2)

romatt/metplot documentation built on Dec. 22, 2021, 5:17 p.m.