Last active
April 6, 2021 17:01
-
-
Save tommylees112/e6f7278ae063563d3831e039f68a83b4 to your computer and use it in GitHub Desktop.
example script for loading in pandas csv file and a very basic SkewT plot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
from pathlib import Path | |
# make sure the data is loaded | |
data_dir = Path("/Users/tommylees/Downloads") | |
df = pd.read_csv(data_dir / "demo_sonde.csv", index_col=0) | |
# initialise plot | |
f, ax = plt.subplots() | |
ax.plot(df.temperature, df.pressure, label="Temperature") | |
ax.plot(df.dewpoint, df.pressure, label="Dewpoint") | |
ax.plot(df.parcel_profile, df.pressure, label="Parcel Lapse Rate", color="k") | |
# additional plot niceities | |
plt.legend() | |
ax.invert_yaxis() | |
ax.set_xlabel("Temperature [$^oC$]") | |
ax.set_ylabel("Pressure [hPa]") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment