<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Forum Bauen und Umwelt - Luftmesswerte mit Python holen und darstellen</title>
<link>https://bauforum.wirklichewelt.de/</link>
<description>Das Bauforum</description>
<language>de</language>
<item>
<title>Luftmesswerte mit Python holen und darstellen</title>
<content:encoded><![CDATA[<p>Das Landesamt für Natur, Umwelt und Verbraucherschutz NRW (LANUV) stellt die <a href="https://www.lanuv.nrw.de/umwelt/luft/immissionen/aktuelle-luftqualitaet/" target="_blank">Daten seiner 63 Luftschadstoffmessstationen</a> allen interessierten Bürgerinnen und Bürgern über das Internet zur Verfügung. Gemessen werden Feinstaub bis 10µm Partikelgröße (PM10), Stickstoffdioxid (NO₂), Stickstoffmonoxid (NO), Ozon (O₃) sowie gelegentlich einige andere Werte.</p>
<p>Von aktuellem Interesse sind diese Werte, weil davon Fahrverbote insbesondere für Dieselfahrzeuge abhängig gemacht werden sollen. Die Annahme der <a href="https://www.t-online.de/nachrichten/panorama/id_84599106/kachelmanns-donnerwetter-diesel-die-politik-ignoriert-ein-groesseres-problem.html" target="_blank">Umweltpolitik</a> ist, dass dadurch die gefährliche Feinstaub- und NO₂-Belastung gesenkt werden kann.</p>
<p>Belastungen aus Fahrzeugverkehr erkennt man im Tagesverlauf an einer typischen „Kamelhöckerkurve” mit Höchstwerten zu den Stoßzeiten zwischen 7 und 8 Uhr morgens und 17 bis 19 Uhr nachmittags.<br />
<img src="https://bauforum.wirklichewelt.de/images/uploaded/201903111839125c86ab5029e84.png" alt="[image]"  /></p>
<p>Eine spannende Entdeckung war es für mich, dass der abendliche Höchstwert im Jahresmittel beim Stickstoffdioxid deutlich über dem morgendlichen Wert liegt, obwohl der Stickstoffmonoxidwert abends meistens unter den morgens gemessenen Werten liegt. Noch besser: das abendliche NO₂-Maximum liegt im Jahresmittel deutlich später als zur Zeit des heimkehrenden Berufsverkehrs.</p>
<p>Sind nach Feierabend etwa besonders viele Trecker und Lastwagen unterwegs? Aus persönlicher Erfahrung wissen wir, dass diese Erklärung eher abseitig wäre. Zum Glück können wir auf Millionen von Messwerten zugreifen, in denen wir nach einer Antwort auf unsere Fragen suchen können.</p>
<p>Beim Geodatenportal NRW kann man die stündlich erfassten Messwerte aller Stationen für die letzten 365 Tage und teilweise sogar für die letzten Jahre <a href="https://www.opengeodata.nrw.de/produkte/umwelt_klima/luftqualitaet/luqs/konti_nach_station/" target="_blank">herunterladen</a> und auswerten.</p>
<p>Optimalerweise lässt man das von einem Python-Skript erledigen. Das kann die Stundenwerte eines ganzen Jahres dann auch gleich als 3D-Diagramm darstellen. Die x-Achse (unten links) zeigt die Stunden jedes Tages und die y-Achse (unten rechts) zeigt den jeweiligen Tag des Jahres (1 für den 1. Januar und 365 für den 31. Dezember).<br />
<img src="https://bauforum.wirklichewelt.de/images/uploaded/201903111852395c86ae77cad69.png" alt="[image]"  /></p>
<p>Hier fallen zwei Bereiche im Frühling und Herbst ganz besonders auf, die extreme NO₂-Belastungen in den späten Abendstunden von etwa 19 bis 23 Uhr zeigen. Der Verdacht liegt nahe, dass es sich hierbei gar nicht um Verkehrsbelastungen handelt, sondern um Holzöfen und Kamine, die als extreme Feinstaub- und NO₂-Schleudern <a href="https://www.bafu.admin.ch/dam/bafu/de/dokumente/luft/fachinfo-daten/faktenblatt_emissionsfaktorenfeuerungen.pdf.download.pdf/faktenblatt_emissionsfaktorenfeuerungen.pdf" target="_blank">bekannt</a> sind. Leider werden die Feinstaubmesswerte in NRW durch Mittelung über 24 Stunden unbrauchbar gemacht, sodass keine Zuordnung zu einer Emissionsquelle mehr möglich wird, die Stickstoffdioxidkurven sprechen jedoch für sich.</p>
<p>An Messpunkten, die berüchtigt für ihren Verkehrsdreck sind, wie dem Graf-von-Galen-Ring in der Straßenschlucht hinter dem Finanzamt in Hagen, sind die Messwerte tatsächlich tagsüber am höchsten.<br />
<img src="https://bauforum.wirklichewelt.de/images/uploaded/201903111901035c86b06f023b8.png" alt="[image]"  /></p>
<p>An den meisten anderen Orten jedoch sind die typischen Abend- und Nachtspitzen im Frühjahr und Herbst deutlich zu erkennen. Eine <a href="https://photos.app.goo.gl/3RKCXN2eZFF1KkpDA" target="_blank">komplette Sammlung von Grafiken</a> habe ich als Google-Photo-Album abgelegt.</p>
<p><a href="https://photos.app.goo.gl/3RKCXN2eZFF1KkpDA" target="_blank"><img src="https://bauforum.wirklichewelt.de/images/uploaded/201903121355095c87ba3d1e6d9.png" alt="[image]"  /></a></p>
<p>Wer eigene Experimente mit den Daten durchführen will, darf sich gerne mein <a href="images/uploaded/201903111920565c86b518b7994.zip" target="_blank">Python-Programm zur grafischen Auswertung herunterladen</a>. Die Grafiken werden in der aktuellen Version nicht auf dem Bildschirm dargestellt, sondern direkt als einzelne 1000 × 500 Pixel große PNG-Grafiken auf die Platte geschrieben.</p>
<pre class="python" style="font-family:monospace;"><ol><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#!/usr/bin/env python3</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">&quot;&quot;&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">Auswertung der Luftschadstoffmessungen der NRW-Stationen anhand der</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">stündlichen Messwerte der letzten 365 Tage.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">Das Programm benötigt Python 3 ab Version 3.6 und Matplotlib.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> <span style="color: #dc143c;">urllib</span>.<span style="color: black;">request</span> <span style="color: #ff7700;">import</span> urlopen</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> html <span style="color: #ff7700;">import</span> unescape</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">import</span> matplotlib.<span style="color: black;">pyplot</span> <span style="color: #ff7700;">as</span> plt</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> mpl_toolkits.<span style="color: black;">mplot3d</span> <span style="color: #ff7700;">import</span> Axes3D</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> matplotlib <span style="color: #ff7700;">import</span> cm</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Liste der Stationen holen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">url<span style="color: #000;">=</span><span style="color: #080;">&quot;https://www.lanuv.nrw.de/fileadmin/lanuv/luft/immissionen/aktluftqual/&quot;</span>\</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #080;">&quot;eu_luft_akt.htm&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">htmldata <span style="color: #000;">=</span> urlopen<span style="color: black;">&#40;</span>url<span style="color: black;">&#41;</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Station<span style="color: #000;">=</span><span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Daten aus der HTML-Tabelle auf der Seite zusammensuchen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">for</span> Zeile <span style="color: #ff7700;">in</span> htmldata:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    data <span style="color: #000;">=</span> unescape<span style="color: black;">&#40;</span>Zeile.<span style="color: black;">decode</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;windows-1252&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;td&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> <span style="color: #808;">len</span><span style="color: black;">&#40;</span>data<span style="color: black;">&#41;</span><span style="color: #000;">&gt;</span><span style="color: #008;">2</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Name <span style="color: #000;">=</span> data<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #008;">1</span>:<span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Kürzel <span style="color: #000;">=</span> data<span style="color: black;">&#91;</span><span style="color: #008;">2</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #008;">1</span>:<span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Station.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>Kürzel<span style="color: #000;">,</span> Name<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Zahl der Tage seit Jahresbeginn (ohne Schaltjahr)</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> tag<span style="color: black;">&#40;</span>t<span style="color: #000;">,</span>m<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">return</span> t+<span style="color: #808;">sum</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">28</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">30</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">30</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">30</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: #000;">,</span><span style="color: #008;">30</span><span style="color: #000;">,</span><span style="color: #008;">31</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>:m<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Kontrollausgabe der gelesenen Stationsliste</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808;">print</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Messwerte folgender Stationen sind verfügbar:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808;">print</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Nr. Kürzel Stationsname&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">for</span> i<span style="color: #000;">,</span>nk <span style="color: #ff7700;">in</span> <span style="color: #808;">enumerate</span><span style="color: black;">&#40;</span>Station<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Kürzel<span style="color: #000;">,</span> Stationsname <span style="color: #000;">=</span> nk</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #808;">print</span><span style="color: black;">&#40;</span>f<span style="color: #080;">&quot;{i:2}: {Kürzel:^6} {Stationsname}&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># CSV-Datei der Station lesen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    url <span style="color: #000;">=</span> <span style="color: #080;">&quot;https://www.opengeodata.nrw.de/produkte/umwelt_klima/&quot;</span>\</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">          <span style="color: #080;">&quot;luftqualitaet/luqs/konti_nach_station/&quot;</span>\</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">          f<span style="color: #080;">&quot;OpenKontiLUQS_{Kürzel}_aktuell.csv&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># laufende Summe über alle Tage eines Jahres</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pm10Summe <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: #008;">0</span> <span style="color: #ff7700;">for</span> i <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    noSumme   <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: #008;">0</span> <span style="color: #ff7700;">for</span> i <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    no2Summe  <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: #008;">0</span> <span style="color: #ff7700;">for</span> i <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># 3D-Daten</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    x <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    y <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    z <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">with</span> urlopen<span style="color: black;">&#40;</span>url<span style="color: black;">&#41;</span> <span style="color: #ff7700;">as</span> <span style="color: #dc143c;">csv</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        zeilen <span style="color: #000;">=</span> <span style="color: #dc143c;">csv</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Der Aufbau der CSV-Dateien der einzelnen Stationen ist nicht</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># identisch. Immerhin gibt es in allen Dateien eine Kopfzeile,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># die uns sagt, in welcher Spalte unsere Messwerte zu finden sind.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        posno <span style="color: #000;">=</span> posno2 <span style="color: #000;">=</span> pospm10 <span style="color: #000;">=</span> <span style="color: #808;">None</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        no <span style="color: #000;">=</span> no2 <span style="color: #000;">=</span> pm10 <span style="color: #000;">=</span> <span style="color: #808;">None</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">for</span> i<span style="color: #000;">,</span>j <span style="color: #ff7700;">in</span> <span style="color: #808;">enumerate</span><span style="color: black;">&#40;</span>zeilen<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">decode</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;windows-1252&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;;&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">2</span>:<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">if</span> <span style="color: #080;">&quot;NO2&quot;</span> <span style="color: #ff7700;">in</span> j:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                posno2 <span style="color: #000;">=</span> i</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">elif</span> <span style="color: #080;">&quot; NO &quot;</span> <span style="color: #ff7700;">in</span> j:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                posno <span style="color: #000;">=</span> i</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">elif</span> <span style="color: #080;">&quot;PM10&quot;</span> <span style="color: #ff7700;">in</span> j:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                pospm10 <span style="color: #000;">=</span> i</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Schleife über alle stündlichen Messungen der letzten 365 Tage:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">for</span> zeile <span style="color: #ff7700;">in</span> zeilen<span style="color: black;">&#91;</span><span style="color: #008;">2</span>:<span style="color: black;">&#93;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Datum, Uhrzeit, Messwerte (z. B. für NO, NO₂ und PM10)</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            d<span style="color: #000;">,</span>u<span style="color: #000;">,</span>*mw <span style="color: #000;">=</span> zeile.<span style="color: black;">decode</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;windows-1252&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;;&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Stunde, Tag und Monat dieser Messung</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            h <span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>u.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;:&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            t <span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>d.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;.&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            m <span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>d.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;.&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># In welchen Spalten sind Werte, die uns interessieren?</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">if</span> posno <span style="color: #ff7700;">is</span> <span style="color: #ff7700;">not</span> <span style="color: #808;">None</span>: no <span style="color: #000;">=</span> mw<span style="color: black;">&#91;</span>posno<span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">if</span> posno2 <span style="color: #ff7700;">is</span> <span style="color: #ff7700;">not</span> <span style="color: #808;">None</span>: no2 <span style="color: #000;">=</span> mw<span style="color: black;">&#91;</span>posno2<span style="color: black;">&#93;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">if</span> pospm10 <span style="color: #ff7700;">is</span> <span style="color: #ff7700;">not</span> <span style="color: #808;">None</span>: pm10 <span style="color: #000;">=</span> mw<span style="color: black;">&#91;</span>pospm10<span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># NO₂-Messwert für 3D-Diagramm eintragen (falls vorhanden)</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">try</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                z.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #808;">int</span><span style="color: black;">&#40;</span>no2<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #800; font-style: italic;"># kann schiefgehen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                x.<span style="color: black;">append</span><span style="color: black;">&#40;</span>h<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                y.<span style="color: black;">append</span><span style="color: black;">&#40;</span>tag<span style="color: black;">&#40;</span>t<span style="color: #000;">,</span>m<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">except</span> <span style="color: black;">&#40;</span><span style="color: #808;">TypeError</span><span style="color: #000;">,</span> <span style="color: #808;">ValueError</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Kein Messwert</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #ff7700;">pass</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Stundensummen für 2D-Diagramm aufaddieren:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Feinstaub (derzeit überall eine horizontale Linie, denn bei</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># allen Stationen in NRW wurden die Messwerte durch</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># 24-Stunden-Mittelwertbildung unbrauchbar gemacht!)</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">try</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                pm10Summe<span style="color: black;">&#91;</span>h-<span style="color: #008;">1</span><span style="color: black;">&#93;</span> +<span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>pm10<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">except</span> <span style="color: black;">&#40;</span><span style="color: #808;">TypeError</span><span style="color: #000;">,</span> <span style="color: #808;">ValueError</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #ff7700;">pass</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Stickstoffmonoxid, NO</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">try</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                noSumme<span style="color: black;">&#91;</span>h-<span style="color: #008;">1</span><span style="color: black;">&#93;</span> +<span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>no<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">except</span> <span style="color: black;">&#40;</span><span style="color: #808;">TypeError</span><span style="color: #000;">,</span> <span style="color: #808;">ValueError</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #ff7700;">pass</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Stickstoffdioxid, NO₂</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">try</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                no2Summe<span style="color: black;">&#91;</span>h-<span style="color: #008;">1</span><span style="color: black;">&#93;</span> +<span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>no2<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">except</span> <span style="color: black;">&#40;</span><span style="color: #808;">TypeError</span><span style="color: #000;">,</span> <span style="color: #808;">ValueError</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #ff7700;">pass</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Jahressummen auf Tageswerte zurückrechnen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">for</span> i <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        pm10Summe<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> /<span style="color: #000;">=</span> <span style="color: #008;">365</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        no2Summe<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> /<span style="color: #000;">=</span> <span style="color: #008;">365</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        noSumme<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> /<span style="color: #000;">=</span> <span style="color: #008;">365</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Diagramme</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># figsize 10,5 ergibt 1000 × 500 Pixel in der PNG-Datei</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    fig <span style="color: #000;">=</span> plt.<span style="color: black;">figure</span><span style="color: black;">&#40;</span>figsize<span style="color: #000;">=</span><span style="color: black;">&#40;</span><span style="color: #008;">10</span><span style="color: #000;">,</span><span style="color: #008;">5</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># 2D-Plot der Stundenmittelwerte</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ax <span style="color: #000;">=</span> fig.<span style="color: black;">add_subplot</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span> <span style="color: #008;">2</span><span style="color: #000;">,</span> <span style="color: #008;">1</span><span style="color: black;">&#41;</span> <span style="color: #800; font-style: italic;"># 1 Zeile, 2 Spalten: Spalte 1</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ax.<span style="color: black;">plot</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">25</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span>noSumme<span style="color: #000;">,</span><span style="color: #080;">&quot;r&quot;</span><span style="color: #000;">,</span>label<span style="color: #000;">=</span><span style="color: #080;">&quot;NO&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ax.<span style="color: black;">plot</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">25</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span>no2Summe<span style="color: #000;">,</span><span style="color: #080;">&quot;b&quot;</span><span style="color: #000;">,</span>label<span style="color: #000;">=</span><span style="color: #080;">&quot;NO2&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ax.<span style="color: black;">plot</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">25</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span>pm10Summe<span style="color: #000;">,</span><span style="color: #080;">&quot;g&quot;</span><span style="color: #000;">,</span>label<span style="color: #000;">=</span><span style="color: #080;">&quot;PM10&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">legend</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">xlim</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">xticks</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span><span style="color: #008;">25</span><span style="color: #000;">,</span><span style="color: #008;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>color<span style="color: #000;">=</span><span style="color: #080;">&quot;lightgrey&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">xlabel</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Uhrzeit&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">ylabel</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;µg/m³&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">title</span><span style="color: black;">&#40;</span>f<span style="color: #080;">&quot;Stundenmittelwerte Station {Kürzel}<span style="color: #000099; font-weight: bold;">\n</span>{Stationsname}&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;">#3D-Plot der Stundenwerte übers ganze Jahr</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> no2:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        ax <span style="color: #000;">=</span> fig.<span style="color: black;">add_subplot</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span> <span style="color: #008;">2</span><span style="color: #000;">,</span> <span style="color: #008;">2</span><span style="color: #000;">,</span> projection<span style="color: #000;">=</span><span style="color: #080;">'3d'</span><span style="color: black;">&#41;</span> <span style="color: #800; font-style: italic;"># Spalte 2</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        surf <span style="color: #000;">=</span> ax.<span style="color: black;">plot_trisurf</span><span style="color: black;">&#40;</span>x<span style="color: #000;">,</span>y<span style="color: #000;">,</span>z<span style="color: #000;">,</span> cmap<span style="color: #000;">=</span>cm.<span style="color: black;">jet</span><span style="color: #000;">,</span> linewidth<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        fig.<span style="color: black;">colorbar</span><span style="color: black;">&#40;</span>surf<span style="color: #000;">,</span> shrink<span style="color: #000;">=</span><span style="color: #008;">0.5</span><span style="color: #000;">,</span> aspect<span style="color: #000;">=</span><span style="color: #008;">5</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        plt.<span style="color: black;">xlim</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">24</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        plt.<span style="color: black;">xticks</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span><span style="color: #008;">25</span><span style="color: #000;">,</span><span style="color: #008;">3</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        plt.<span style="color: black;">yticks</span><span style="color: black;">&#40;</span><span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">1</span><span style="color: #000;">,</span><span style="color: #008;">367</span><span style="color: #000;">,</span><span style="color: #008;">61</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        ax.<span style="color: black;">set_xlabel</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Uhrzeit&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        ax.<span style="color: black;">set_ylabel</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Tag des Jahres&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        ax.<span style="color: black;">set_zlabel</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;µg/m³&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        plt.<span style="color: black;">title</span><span style="color: black;">&#40;</span>f<span style="color: #080;">&quot;NO₂-Werte Station {Kürzel}<span style="color: #000099; font-weight: bold;">\n</span>{Stationsname}&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Teilplots ohne unnötigen Rand anordnen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">subplots_adjust</span><span style="color: black;">&#40;</span>left<span style="color: #000;">=</span><span style="color: #008;">0.001</span><span style="color: #000;">,</span> bottom<span style="color: #000;">=</span><span style="color: #008;">0.001</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                        right<span style="color: #000;">=</span><span style="color: #008;">0.999</span><span style="color: #000;">,</span> top<span style="color: #000;">=</span><span style="color: #008;">0.999</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                        wspace<span style="color: #000;">=</span><span style="color: #008;">0.001</span><span style="color: #000;">,</span> hspace<span style="color: #000;">=</span><span style="color: #008;">0.001</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">tight_layout</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># plt.show()</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">savefig</span><span style="color: black;">&#40;</span>f<span style="color: #080;">&quot;{Kürzel}.png&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    plt.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808;">print</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Fertig.&quot;</span><span style="color: black;">&#41;</span></div></li></ol></pre><p>Lizenzinformationen: Die Daten des Geodatenportals NRW stehen unter der <a href="https://www.govdata.de/dl-de/by-2-0" target="_blank">Datenlizenz Deutschland Namensnennung 2.0</a>.</p>
]]></content:encoded>
<link>https://bauforum.wirklichewelt.de/index.php?id=11708</link>
<guid>https://bauforum.wirklichewelt.de/index.php?id=11708</guid>
<pubDate>Mon, 11 Mar 2019 19:52:30 +0000</pubDate>
<category>Software</category><dc:creator>Martin Vogel</dc:creator>
</item>
</channel>
</rss>
