Infrared DIC analysis¶
koolstof.infrared
contains tools for processing infrared absorbance data to determine total dissolved inorganic carbon.
These tools were specifically designed for infrared absorbance data recorded by a LI-COR LI-7000 via its Windows Interface Software v2.0.3 and connected to a Marianda AIRICA.
The examples below all assume the following import convention has been used:
from koolstof import infrared as ksi
Data import¶
koolstof.infrared.io
contains functions to import relevant data.
Under the hood
koolstof.infrared.io.read_dbs
and koolstof.infrared.io.read_LI7000
are both very light wrappers around pandas.read_table
. Any additional kwargs
used with either will be passed on to that pandas function, but none should be required.
AIRICA databases¶
koolstof.infrared.io.read_dbs
imports the databases generated by a Marianda AIRICA as a pandas DataFrame:
dbs = ksi.read_dbs(filename)
A new "datetime"
column is added containing the analysis date and time as a pandas Timestamp. It is also calculated as a Matplotlib date number in the column "datenum"
.
Finally, the original dbs column names are mapped to be more friendly.
dbs column name changes
koolstof.infrared.io.read_dbs
renames the dbs columns as follows:
"run type"
→"run_type"
"i.s. temp."
→"temperature_insitu"
"sample mass"
→"mass_sample"
"rep#"
→"rep"
"CT"
→"dic"
"factor CT"
→"dic_factor"
"CV (µmol)"
→"cv_micromol"
"CV (%)"
→"cv_percent"
"last CRM CT"
→"lastcrm_dic_measured"
"cert. CRM CT"
→"lastcrm_dic_certified"
"CRM batch"
→"lastcrm_batch"
"calc. mode"
→"mode_calculation"
"integ. mode"
→"mode_integration"
"Lat."
→"latitude"
"Long."
→"longitude"
"area#1"
→"area_1"
"area#2"
→"area_2"
"area#3"
→"area_3"
"area#4"
→"area_4"
All other column names are left unchanged.
LI-7000 measurements¶
koolstof.infrared.io.read_LI7000
imports the text files recorded by a LI-COR LI-7000 via its Windows Interface Software v2.0.3 as a pandas DataFrame:
licor = ksi.read_LI7000(filename)
At least the "Time"
column must be present in the text file. This is converted into a pandas Timestamp and the column is renamed as "datetime"
. It is also calculated as a Matplotlib date number in the column "datenum"
.
Later processing functions here also expect the "CO2B um/m"
, "H2OB mm/m"
, "T C"
and "P kPa"
columns.
The original column names are mapped to be more friendly.
LI-7000 column name changes
koolstof.infrared.io.read_LI7000
renames the text file's columns as follows:
"Time"
→"datetime"
,"CO2B um/m"
→"x_CO2"
,"H2OB mm/m"
→"x_H2O"
,"T C"
→"temperature"
,"P kPa"
→"pressure"
,"RH %
" →"humidity_relative"
,"Flow V"
→"flow_voltage"
,
Any other column names are left unchanged.