kylejgillett / sounderpy

A python package that helps you to access and plot vertical profile data for meteorological analysis
https://kylejgillett.github.io/sounderpy/
MIT License
47 stars 12 forks source link

Hodograph plots w/ incorrect MLCAPE displayed #22

Closed AstroCGHA closed 3 months ago

AstroCGHA commented 3 months ago

The spy.build_hodograph() gives you a rundown to the thermodynamic and kinematic parameters associated with the sounding profile requested. But the Mixed-layer CAPE unfortunately 'displays' the incorrect numbers. Upon digging the code, culprit is at lines 2300-2304 of plot.py.

MLCAPE

plt.figtext( 0.815, 0.56,  f'ML:', weight='bold', fontsize=15, color=gen_txt_clr)
plt.figtext( 0.86, 0.56,   f"{mag(thermo['mu_ecape'])} J/kg", fontsize=15, color='darkred', weight='bold')
plt.figtext( 0.95, 0.56,    f"{mag(thermo['mucape'])} J/kg",  fontsize=15, color='darkred', weight='bold')
plt.figtext( 1.035, 0.56,   f"{mag(thermo['mu6cape'])} J/kg", fontsize=15, color='darkred', weight='bold')
plt.figtext( 1.116, 0.56,   f"{mag(thermo['mu3cape'])} J/kg", fontsize=15, color='darkred', weight='bold')

Checking other lines, it will likely be;

MLCAPE (Corrected)

plt.figtext( 0.815, 0.56,  f'ML:', weight='bold', fontsize=15, color=gen_txt_clr)
plt.figtext( 0.86, 0.56,   f"{mag(thermo['ml_ecape'])} J/kg", fontsize=15, color='darkred', weight='bold')
plt.figtext( 0.95, 0.56,    f"{mag(thermo['mlcape'])} J/kg",  fontsize=15, color='darkred', weight='bold')
plt.figtext( 1.035, 0.56,   f"{mag(thermo['ml6cape'])} J/kg", fontsize=15, color='darkred', weight='bold')
plt.figtext( 1.116, 0.56,   f"{mag(thermo['ml3cape'])} J/kg", fontsize=15, color='darkred', weight='bold')

This is likely just a simple/small patch up in a future version.

kylejgillett commented 3 months ago

Nice catch @AstroCGHA! Thanks!

That error has been patched and was just published in v3.0.3 which patches a couple of other minor bugs.