<jupyter_start><jupyter_text>**<NAME>**   🌁 Wildfire Smoke 9 September 2020 Solar raditation and temperature in Pacific Grove, CA.There have been major wildfires in the western United States in the fall fo 2020. Pacific Grove, California, is pretty used to days with obscured sunlight becuase it can be foggy. But the thick smoke produced by the fires caused a very eerie day that made national news reporting the [Mars-like atmosphere](https://www.nbcnews.com/news/us-news/scene-mars-skies-parts-california-turn-orange-wildfires-continue-n1239659) we were living in. It was indeed an eerie day with an orange glow coming inside from all the windows.![image.png](../images/smoke_2020.png)It is interesting to see how the solar radiation changed throughout the week. Here we get data from Synoptic to look at what one station recorded in Pacific Grove, California, very close to where I live ([EW1554](https://mesowest.utah.edu/cgi-bin/droman/meso_base_dyn.cgi?stn=e1554)).<jupyter_code>import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, HourLocator
from datetime import datetime, timedelta
import pandas as pd

import sys
sys.path.append('../')

from synoptic.services import stations_timeseries
a = stations_timeseries(stid='E1554',
                        vars='solar_radiation,air_temp',
                        start=datetime(2020, 9, 5, 7),
                        end=datetime(2020, 9, 12, 7),
                        obtimezone='local',
                        units='english',
                        verbose='HIDE')
fig, ax1 = plt.subplots(1,1, figsize=[8,4], dpi=200)

# Solar Radiation
p1=ax1.fill_between(a.index.tz_localize(None), a.solar_radiation, color='gold', alpha=.75, zorder=3, label='Solar Radiation')
ax1.plot(a.index.tz_localize(None), a.solar_radiation, color='k', zorder=100, lw=.5)
ax1.grid(linestyle='--', axis='y', zorder=0)

ax1.set_ylabel(f"Solar Radiation ({a.attrs['UNITS']['solar_radiation']})", fontweight='bold')
ax1.set_title(f"{a.attrs['STID']} - {a.attrs['NAME']}", fontweight='bold')
ax1.set_ylim(ymin=0)


# Air Temperature
ax2 = plt.twinx(ax1)
p2 = ax2.plot(a.index.tz_localize(None), a.air_temp, color='tab:red', zorder=100, label='Temperature')

ax2.set_ylabel(f"Temperature ({a.attrs['UNITS']['air_temp'][0]})", fontweight='bold')
ax1.xaxis.set_major_formatter(DateFormatter("%d %b\n%Y"))
ax1.xaxis.set_major_locator(HourLocator([0]))
ax1.xaxis.set_minor_locator(HourLocator([12]))


# Kinda more work than I wanted to get both artists in the same legend...
ax1.legend([p1, p2[0]], [p1.get_label(), p2[0].get_label()])

fig.patch.set_facecolor('white')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13542059600150885, 'fraction_numerical': 0.03508110147114297, 'mean_word_length': 4.513513513513513, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '135925', 'license': 'MIT', 'n_tokens_mistral': 959, 'n_tokens_neox': 884, 'n_words': 226, 'path': 'notebooks/🌁 Pacific Grove Smoke 2020-09-09.ipynb', 'repo_name': 'blaylockbk/SynopticPy', 'size': '2659'}