get_ereefs_ts: Extracts time series at specified locations from eReefs model...

View source: R/data_extraction_functions.R

get_ereefs_tsR Documentation

Extracts time series at specified locations from eReefs model output files

Description

Create a time-series of values of one or more selected model output variables in a specified layer of the water column or sediment store (by default, the surface layer), at a specified geographic location or supplied data frame of geocoordinates within the model domain. See also get_ereefs_depth_integrated_ts() to extract depth-integrated values and get_ereefs_depth_specified_ts() to extract values at a specified depth below the free (tidally moving) surface. Barbara Robson (AIMS).

Usage

get_ereefs_ts(
  var_names = c("Chl_a_sum", "TN"),
  location_latlon = c(-23.39189, 150.88852),
  layer = "surface",
  start_date = c(2010, 12, 31),
  end_date = c(2016, 10, 31),
  input_file = "menu",
  input_grid = NA,
  eta_stem = NA,
  override_positive = FALSE,
  verbosity = 1,
  return_list = FALSE,
  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

is a data frame containing the decimal latitude and longitude of a single desired location, or a vector containing a single latitude and longitude 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. location_latlon can also be set to "mmp" to extract time-series at all Marine Monitoring Program sites. Defaults to c(-23.39189, 150.88852).

layer

is the vertical grid layer to extract, or 'surface' to get the surface value, 'bottom' to get the value in the cell at the bottom of the water column, or 'integrated' to get a depth-integrated (mean) value. Specify a negative value to indicate a specified depth (in metres) below MSL. Use get_ereefs_depth_specified_ts() instead if you want to specify a depth below the free surface instead of a layer number. Defaults to 'surface'.

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 needed (i.e. for a depth-integrated value or bottom layer) but not specified, the function will first look for z_grid 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) and you are asking for a depth-integrated time-series or a depth-specified (relative to the surface) time-series

override_positive

Reverse the value of the "positive" attribute of botz for BGC files, assuming that it is incorrect. Default FALSE. Not normally needed.

verbosity

How much information to display along the way (0 to 2. Default is 1).

return_list

Default FALSE. Set to true if you want a list of dataframes returned (one df per geolocation). Included for backward compatibility.

date_format

Default "date". Set to "chron" to have the date returned in chron format.

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,10,31).

Details

If you run into memory constraints, consider grouping points to be extracted within regions, and calling this once for each region.

Value

a data frame containing the dates and values of extracted variables and location(s) or a list of such data frames (one list item per location) if return_list=TRUE (for backward compatibility).

Examples

## Not run: 
get_ereefs_ts('Chl_a_sum', location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer='surface', start_date=c(2010,12,31),end_date=c(2011,1,5), input_file=2)
get_ereefs_ts(var_names=c('Tricho_N', 'DIP', 'TP'), location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer='bottom', start_date="2012-07-03",end_date="2012-07-05", input_file='GBR4_BGC-v2.0 Chyb Dcrt')
get_ereefs_ts(var_names=c('ZooL_N', 'ZooS_N'), location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer=45, start_date=c(2010,12,31),end_date=c(2011,1,5), input_file="http://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_bgc_GBR4_H2p0_B2p0_Cpre_Dcrt/gbr4_bgc_simple_2016-06.nc")

## End(Not run)

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