Adding Set 2 Exp 17 Figure and updating aPinene Mass Production Rate / O3 dependency figure

This commit is contained in:
tschan_d committed 2026-09-14 14:54:42 +02:00
1 parent 1a50225e67
commit b20203b883
4 files changed
+2718 -7

No files matched your search

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "1cc3c304",
"metadata": {},
"outputs": [],
@@ -61,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -81,6 +81,11 @@
" flow_source_file = Path(r\"Z:\\People\\David_Tschan\\OFR_SMPS\\flow_files\\20260910_SET02_EXP16_flow_file.txt\"),\n",
" smpl_number_list = range(1, 60),\n",
" on_time_interval=[pd.Timestamp('2026-09-10 15:42:00'), pd.Timestamp('2026-09-10 16:42:00')])\n",
"# Specify the source file paths to for SMPS data\n",
"smps_analyser_04 = OFRAnalyser(data_source_file = Path(r\"Z:\\Data\\SMPS\\processed\\2026\\09_September\\20260914\\20260914_aPinene_SOA.txt\"),\n",
" flow_source_file = Path(r\"Z:\\People\\David_Tschan\\OFR_SMPS\\flow_files\\20260914_SET02_EXP17_flow_file.txt\"),\n",
" smpl_number_list = range(1, 60),\n",
" on_time_interval=[pd.Timestamp('2026-09-14 09:45:00'), pd.Timestamp('2026-09-14 10:45:00')])\n",
"\n",
"# Specify the source file paths to the API O3 monitor data for the different filters used\n",
"ozon_analyser_01 = OzoneAnalyser(file = DATFile(file = Path(r\"Z:\\Data\\API_O3\\2026\\09_September\\2026-09-03_14.23.44_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
@@ -88,7 +93,9 @@
"ozon_analyser_02 = OzoneAnalyser(file = DATFile(file = Path(r\"Z:\\Data\\API_O3\\2026\\09_September\\2026-09-04_12.28.13_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval=None)\n",
"ozon_analyser_03 = OzoneAnalyser(file = DATFile(file = Path(r\"Z:\\Data\\API_O3\\2026\\09_September\\2026-09-10_14.43.47_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval = [pd.Timestamp('2026-09-10 15:00:00'), pd.Timestamp('2026-09-04 17:12:00')])"
" on_time_interval = [pd.Timestamp('2026-09-10 15:00:00'), pd.Timestamp('2026-09-04 17:12:00')])\n",
"ozon_analyser_04 = OzoneAnalyser(file = DATFile(file = Path(r\"Z:\\Data\\API_O3\\2026\\09_September\\2026-09-14_08.48.31_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval = [pd.Timestamp('2026-09-14 09:00:00'), pd.Timestamp('2026-09-14 11:15:00')])"
]
},
{
@@ -109,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -148,6 +155,15 @@
" markersize = 2.5,\n",
" markerfacecolor = 'green',\n",
" label = 'Set 2 Exp. 16')\n",
"ax.plot(ozon_analyser_04.averaged_data['Ozone (ppb)'] / 1000,\n",
" ozon_analyser_04.averaged_data['Mass Production Rate (kg/s)'],\n",
" color = 'green',\n",
" linewidth = 0.5,\n",
" linestyle = ':',\n",
" marker = 's',\n",
" markersize = 2.5,\n",
" markerfacecolor = 'darkorange',\n",
" label = 'Set 2 Exp. 17')\n",
"\n",
"#ax.set_yscale('log')\n",
"\n",
@@ -2095,6 +2095,118 @@
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.692913in}{0.393701in}}{\pgfqpoint{2.078740in}{1.181102in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\pgfsetlinewidth{0.501875pt}%
\definecolor{currentstroke}{rgb}{1.000000,0.549020,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{{0.500000pt}{0.825000pt}}{0.000000pt}%
\pgfpathmoveto{\pgfqpoint{0.819909in}{1.123537in}}%
\pgfpathlineto{\pgfqpoint{1.035128in}{0.995316in}}%
\pgfpathlineto{\pgfqpoint{1.060730in}{0.883766in}}%
\pgfpathlineto{\pgfqpoint{1.093191in}{0.804838in}}%
\pgfpathlineto{\pgfqpoint{1.207147in}{0.735271in}}%
\pgfpathlineto{\pgfqpoint{1.366036in}{0.721754in}}%
\pgfpathlineto{\pgfqpoint{1.457021in}{0.687350in}}%
\pgfpathlineto{\pgfqpoint{1.595442in}{0.645523in}}%
\pgfpathlineto{\pgfqpoint{1.666466in}{0.609386in}}%
\pgfpathlineto{\pgfqpoint{1.729156in}{0.602903in}}%
\pgfpathlineto{\pgfqpoint{1.764751in}{0.576790in}}%
\pgfpathlineto{\pgfqpoint{1.792009in}{0.567078in}}%
\pgfpathlineto{\pgfqpoint{1.834945in}{0.552401in}}%
\pgfpathlineto{\pgfqpoint{1.878406in}{0.546711in}}%
\pgfpathlineto{\pgfqpoint{1.924182in}{0.561540in}}%
\pgfpathlineto{\pgfqpoint{1.996937in}{0.537656in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.692913in}{0.393701in}}{\pgfqpoint{2.078740in}{1.181102in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,0.549020,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.027778in}{-0.027778in}}{\pgfqpoint{0.027778in}{0.027778in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.027778in}}%
\pgfpathlineto{\pgfqpoint{-0.027778in}{-0.027778in}}%
\pgfpathlineto{\pgfqpoint{0.027778in}{-0.027778in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{0.027778in}}%
\pgfpathclose%
\pgfusepath{fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.819909in}{1.123537in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.035128in}{0.995316in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.060730in}{0.883766in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.093191in}{0.804838in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.207147in}{0.735271in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.366036in}{0.721754in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.457021in}{0.687350in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.595442in}{0.645523in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.666466in}{0.609386in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.729156in}{0.602903in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.764751in}{0.576790in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.792009in}{0.567078in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.834945in}{0.552401in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.878406in}{0.546711in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.924182in}{0.561540in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsys@transformshift{1.996937in}{0.537656in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetrectcap%
\pgfsetmiterjoin%
\pgfsetlinewidth{0.803000pt}%
@@ -2149,11 +2261,11 @@
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.800000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{1.614060in}{0.932803in}}%
\pgfpathlineto{\pgfqpoint{2.616098in}{0.932803in}}%
\pgfpathmoveto{\pgfqpoint{1.614060in}{0.785470in}}%
\pgfpathlineto{\pgfqpoint{2.616098in}{0.785470in}}%
\pgfpathlineto{\pgfqpoint{2.616098in}{1.419248in}}%
\pgfpathlineto{\pgfqpoint{1.614060in}{1.419248in}}%
\pgfpathlineto{\pgfqpoint{1.614060in}{0.932803in}}%
\pgfpathlineto{\pgfqpoint{1.614060in}{0.785470in}}%
\pgfpathclose%
\pgfusepath{stroke,fill}%
\end{pgfscope}%
@@ -2288,6 +2400,47 @@
\pgfsetfillcolor{textcolor}%
\pgftext[x=1.969616in,y=1.001692in,left,base]{\color{textcolor}{\rmfamily\fontsize{8.000000}{9.600000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}Set 2 Exp. 16}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\pgfsetlinewidth{0.501875pt}%
\definecolor{currentstroke}{rgb}{1.000000,0.549020,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{{0.500000pt}{0.825000pt}}{0.000000pt}%
\pgfpathmoveto{\pgfqpoint{1.658505in}{0.893248in}}%
\pgfpathlineto{\pgfqpoint{1.769616in}{0.893248in}}%
\pgfpathlineto{\pgfqpoint{1.880727in}{0.893248in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,0.549020,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.027778in}{-0.027778in}}{\pgfqpoint{0.027778in}{0.027778in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.027778in}}%
\pgfpathlineto{\pgfqpoint{-0.027778in}{-0.027778in}}%
\pgfpathlineto{\pgfqpoint{0.027778in}{-0.027778in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{0.027778in}}%
\pgfpathclose%
\pgfusepath{fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{1.769616in}{0.893248in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=1.969616in,y=0.854359in,left,base]{\color{textcolor}{\rmfamily\fontsize{8.000000}{9.600000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}Set 2 Exp. 17}}%
\end{pgfscope}%
\end{pgfpicture}%
\makeatother%
\endgroup%
@@ -0,0 +1,167 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "1cc3c304",
"metadata": {},
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser\n",
"from defs.Helper import DATFile\n",
"from defs.OzoneMonitor import OzoneAnalyser\n",
"\n",
"# Importing required libraries\n",
"import numpy as np\n",
"from pathlib import Path\n",
"import pandas as pd\n",
"\n",
"# Importing libraries required for plotting and exporting\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.dates import DateFormatter, HourLocator\n",
"\n",
"# Setting style of figures and backend\n",
"import matplotlib\n",
"matplotlib.use('pgf')\n",
"plt.style.use(r'C:\\Users\\tschan_d\\Documents\\code\\.mplstyle')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "a67c15f2",
"metadata": {},
"outputs": [],
"source": [
"# Configuring backend\n",
"\n",
"matplotlib.rcParams.update({'text.usetex': True,\n",
" 'pgf.rcfonts': False,\n",
" 'font.family': 'serif',\n",
" 'font.serif': [],\n",
" 'font.sans-serif': [],\n",
" 'font.size': 8,\n",
" 'legend.fontsize': 8,\n",
" 'xtick.labelsize': 8,\n",
" 'ytick.labelsize': 8,\n",
" 'pgf.texsystem': r'lualatex',\n",
" 'pgf.preamble': r'\\usepackage{unicode-math}' + \n",
" r'\\usepackage{accents}' + \n",
" r'\\usepackage{fontspec}' + \n",
" r'\\usepackage[T1]{fontenc}' +\n",
" r'\\usepackage{unicode-math}' +\n",
" r'\\setmainfont{STIX Two Text}' +\n",
" r'\\setmathfont{STIX Two Math}' + \n",
" r'\\usepackage{siunitx}' + \n",
" r'\\usepackage{mhchem}' + \n",
" r'\\newcommand{\\der}[1]{\\ensuremath{\\textnormal{d}\\,{#1}}}'})"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "429e1aed",
"metadata": {},
"outputs": [],
"source": [
"# Linking to the data\n",
"\n",
"# Specify the source file paths to for SMPS data\n",
"smps_analyser = OFRAnalyser(data_source_file = Path(r\"Z:\\Data\\SMPS\\processed\\2026\\09_September\\20260914\\20260914_aPinene_SOA.txt\"),\n",
" flow_source_file = Path(r\"Z:\\People\\David_Tschan\\OFR_SMPS\\flow_files\\20260914_SET02_EXP17_flow_file.txt\"),\n",
" smpl_number_list = range(1, 60),\n",
" on_time_interval=[pd.Timestamp('2026-09-14 09:45:00'), pd.Timestamp('2026-09-14 10:45:00')])\n",
"\n",
"# Specify the source file paths to the API O3 monitor data\n",
"ozon_analyser = OzoneAnalyser(file = DATFile(file = Path(r\"Z:\\Data\\API_O3\\2026\\09_September\\2026-09-14_08.48.31_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval = [pd.Timestamp('2026-09-14 09:00:00'), pd.Timestamp('2026-09-14 11:15:00')])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "26333625",
"metadata": {},
"outputs": [],
"source": [
"# Reading in SMPS data and writing it to disk as a csv\n",
"smps_analyser.GetData()\n",
"smps_analyser.data.to_csv(path_or_buf = 'smps_data.csv', index = False)\n",
"\n",
"# Reading in the O3 data and writing it to disk as a csv\n",
"ozon_analyser.GetData()\n",
"ozon_analyser.file.data.to_csv(path_or_buf = 'ozone_data.csv', index = False)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "99c569ff",
"metadata": {},
"outputs": [],
"source": [
"# Creating figure\n",
"\n",
"fig = plt.figure(figsize=(8.8 / 2.54, 5 / 2.54))\n",
"ax_1 = plt.axes([0.2, 0.2, 0.6, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"\n",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linestyle = '-.',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'Ozone mole fraction $\\chi_{\\ce{O3}}$ $(\\text{ppb})$')\n",
"\n",
"ax_2.step(smps_analyser.data['Starting Time (-)'], smps_analyser.data['Mass Production Rate (kg/s)'], color='darkorange', linestyle='-', label=r'$\\accentset{*}{m}$')\n",
"ax_2.set_ylabel(r'Mass flux $\\accentset{*}{m}$ $(\\unit{\\kilo\\gram\\per\\second})$')\n",
"\n",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=70000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=2E-07, colors='k', linestyles='-.', linewidth=0.5)\n",
"\n",
"ax_1.set_xlabel(r'Time $(-)$')\n",
"ax_1.xaxis.set_major_formatter(DateFormatter(r'%H:%M'))\n",
"ax_1.xaxis.set_major_locator(HourLocator())\n",
"ax_1.set_xlim([pd.Timestamp('2026-09-14 08:45:00'), pd.Timestamp('2026-09-14 11:45:00')])\n",
"\n",
"lines_1, labels_1 = ax_1.get_legend_handles_labels()\n",
"lines_2, labels_2 = ax_2.get_legend_handles_labels()\n",
"\n",
"ax_1.set_ylim([0, 80000])\n",
"ax_2.set_ylim([0, 5E-09])\n",
"\n",
"ax_1.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.close()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "89951350",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "MA",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
File diff suppressed because it is too large. Load diff