get_ereefs_depth_specified_ts: Extracts time-series of selected variables from eReefs output...

View source: R/data_extraction_functions.R

get_ereefs_depth_specified_tsR Documentation

Extracts time-series of selected variables from eReefs output files at a specified location and depth below the surface.

Description

See also get_ereefs_ts() to extract from a specified layer instead of a depth-integrated value and get_ereefs_depth_integrated_ts() to calculate depth-integrated values. Barbara Robson (AIMS).

Usage

get_ereefs_depth_specified_ts(
  var_names = c("Chl_a_sum", "TN"),
  location_latlon = c(-23.39189, 150.88852),
  depth = 1,
  start_date = c(2010, 12, 31),
  end_date = c(2016, 12, 31),
  input_file = "menu",
  input_grid = NA,
  eta_stem = NA,
  verbosity = 1,
  date_format = "date"
)

Arguments

var_names

either a single character value or a vector specifying the short names for variables that you want from the netcdf file. Defaults to c('Chl_a_sum', 'TN').

location_latlon

A vector containing the decimal latitude and longitude of the desired location. If you want to specify an x-y grid coordinate instead of a latitude and longitude, you can: to do this, is.integer(location_latlon) must be TRUE. Defaults to c(-23.39189, 150.88852).

depth

Depth in metres below the surface. Default 1.0. If the bottom of the water is shallower than the specified depth, return values from the bottom of the water column.

start_date

date for animation. Can either be a) a vector of integers in the format c(year, month, day); b) a date obtained e.g. from as.Date(); or c) a character string formatted for input to as.Date(). Defaults to c(2010,12,31).

input_file

is the URL or file location of any of the EMS output files or a THREDDS catalog URI. Defaults to a menu selection based on current NCI catalogs. Can also be set to "nci", "menu" or "catalog" for the same behaviour. Set to "old_menu" to provide old menu options instead of menu options from the NCI catalog. Numeric values are interpreted as references to selections available from the old menu. Short codes can be used for some options (codenames as used in https://research.csiro.au/ereefs/models/model-outputs/access-to-raw-model-output/ )

input_grid

Name of the locally-stored or opendap-served netcdf file that contains the grid coordinates for the top and bottom of each layer (z_grid). If not specified, the function will first look for z_grid can be found in the first INPUT_STEM file, and if not found, will check whether the size of the variables in the input file corresponds to the size expected for GBR4 or GBR1, and load an appropriate z grid from data files stored in this package. Alternatively, you can provide the location of a full (not simple-format) ereefs netcdf output file such as "http://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_hydro_all/gbr4_all_2016-09.nc"

eta_stem

The URI or file location of the model output files that contains the surface elevation (eta), minus the date components of the filename in the case of GBR1 or GBR4 files, and ommitting the file extension, ".nc". Needed only if eta is not in the files indicated by input_stem (e.g. some GBR1 bgc files).

end

date for animation. Can either be a) a vector of integers in the format c(year, month, day); b) a date obtained e.g. from as.Date(); or c) a character string formatted for input to as.Date(). Defaults to c(2016,12,31).

Value

a data frame containing the dates and values of extracted variables

Examples

## Not run: 
get_ereefs_depth_specified_ts(c('Chl_a_sum', 'NH4'), depth=5.0, location_latlon=data.frame(latitide=-23.39189, longitude=150.88852), layer='surface', start_date=c(2010,12,31),end_date=c(2011,1,5), input_file=2)

## End(Not run)

BarbaraRobson/ereefs documentation built on April 23, 2023, 5:47 a.m.