open_efts: Creates a EftsDataSet for access to a netCDF EFTS data set

Description Usage Arguments Value Examples

View source: R/exported_functions.R

Description

Creates a EftsDataSet for access to a netCDF EFTS data set

Usage

1
open_efts(ncfile, writein = FALSE)

Arguments

ncfile

name of the netCDF file, or an object of class 'ncdf4'

writein

if TRUE the data set is opened in write mode

Value

A EftsDataSet object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(efts)
ext_data <- system.file('extdata', package='efts')
ens_fcast_file <- file.path(ext_data, 'Upper_Murray_sample_ensemble_rain_fcast.nc')
stopifnot(file.exists(ens_fcast_file))
snc <- open_efts(ens_fcast_file)
(variable_names <- snc$get_variable_names())
(stations_ids <- snc$get_values('station_id'))
nEns <- snc$get_ensemble_size()
nLead <- snc$get_lead_time_count()
td <- snc$get_time_dim()
stopifnot('rain_fcast_ens' %in% variable_names)

ens_fcast_rainfall <- snc$get_ensemble_forecasts('rain_fcast_ens',
  stations_ids[1], start_time=td[2])
names(ens_fcast_rainfall) <- as.character(1:ncol(ens_fcast_rainfall))
plot(ens_fcast_rainfall, legend.loc='right')

snc$close()

efts documentation built on May 2, 2019, 3:39 p.m.