argopy.extensions.CanyonB

argopy.extensions.CanyonB#

class CanyonB(*args, **kwargs)[source]#

Nutrients and Carbonate System Variables predictor with CANYON-B

This is an implementation of the CANYON-B method: a bayesian neural network approach that estimates water-column nutrient concentrations and carbonate system variables ([1]). CANYON-B is based on the CANYON model ([2]) and provides more robust neural networks, that include a local uncertainty estimate for each predicted parameter.

When using this method, please cite the papers.

See also

canyon_b.predict(), canyon_b.input_list, canyon_b.output_list

Examples

Load data, they must contain oxygen measurements:

from argopy import DataFetcher
ArgoSet = DataFetcher(ds='bgc', mode='standard', params='DOXY', measured='DOXY').float(1902605)
ds = ArgoSet.to_xarray()

Once input data are loaded, make all or selected parameters predictions with or without specifying input errors on pressure (epres, in dbar), temperature (etemp, in degC), salinity (epsal, in PSU) and oxygen (edoxy, in micromole/kg). For interested users, uncertainties on predicted parameters can also be included.

ds.argo.canyon_b.predict()
ds.argo.canyon_b.predict('PO4')
ds.argo.canyon_b.predict(['PO4', 'NO3'])
ds.argo.canyon_b.predict(['PO4', 'NO3'], include_uncertainties=True)
ds.argo.canyon_b.predict(['PO4', 'NO3'], epres=0.5, etemp=0.005, epsal=0.005, edoxy=0.01)
ds.argo.canyon_b.predict(['PO4', 'NO3'], epres=0.5, etemp=0.005, epsal=0.005, edoxy=0.01, include_uncertainties=True)
By default, if no input errors are specified, the following default values are used:
  • epres = 0.5 dbar

  • etemp = 0.005 degC

  • epsal = 0.005 PSU

  • edoxy = 1% of DOXY value

Notes

This Python implementation is largely inspired by work from Raphael Bajon (RaphaelBajon) which is available at RaphaelBajon/canyonbpy and from the EuroGO-SHIP organization (EuroGO-SHIP/AtlantOS_QC)

References

[1]

Bittig, H. C., Steinhoff, T., Claustre, H., Fiedler, B., Williams, N. L., Sauzede, R., Kortzinger, A., and Gattuso, J. P. (2018). An alternative to static climatologies: Robust estimation of open ocean CO2 variables and nutrient concentrations from T, S, and O2 data using Bayesian neural networks. Frontiers in Marine Science, 5, 328. https://doi.org/10.3389/fmars.2018.00328

[2]

Sauzede, R., Bittig, H. C., Claustre, H., Pasqueron de Fommervault, O., Gattuso, J. P., Legendre, L., and Johnson, K. S. (2017). Estimates of water-column nutrient concentrations and carbonate system parameters in the global ocean: A novel approach based on neural networks. Frontiers in Marine Science, 4, 128. https://doi.org/10.3389/fmars.2017.00128

__init__(*args, **kwargs)[source]#

Methods

__init__(*args,Ā **kwargs)

adjust_arctic_latitude(lat,Ā lon)

Adjust latitude for Arctic basin calculations.

create_canyonb_input_matrix()

Create input matrix for CANYON-B neural network predictions.

ds2df()

Convert xarray Dataset to CANYON-B neural network input format.

get_param_attrs(param)

Get attributes for a given predicted parameter.

load_weights(param)

Load CANYON-B neural network weights for a specific parameter.

predict([params,Ā epres,Ā etemp,Ā epsal,Ā ...])

Make predictions using the CANYON-B method.

Attributes

decimal_year

Return the decimal year representation of the dataset TIME variable.

input_list

List of parameters required to make predictions with CANYON-B

n_inputs

Number of inputs variables for CANYON-B

output_list

List of all possible output variables for CANYON-B