Adding figures in pdf output to include directly in any documents without dynamic font adjustment... A workaround for pgfplots needs to be found...

This commit is contained in:
tschan_d committed 2026-09-16 11:25:24 +02:00
1 parent b20203b883
commit 67c74359ec
29 files changed
+9259 -7635

No files matched your search

@@ -20,47 +20,13 @@
"# 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')"
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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": 3,
"id": "0dc0db4a",
"metadata": {},
"outputs": [
@@ -81,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -101,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"id": "26333625",
"metadata": {},
"outputs": [],
@@ -117,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 5,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -125,33 +91,38 @@
"# 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_1 = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\n",
"\n",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'red', linestyle = '-.',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'Ozone mole fraction $\\chi_{\\ce{O3}}$ $(\\text{ppb})$')\n",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth = 0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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='blue', 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",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=120000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, 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-02 08:45:00'), pd.Timestamp('2026-09-02 12:15:00')])\n",
"ax_1.set_xlim([pd.Timestamp('2026-09-02 08:45:00'), pd.Timestamp('2026-09-02 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, 70000])\n",
"ax_1.set_ylim([0, 120000])\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",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,7 @@
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser\n",
"from defs.SMPS import OFRAnalyser, OFRSample\n",
"from defs.Helper import DATFile\n",
"from defs.OzoneMonitor import OzoneAnalyser\n",
"\n",
@@ -20,47 +20,13 @@
"# 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')"
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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": 3,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -80,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "26333625",
"metadata": {},
"outputs": [],
@@ -96,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -104,33 +70,38 @@
"# 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_1 = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\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",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth=0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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='red', 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",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=120000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, 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-03 14:15:00'), pd.Timestamp('2026-09-03 17:45:00')])\n",
"ax_1.set_xlim([pd.Timestamp('2026-09-03 14:15:00'), pd.Timestamp('2026-09-03 17:15: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_1.set_ylim([0, 120000])\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",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
@@ -159,7 +130,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.14"
}
},
"nbformat": 4,
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,7 @@
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser\n",
"from defs.SMPS import OFRAnalyser, OFRSample\n",
"from defs.Helper import DATFile\n",
"from defs.OzoneMonitor import OzoneAnalyser\n",
"\n",
@@ -20,47 +20,13 @@
"# 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')"
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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": 3,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -80,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "26333625",
"metadata": {},
"outputs": [],
@@ -96,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -104,33 +70,38 @@
"# 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_1 = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\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",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth = 0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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='blue', 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",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=120000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, 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-04 12:15:00'), pd.Timestamp('2026-09-04 15:45:00')])\n",
"ax_1.set_xlim([pd.Timestamp('2026-09-04 12:15:00'), pd.Timestamp('2026-09-04 15:15: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_1.set_ylim([0, 120000])\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",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
@@ -159,7 +130,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.14"
}
},
"nbformat": 4,
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "1cc3c304",
"metadata": {},
"outputs": [],
@@ -19,49 +19,13 @@
"\n",
"# Importing libraries required for plotting and exporting\n",
"import matplotlib.pyplot as plt\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')"
"from defs.Helper import quick_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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}}}' + \n",
" r'\\DeclareSIUnit\\ppb{ppb}' + \n",
" r'\\DeclareSIUnit\\ppm{ppm}'})"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -100,34 +64,36 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "f090dba3",
"metadata": {},
"outputs": [],
"source": [
"# Reading in SMPS data\n",
"for smps_analyser, ozon_analyser in zip([smps_analyser_01, smps_analyser_02, smps_analyser_03], [ozon_analyser_01, ozon_analyser_02, ozon_analyser_03]):\n",
"\n",
"for smps_analyser, ozon_analyser in zip([smps_analyser_01, smps_analyser_02, smps_analyser_03, smps_analyser_04], [ozon_analyser_01, ozon_analyser_02, ozon_analyser_03, ozon_analyser_04]):\n",
"\n",
" smps_analyser.GetData()\n",
" ozon_analyser.GetData()\n",
"\n",
" ozon_analyser.AverageWithSMPS(smps_analyser = smps_analyser, cut_edges = 2, subtract_baseline = ['yes', 3])"
" ozon_analyser.AverageWithSMPS(smps_analyser = smps_analyser, cut_edges = 2, subtract_baseline = ['yes', 1], normalise_flow=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "99c569ff",
"metadata": {},
"outputs": [],
"source": [
"# Creating figure\n",
"# space for figure: 18 cm (text width), therefore we can use 9 cm for a figure.\n",
"\n",
"fig = plt.figure(figsize=(8.8 / 2.54, 5 / 2.54))\n",
"ax = plt.axes([0.2, 0.2, 0.6, 0.6], frameon=True)\n",
"ax = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"\n",
"ax.plot(ozon_analyser_01.averaged_data['Ozone (ppb)'] / 1000,\n",
" ozon_analyser_01.averaged_data['Mass Production Rate (kg/s)'],\n",
"ax.plot(ozon_analyser_01.averaged_data.values[:, 0] / 1000,\n",
" ozon_analyser_01.averaged_data.values[:, 1],\n",
" color = 'red',\n",
" linewidth = 0.5,\n",
" linestyle = ':',\n",
@@ -136,8 +102,8 @@
" markerfacecolor = 'red',\n",
" label = r'Set 2 Exp. 14')\n",
"\n",
"ax.plot(ozon_analyser_02.averaged_data['Ozone (ppb)'] / 1000,\n",
" ozon_analyser_02.averaged_data['Mass Production Rate (kg/s)'],\n",
"ax.plot(ozon_analyser_02.averaged_data.values[:, 0] / 1000,\n",
" ozon_analyser_02.averaged_data.values[:, 1],\n",
" color = 'blue',\n",
" linewidth = 0.5,\n",
" linestyle = ':',\n",
@@ -146,8 +112,8 @@
" markerfacecolor = 'blue',\n",
" label = 'Set 2 Exp. 15')\n",
"\n",
"ax.plot(ozon_analyser_03.averaged_data['Ozone (ppb)'] / 1000,\n",
" ozon_analyser_03.averaged_data['Mass Production Rate (kg/s)'],\n",
"ax.plot(ozon_analyser_03.averaged_data.values[:, 0] / 1000,\n",
" ozon_analyser_03.averaged_data.values[:, 1],\n",
" color = 'green',\n",
" linewidth = 0.5,\n",
" linestyle = ':',\n",
@@ -155,13 +121,13 @@
" 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",
"ax.plot(ozon_analyser_04.averaged_data.values[:, 0] / 1000,\n",
" ozon_analyser_04.averaged_data.values[:, 1],\n",
" color = 'darkorange',\n",
" linewidth = 0.5,\n",
" linestyle = ':',\n",
" marker = 's',\n",
" markersize = 2.5,\n",
" marker = '^',\n",
" markersize = 4,\n",
" markerfacecolor = 'darkorange',\n",
" label = 'Set 2 Exp. 17')\n",
"\n",
@@ -170,14 +136,15 @@
"ax.set_xlabel(r'Deviation from $\\ce{O3}$ baseline $\\Delta\\chi_{\\ce{O3}}$ $(\\unit{\\ppm})$')\n",
"ax.set_ylabel(r'Mass flux $\\accentset{*}{m}$ $(\\unit{\\kilo\\gram\\per\\second})$')\n",
"\n",
"ax.set_ylim([0, 70000])\n",
"#ax.set_ylim([0, 70000])\n",
"ax.set_ylim([1E-9, 5E-09])\n",
"ax.set_xlim([2, 12])\n",
"#ax.set_xscale('log')\n",
"ax.set_xlim([2, 14])\n",
"\n",
"ax.legend(loc='upper right')\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
@@ -206,7 +173,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.14"
}
},
"nbformat": 4,
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,7 @@
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser\n",
"from defs.SMPS import OFRAnalyser, OFRSample\n",
"from defs.Helper import DATFile\n",
"from defs.OzoneMonitor import OzoneAnalyser\n",
"\n",
@@ -20,47 +20,13 @@
"# 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')"
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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": 3,
"id": "429e1aed",
"metadata": {},
"outputs": [],
@@ -80,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "26333625",
"metadata": {},
"outputs": [],
@@ -96,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -104,33 +70,38 @@
"# 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_1 = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\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",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth = 0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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='green', 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",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=120000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, 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-10 14:45:00'), pd.Timestamp('2026-09-10 18:15:00')])\n",
"ax_1.set_xlim([pd.Timestamp('2026-09-10 14:45:00'), pd.Timestamp('2026-09-10 17: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_1.set_ylim([0, 120000])\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",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
@@ -159,7 +130,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.14"
}
},
"nbformat": 4,
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,7 @@
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser\n",
"from defs.SMPS import OFRAnalyser, OFRSample\n",
"from defs.Helper import DATFile\n",
"from defs.OzoneMonitor import OzoneAnalyser\n",
"\n",
@@ -20,47 +20,13 @@
"# 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')"
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"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": [],
@@ -80,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"id": "26333625",
"metadata": {},
"outputs": [],
@@ -96,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 4,
"id": "99c569ff",
"metadata": {},
"outputs": [],
@@ -104,17 +70,19 @@
"# 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_1 = plt.axes([0.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\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",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linestyle = '-', linewidth = 0.5,label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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",
"ax_1.vlines(ozon_analyser.on_time_interval, ymin=0, ymax=120000, colors='k', linestyles='--', linewidth=0.5)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, 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",
@@ -124,13 +92,16 @@
"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_1.set_ylim([0, 120000])\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",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
"plt.savefig('figure' + format, dpi=400)\n",
"plt.close()"
]
},
@@ -159,7 +130,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.14"
}
},
"nbformat": 4,
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,138 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "1cc3c304",
"metadata": {},
"outputs": [],
"source": [
"# Importing custom code\n",
"from defs.SMPS import OFRAnalyser, OFRSample\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",
"from defs.Helper import quick_plot_setup, final_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"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_Limonene_SOA.txt\"),\n",
" flow_source_file = Path(r\"Z:\\People\\David_Tschan\\OFR_SMPS\\flow_files\\20260914_SET02_EXP18_flow_file.txt\"),\n",
" smpl_number_list = range(1, 60),\n",
" on_time_interval=[pd.Timestamp('2026-09-14 15:13:00'), pd.Timestamp('2026-09-14 16:13: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_14.21.46_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval = [pd.Timestamp('2026-09-14 14:28:00'), pd.Timestamp('2026-09-14 16:43:00')])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"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": 4,
"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.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\n",
"\n",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth = 0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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='red', 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=120000, colors='k', linestyles='--', linewidth=0.5, zorder=0)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, colors='k', linestyles='-.', linewidth=0.5, zorder=0)\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 14:15:00'), pd.Timestamp('2026-09-14 17:15: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, 120000])\n",
"ax_2.set_ylim([0, 5E-09])\n",
"\n",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig('figure' + format, 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.14"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,139 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"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",
"import matplotlib\n",
"from defs.Helper import quick_plot_setup\n",
"format = quick_plot_setup()"
]
},
{
"cell_type": "code",
"execution_count": null,
"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\\20260915\\20260915_Limonene_01_SOA.txt\"),\n",
" flow_source_file = Path(r\"Z:\\People\\David_Tschan\\OFR_SMPS\\flow_files\\20260915_SET02_EXP19_flow_file.txt\"),\n",
" smpl_number_list = range(1, 60),\n",
" on_time_interval=[pd.Timestamp('2026-09-14 15:13:00'), pd.Timestamp('2026-09-14 16:13: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-15_08.56.00_PC14750_API_O3.dat\"), data_name = 'ozone'),\n",
" on_time_interval = [pd.Timestamp('2026-09-14 14:28:00'), pd.Timestamp('2026-09-14 16:43:00')])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"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": null,
"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.15, 0.2, 0.7, 0.6], frameon=True)\n",
"ax_2 = plt.twinx(ax=ax_1)\n",
"ax_1.set_zorder(0)\n",
"ax_2.set_zorder(ax_1.get_zorder())\n",
"\n",
"ax_1.plot(ozon_analyser.file.data['timestamp'], ozon_analyser.file.data['ozone'], color = 'black', linewidth = 0.5, linestyle = '-',label=r'$\\chi_{\\ce{O3}}$')\n",
"ax_1.set_ylabel(r'\\ce{O3} 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=100000, colors='k', linestyles='--', linewidth=0.5, zorder=0)\n",
"ax_2.vlines(smps_analyser.on_time_interval, ymin=0, ymax=5E-09, colors='k', linestyles='-.', linewidth=0.5, zorder=0)\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 14:13:00'), pd.Timestamp('2026-09-14 17:13: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, 100000])\n",
"ax_2.set_ylim([0, 5E-09])\n",
"\n",
"legend = plt.legend(lines_1 + lines_2, labels_1 + labels_2, loc='upper right')\n",
"legend.get_frame().set_alpha(None)\n",
"legend.get_frame().set_facecolor('white')\n",
"legend.set_zorder(100)\n",
"\n",
"#plt.show()\n",
"plt.savefig('figure' + format, 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
}
@@ -0,0 +1,27 @@
METADATA
----------------------------------------------------------------------
Standard 2.00
Unit mg/L
Prepared 10.06.2026
Measured 10.09.2026
CALIBRATION DATA
conc. STD Dilution A1 A2 A3
(mg / L) (-) (-) (-) (-)
0.05 40.00 0.4019 0.9061 0.6915
0.10 20.00 1.264 1.230 1.249
0.20 10.00 1.909 2.049 2.005
0.50 4.000 5.410 5.482 5.887
0.70 2.857 7.544 8.078 7.808
1.00 2.000 10.83 10.76 10.53
2.00 1.000 21.69 21.67 0.03210
CALIBRATION RESULTS
----------------------------------------------------------------------
Slope 0.0928
Intercept -0.0084
R2 0.9983
EXCLUDED 7
FROM 0.0500
TO 1.0000
COMPUTED 15.09.2026 14:26:46
@@ -0,0 +1,27 @@
METADATA
----------------------------------------------------------------------
Standard 2.00
Unit mg/L
Prepared 10.06.2026
Measured 10.09.2026
CALIBRATION DATA
conc. STD Dilution A1 A2 A3
(mg / L) (-) (-) (-) (-)
0.05 40.00 0.4019 0.9061 0.6915
0.10 20.00 1.264 1.230 1.249
0.20 10.00 1.909 2.049 2.005
0.50 4.000 5.410 5.482 5.887
0.70 2.857 7.544 8.078 7.808
1.00 2.000 10.83 10.76 10.53
2.00 1.000 21.69 21.67 0.03210
CALIBRATION RESULTS
----------------------------------------------------------------------
Slope 0.0928
Intercept -0.0084
R2 0.9983
EXCLUDED 7
FROM 0.0500
TO 1.0000
COMPUTED 15.09.2026 15:07:09
@@ -0,0 +1,27 @@
METADATA
----------------------------------------------------------------------
Standard 2.00
Unit mg/L
Prepared 10.06.2026
Measured 10.09.2026
CALIBRATION DATA
conc. STD Dilution A1 A2 A3
(mg / L) (-) (-) (-) (-)
0.05 40.00 0.4019 0.9061 0.6915
0.10 20.00 1.264 1.230 1.249
0.20 10.00 1.909 2.049 2.005
0.50 4.000 5.410 5.482 5.887
0.70 2.857 7.544 8.078 7.808
1.00 2.000 10.83 10.76 10.53
2.00 1.000 21.69 21.67 0.03210
CALIBRATION RESULTS
----------------------------------------------------------------------
Slope 0.0928
Intercept -0.0084
R2 0.9983
EXCLUDED 7
FROM 0.0500
TO 1.0000
COMPUTED 15.09.2026 15:15:18
@@ -0,0 +1,27 @@
METADATA
----------------------------------------------------------------------
Standard 2.00
Unit mg/L
Prepared 10.06.2026
Measured 10.09.2026
CALIBRATION DATA
conc. STD Dilution A1 A2 A3
(mg / L) (-) (-) (-) (-)
0.05 40.00 0.4019 0.9061 0.6915
0.10 20.00 1.264 1.230 1.249
0.20 10.00 1.909 2.049 2.005
0.50 4.000 5.410 5.482 5.887
0.70 2.857 7.544 8.078 7.808
1.00 2.000 10.83 10.76 10.53
2.00 1.000 21.69 21.67 0.03210
CALIBRATION RESULTS
----------------------------------------------------------------------
Slope 0.0928
Intercept -0.0084
R2 0.9983
EXCLUDED 7
FROM 0.0500
TO 1.0000
COMPUTED 15.09.2026 15:24:31
@@ -0,0 +1,27 @@
METADATA
----------------------------------------------------------------------
Standard 2.00
Unit mg/L
Prepared 10.06.2026
Measured 10.09.2026
CALIBRATION DATA
conc. STD Dilution A1 A2 A3
(mg / L) (-) (-) (-) (-)
0.05 40.00 0.4019 0.9061 0.6915
0.10 20.00 1.264 1.230 1.249
0.20 10.00 1.909 2.049 2.005
0.50 4.000 5.410 5.482 5.887
0.70 2.857 7.544 8.078 7.808
1.00 2.000 10.83 10.76 10.53
2.00 1.000 21.69 21.67 0.03210
CALIBRATION RESULTS
----------------------------------------------------------------------
Slope 0.0928
Intercept -0.0084
R2 0.9983
EXCLUDED 7
FROM 0.0500
TO 1.0000
COMPUTED 15.09.2026 16:26:25
+16 -14
View File
@@ -17,12 +17,12 @@
"# 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')"
"#plt.style.use(r'C:\\Users\\tschan_d\\Documents\\code\\.mplstyle')"
]
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 5,
"id": "3151288f",
"metadata": {},
"outputs": [],
@@ -34,12 +34,14 @@
" 'font.family': 'serif',\n",
" 'font.serif': [],\n",
" 'font.sans-serif': [],\n",
" 'font.size': 8,\n",
" 'font.size': 6,\n",
" 'legend.fontsize': 6,\n",
" 'xtick.labelsize': 8,\n",
" 'ytick.labelsize': 8,\n",
" 'legend.handlelength': 2,\n",
" 'xtick.labelsize': 6,\n",
" 'ytick.labelsize': 6,\n",
" 'pgf.texsystem': r'lualatex',\n",
" 'pgf.preamble': r'\\usepackage{unicode-math}' + \n",
" 'pgf.preamble': r'\\usepackage{scrextend}' + \n",
" r'\\usepackage{unicode-math}' + \n",
" r'\\usepackage{accents}' + \n",
" r'\\usepackage{fontspec}' + \n",
" r'\\usepackage[T1]{fontenc}' +\n",
@@ -61,7 +63,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\tschan_d\\Documents\\code\\defs\\TOC.py:62: UserWarning: Calibration alreadyt exists, will be overwritten...\n",
"C:\\Users\\tschan_d\\Documents\\code\\defs\\TOC.py:156: UserWarning: Calibration alreadyt exists, will be overwritten...\n",
" warnings.warn(\"Calibration alreadyt exists, will be overwritten...\")\n"
]
}
@@ -74,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 6,
"id": "00b59d82",
"metadata": {},
"outputs": [],
@@ -82,7 +84,7 @@
"# 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_1 = plt.axes([0.15, 0.15, 0.7, 0.7], frameon=True)\n",
"\n",
"# calibration curve with outliers\n",
"ax_1.scatter(cal_01.calibrant_data['area_average'],\n",
@@ -93,7 +95,7 @@
" facecolor = 'None',\n",
" edgecolor = 'red',\n",
" linewidth = 0.75)\n",
"ax_1.plot([0, 17], cal_01.compute([0, 17]), linestyle = '--', color = 'red', linewidth = 0.75, label = f\"$c={cal_01.curve.slope:1.2f}A-{abs(cal_01.curve.intercept):1.2f},\\,\" + r'\\textnormal{R}^{2}=' + f\"{cal_01.curve.R2_value:1.3f}$\")\n",
"ax_1.plot([0, 17], cal_01.compute([0, 17]), linestyle = '-.', color = 'red', linewidth = 0.75, label = r'Some entry $a+b$ into the legend')\n",
"\n",
"# calibration curve without outliers\n",
"ax_1.scatter(cal_02.calibrant_data['area_average'][cal_02.mask],\n",
@@ -102,15 +104,15 @@
" marker = '.',\n",
" s = 5,\n",
" facecolor = 'black')\n",
"ax_1.plot([0, 17], cal_02.compute([0, 17]), linestyle = '-', color = 'black', linewidth = 0.75, label = f\"$c={cal_02.curve.slope:1.2f}A-{abs(cal_02.curve.intercept):1.2f},\\,\" + r'\\textnormal{R}^{2}=' + f\"{cal_02.curve.R2_value:1.3f}$\")\n",
"ax_1.plot([0, 17], cal_02.compute([0, 17]), linestyle = '-', color = 'black', linewidth = 0.75, label = str(f\"$c={cal_01.curve.slope:1.3f}-{abs(cal_01.curve.intercept):1.3f}$\"))\n",
"ax_1.set_xlabel(r'Area $A$ $(-)$')\n",
"ax_1.set_ylabel(r'Concentration $c$ $(\\unit{\\milli\\gram\\per\\liter})$')\n",
"\n",
"ax_1.set_xlim([0, 16])\n",
"ax_1.set_ylim([0, 2.1])\n",
"ax_1.set_xlim([0, 15])\n",
"ax_1.set_ylim([0, 2.5])\n",
"\n",
"lines_1, labels_1 = ax_1.get_legend_handles_labels()\n",
"ax_1.legend(loc = 'upper left', handlelength = 1, borderpad = 0.7)\n",
"ax_1.legend(loc = 'upper left', fontsize=6)\n",
"\n",
"#plt.show()\n",
"plt.savefig(\"figure.pgf\", format='pgf', dpi=400)\n",
File diff suppressed because it is too large. Load diff