argopy.extensions.CONTENT

argopy.extensions.CONTENT#

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

Nutrients and Carbonate System Variables predictor made consistent with chemistry constraints with CONTENT

This is an implementation of the CONTENT method: a combination of CANYON-B Bayesian neural network mappings of AT, CT, pH and pCO2 made consistent with carbonate chemistry constraints for any set of water column P, T, S, O2, location data as an alternative to (spatial) climatological interpolation ([1]).

When using this method, please cite the paper.

See also

content.predict(), content.input_list, content.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)
ArgoSet = DataFetcher(ds='bgc', mode='standard', params='DOXY', measured='DOXY').region([-75, -60, 20, 30, 0, 1000, '20250101', '20250201'])
ds = ArgoSet.to_xarray()

Once input data are loaded, make 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.content.predict()
ds.argo.content.predict(include_uncertainties=True)
ds.argo.content.predict(epres=0.5, etemp=0.005, epsal=0.005, edoxy=0.01)
ds.argo.content.predict(epres=0.5, etemp=0.005, epsal=0.005, edoxy=0.01, include_uncertainties=True)
ds.argo.content.predict(epres=0.5, etemp=0.005, epsal=0.005, edoxy=np.array([...]))
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 HCBSciencesProducts (HCBScienceProducts) which is available at HCBScienceProducts/CONTENT. This implementation relies heavily on the great PyCO2SYS package (mvdh7/PyCO2SYS) for carbonate chemistry calculations [2] which itself is a Python adaptation of the original CO2SYS software by C. Lewis and D. Wallace [3_] and subsequent Matlab functions CO2SYS.m by Van Heuven et al. [4] and errors.m and derivnum.m by Orr et al. [5].

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. doi:10.3389/fmars.2018.00328

[2]

Humphreys, M. P., Lewis, E. R., Sharp, J. D., & Pierrot, D. (2022). PyCO2SYS v1.8: Marine carbonate system calculations in Python. Geoscientific Model Development, 15(1), 15-43. doi:10.5194/gmd-15-15-2022

[3]

Lewis, E. R., & Wallace, D. W. R. (1998). Program developed for CO2 system calculations (No. cdiac: CDIAC-105). Environmental System Science Data Infrastructure for a Virtual Ecosystem (ESS-DIVE)(United States). doi:10.15485/1464255

[4]

Van Heuven, S. M. A. C., Pierrot, D., Rae, J. W. B., Lewis, E., & Wallace, D. W. R. (2011). MATLAB program developed for CO2 system calculations. doi: 10.3334/CDIAC/otg.CO2SYS_MATLAB_v1.1

[5]

Orr, J. C., Epitalon, J. M., Dickson, A. G., & Gattuso, J. P. (2018). Routine uncertainty propagation for the marine carbon dioxide system. Marine Chemistry, 207, 84-107. doi: 10.1016/j.marchem.2018.10.006

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

Methods

__init__(*args, **kwargs)

compute_derivatives_carbonate_system(canyon_data)

Compute derivatives of carbonate system calculations for all 6 parameter pairs (pCO2/AT, pHT/AT, pCO2/pHT, pCO2/DIC, pHT/DIC, AT/DIC).

compute_uncertainties_carbonate_system(...)

Compute carbonate system values and uncertainties for all 6 parameter pairs.

compute_weighted_mean_covariance(dcout, ...)

Compute weighted mean and covariance for each carbonate parameter.

compute_weighted_mean_outputs_and_uncertainties(...)

Compute weighted mean outputs and their uncertainties for each carbonate parameter.

define_weights(sigma)

Define weights for each carbonate parameter based on uncertainties.

get_canyon_b_raw_predictions(params[, ...])

Get raw CANYON-B predictions for specified parameters.

get_param_attrs(param)

Get attributes for a given predicted parameter.

predict([epres, etemp, epsal, edoxy, ...])

Make predictions using the CONTENT method.

setup_pre_carbonate_calculations(canyonb_results)

Prepare the results from CANYON-B for carbonate calculations.

Attributes

input_list

List of parameters required to make predictions with CONTENT

output_list

List of all possible output variables for CONTENT