Closed lukegre closed 2 years ago
Hey, if I understand what you're asking correctly, then you can already do this with the pyco2.sys
API, by only providing par1
with no par2
:
import PyCO2SYS as pyco2
results = pyco2.sys(
par1=pCO2_data,
par1_type=4,
**temperature_salinity_settings_etc
)
fCO2_data = results["fCO2"]
The one-parameter (or no-parameter) calculation modes are described in the docs here and in the paper's Section 3.4.
Closing this for now, feel free to continue if the solution above isn't what you were looking for @lukegre
At the moment, this calculation requires the
k_constants["FugFac"]
input. This makes it a bit bulky if you'd quickly like to convert pCO2 --> fCO2. All the components are there (i.e.,gas.fugacityfactor
), it would just be a matter of reorganising a little bit.One possible way of doing this would be to call the current function
convert._fCO2_to_pCO2
that gets called by the existing scripts inPyCO2SYS
. The old name could then be used for a standalone function that usesgas.fugacityfactor
the calculate the factor. This approach would require some refactoring. I had a quick look at the code and it could also bexarray
friendly out of the box 👍Alternatively, we can add it to the
api
.