This function, meant for internal use by the package, uses
yaml::yaml.load_file()
to read YAML files that describe the
output NetCDF format created by e.g. ctd2ncdf()
. Users wishing
to define such files for their own use should follow the pattern
of the source directory inst/extdata/argo.yml
.
read.varTable(varTable = "argo", debug = 0)
character value indicating the name of the table (see ‘Details’).
integer, 0 (the default) for quiet action apart from messages and warnings, or any larger value to see more output that describes the processing steps.
read.varTable()
returns a list that specifies some information
to be stored in NetCDF files created by e.g. ctd2ncdf()
.
The value of varTable
controls the variable-name translation
table to be used. If varTable
is NULL, then a default table
is used, the choice of which depends on the function that
calls read.varTable()
. Alternatively,
if varTable
is a character value, then there are 3 possibilities.
If varTable
is "-"
, then an empty variable table is returned.
If varTable
ends in .yml
, then it is taken as a file to be read.
Otherwise, ".yml"
is appended to varTable
and a file with that
name is sought in the inst/ext_data
source directory.
At the moment, there are two such built-in files, named
"argo.yml"
and "whp.yml"
.
library(ocencdf)
str(read.varTable("whp"))
#> List of 4
#> $ type :List of 3
#> ..$ date : chr "2022-06-04"
#> ..$ name : chr "whp"
#> ..$ version: int 1
#> $ units :List of 4
#> ..$ 1/m :List of 1
#> .. ..$ name: chr "m-1"
#> ..$ dbar :List of 1
#> .. ..$ name: chr "decibar"
#> ..$ degree * C :List of 1
#> .. ..$ name: chr "degree_Celcius"
#> ..$ mu * mol/kg:List of 1
#> .. ..$ name: chr "micromole/kg"
#> $ values :List of 1
#> ..$ missing_value: num 99999
#> $ variables:List of 21
#> ..$ ammonium :List of 4
#> .. ..$ name : chr "NH4"
#> .. ..$ long_name : chr "ammonium"
#> .. ..$ standard_name: chr "ammonium"
#> .. ..$ missing_value: num 99999
#> ..$ CFC-12 :List of 4
#> .. ..$ name : chr "CFC12"
#> .. ..$ long_name : chr "CFC-12"
#> .. ..$ standard_name: chr "CFC-12"
#> .. ..$ missing_value: num 99999
#> ..$ fluorescence :List of 4
#> .. ..$ name : chr "FLUOR"
#> .. ..$ long_name : chr "fluorescence"
#> .. ..$ standard_name: chr "fluorescence"
#> .. ..$ missing_value: num 99999
#> ..$ nitrate :List of 4
#> .. ..$ name : chr "NITRAT"
#> .. ..$ long_name : chr "nitrate"
#> .. ..$ standard_name: chr "nitrate"
#> .. ..$ missing_value: num 99999
#> ..$ nitrite :List of 4
#> .. ..$ name : chr "NITRIT"
#> .. ..$ long_name : chr "nitrite"
#> .. ..$ standard_name: chr "nitrite"
#> .. ..$ missing_value: num 99999
#> ..$ NO2+NO3 :List of 4
#> .. ..$ name : chr "nitrite+nitrate"
#> .. ..$ long_name : chr "NO2+NO3"
#> .. ..$ standard_name: chr "NO2+NO3"
#> .. ..$ missing_value: num 99999
#> ..$ number :List of 4
#> .. ..$ name : chr "NUMBER"
#> .. ..$ long_name : chr "number"
#> .. ..$ standard_name: chr "number"
#> .. ..$ missing_value: num 99999
#> ..$ oxygen :List of 4
#> .. ..$ name : chr "CTDOXY"
#> .. ..$ long_name : chr "oxygen"
#> .. ..$ standard_name: chr "oxygen"
#> .. ..$ missing_value: num 99999
#> ..$ oxygenBottle :List of 4
#> .. ..$ name : chr "OXYGEN"
#> .. ..$ long_name : chr "oxygenBottle"
#> .. ..$ standard_name: chr "oxygenBottle"
#> .. ..$ missing_value: num 99999
#> ..$ phosphate :List of 4
#> .. ..$ name : chr "PHSPHT"
#> .. ..$ long_name : chr "phosphate"
#> .. ..$ standard_name: chr "phosphate"
#> .. ..$ missing_value: num 99999
#> ..$ pHTemperature :List of 4
#> .. ..$ name : chr "PH_TMP"
#> .. ..$ long_name : chr "pHTemperature"
#> .. ..$ standard_name: chr "pHTemperature"
#> .. ..$ missing_value: num 99999
#> ..$ pHTotal :List of 4
#> .. ..$ name : chr "PH_TOT"
#> .. ..$ long_name : chr "pHTotal"
#> .. ..$ standard_name: chr "pHTotal"
#> .. ..$ missing_value: num 99999
#> ..$ pressure :List of 4
#> .. ..$ name : chr "CTDPRS"
#> .. ..$ long_name : chr "pressure"
#> .. ..$ standard_name: chr "pressure"
#> .. ..$ missing_value: num 99999
#> ..$ salinity :List of 4
#> .. ..$ name : chr "CTDSAL"
#> .. ..$ long_name : chr "salinity"
#> .. ..$ standard_name: chr "salinity"
#> .. ..$ missing_value: num 99999
#> ..$ salinityBottle :List of 4
#> .. ..$ name : chr "SALNTY"
#> .. ..$ long_name : chr "salinityBottle"
#> .. ..$ standard_name: chr "salinityBottle"
#> .. ..$ missing_value: num 99999
#> ..$ SF6 :List of 4
#> .. ..$ name : chr "SF6"
#> .. ..$ long_name : chr "SF6"
#> .. ..$ standard_name: chr "SF6"
#> .. ..$ missing_value: num 99999
#> ..$ silicate :List of 4
#> .. ..$ name : chr "SILCAT"
#> .. ..$ long_name : chr "silicate"
#> .. ..$ standard_name: chr "silicate"
#> .. ..$ missing_value: num 99999
#> ..$ temperature :List of 4
#> .. ..$ name : chr "CTDTMP"
#> .. ..$ long_name : chr "temperature"
#> .. ..$ standard_name: chr "temperature"
#> .. ..$ missing_value: num 99999
#> ..$ totalAlkalinity:List of 4
#> .. ..$ name : chr "ALKALI"
#> .. ..$ long_name : chr "totalAlkalinity"
#> .. ..$ standard_name: chr "totalAlkalinity"
#> .. ..$ missing_value: num 99999
#> ..$ totalCarbon :List of 4
#> .. ..$ name : chr "TCARBN"
#> .. ..$ long_name : chr "totalCarbon"
#> .. ..$ standard_name: chr "totalCarbon"
#> .. ..$ missing_value: num 99999
#> ..$ transmission :List of 4
#> .. ..$ name : chr "TRANS"
#> .. ..$ long_name : chr "transmission"
#> .. ..$ standard_name: chr "transmission"
#> .. ..$ missing_value: num 99999