For each bottle, from its own in-situ temperature and practical salinity at its depth: sea
pressure from depth and latitude (gsw_p_from_z(-depth, latitude)), absolute salinity
(gsw_SA_from_SP), conservative temperature (gsw_CT_from_t), then
spiciness0, spiciness at 0 dbar (gsw_spiciness0; McDougall & Krzysik 2015), byctd_spice(), the same rule as the CTD series;sigma_theta_teos10, potential density anomaly referenced to 0 dbar (gsw_sigma0), the TEOS-10 sigma-theta.
Usage
bottle_spice_sigma0(
temperature,
salinity,
depth,
longitude,
latitude,
q_temperature = NA,
q_salinity = NA
)Value
a tibble with one row per input: pressure_dbar, spiciness0 (kg m^-3),
sigma_theta_teos10 (kg m^-3). pressure_dbar is NA where either value is.
Details
Flags first. A bottle whose temperature or salinity its provider flags 8 (suspect) or 9
(missing) gets neither value: a derived value carries no flag, so nothing downstream could undo
a flagged input. Code 6 ("data OK but taken from CTD") and an empty code are good. Codes are
normalized as combine_sensor_pair() does ("8.0" is "8"). A missing or non-finite input
gives NA, never an error.