diff --git a/notebooks/witzit-plot-vanta.ipynb b/notebooks/witzit-plot-vanta.ipynb new file mode 100644 index 0000000..d1002ea --- /dev/null +++ b/notebooks/witzit-plot-vanta.ipynb @@ -0,0 +1,119 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# witzit-plot-vanta --- What In The Zap Is That? AI categorization of spectra from LIBS/XRF analyzers.\n", + "#\n", + "# Copyright (C) 2019-2022, Jeff Moe\n", + "#\n", + "# This program is free software: you can redistribute it and/or modify\n", + "# it under the terms of the GNU General Public License as published by\n", + "# the Free Software Foundation, either version 3 of the License, or\n", + "# (at your option) any later version.\n", + "#\n", + "# This program is distributed in the hope that it will be useful,\n", + "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n", + "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n", + "# GNU General Public License for more details.\n", + "#\n", + "# You should have received a copy of the GNU General Public License\n", + "# along with this program. If not, see .\n", + "#\n", + "# Plotting Application.\n", + "# https://spacecruft.org/spacecruft/witzit\n", + "#\n", + "# Based on wut?\n", + "# https://spacecruft.org/spacecruft/satnogs-wut" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns\n", + "import locale" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "locale.setlocale(locale.LC_ALL, \"en_US.utf8\")\n", + "plt.rcParams['axes.formatter.use_locale'] = True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_csv('examples/olympus-vanta.csv', header = 0,\n", + " skiprows=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40], usecols = [0, 1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(df)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sns.set_theme()\n", + "plt.figure(facecolor='xkcd:off white', figsize=(15, 8))\n", + "# XXX y=\n", + "g=sns.lineplot(x=\"Date\", y=\"2022-04-08\", data=df, linestyle='-', linewidth=1, color='xkcd:pale orange')\n", + "g.set_title('XRF Spectrum'.format('seaborn'), color='xkcd:cornflower blue', fontsize='large', fontweight='bold')\n", + "g.set_xlabel('energy (keV)', color='xkcd:goldenrod', fontsize='large', fontweight='bold')\n", + "g.set_ylabel('Counts', color='xkcd:cerulean', fontsize='large', fontweight='bold')\n", + "g.patch.set_alpha(1.0)\n", + "g.set_facecolor('xkcd:powder blue')\n", + "plt.tight_layout()\n", + "plt.savefig(\"xrf-spectrum.png\", dpi=72, transparent=False, facecolor='xkcd:off white', edgecolor=g.get_facecolor())\n", + "plt.show()\n", + "plt.close()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}