cl_GetData: Get Data

Description Usage Arguments Details Value Examples

View source: R/cl_GetData.R

Description

This function gets (geographic and optical) data for a geographic zone. Such a zone may be a single geographic point, a longitudinal transect, a latitudinal transect, or an area. The type of geographic zone depends the arguments lon and lat passed to the function (see details)

Usage

1
2
3
4
5
6
7
8
cl_GetData(
  lon,
  lat,
  what = c("depth", "area", "par", "kdpar", "parbottom"),
  dirdata = "CoastalLight.d",
  month = 0,
  stat = "mean"
)

Arguments

lon

: [numeric] longitude, vector of length 1 or 2, (interval [-180; 180], and see details) ; unit : decimal \, degree

lat

: [numeric] latitude, vector of length 1 or 2, (interval [-90; 90], and see details) ; unit : decimal \, degree

what

: [character] a vector of the variables to extract among "depth", "area", "par", "kdpar" and "parbottom". Several variables can be listed. Default is all of them. Note that longitude and latitude are automatically added to the variables. Units : depth (m), area (km^{2}), par, parbottom (mol.photons \; m^{-2} \; d^{-1}), kdpar (m^{-1}).

dirdata

: [character] The directory where the data files (previouly downloaded with the function cl_DownloadData()) are stored. (default = "./CoastalLight.d");

month

: [integer] : the decimal value of the month ([0-12] of interest. 0 indicate the climatology over 21 years (1998-2018), 1 is January, ...

stat

: [character] the statistical value you want for variables "par", "kdpar" and "parbottom"; choose one among "mean" (mean value), "min" (minimum), "max" (maximum), "sd" (standard deviation) (default = "mean") N.B. : "min", "max", "sd", are available only at URL

        http://obs-vlfr.fr/Pfunction/
                      

Details

There are 4 options for parameters lon and lat:

To get data along an ordinary transect (i.e. a polygonal line, given by its vertices) you have, in a first time, to get data in an "Area" containing this polygonal line, and, in a second time, to use function cl_Transect() in order to extract data along the transect (see example of this function).

Value

: [list] a list with 5 components :

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## All examples assume that data have been downloaded in directory "CoastalLight.d"
## with function cl_DownloadData()

## Area
gabes <- cl_GetData(lon = c(10, 14), lat = c(32.5, 36), dir = "./CoastalLight.d")
par(mfrow = c(3,2))
cl_PlotData(gabes)

## a longitudinal transect in January
long.transect <- cl_GetData(lon = c(10, 14), lat = c(34), dir = "./CoastalLight.d", month = 1)
par(mfrow = c(1,1))
cl_PlotData(long.transect)

## a latitudinal transect in August
lat.transect <- cl_GetData(lon = c(12), lat = c(32.5, 36), dir = "./CoastalLight.d", month = 8)
par(mfrow = c(1,1))
cl_PlotData(lat.transect)

jpgattuso/CoastalLight documentation built on June 25, 2021, 5:34 p.m.