Skip to content

Commit

Permalink
update HiLo script
Browse files Browse the repository at this point in the history
  • Loading branch information
MethaneRain committed Oct 7, 2020
1 parent 8c8c592 commit 1c70999
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions HiLo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ def plot_maxmin_points(ax,lon, lat, data, extrema, nsize, symbol,color='k', outl
outline_width=2.5, press_spacing=0.66,plotValue=True, transform=None):

"""
ax argument allows for sending current axis to the HiLo plot
Path effects on the symbols and pressure readings - outline them in black (default) with linewidth
2.5 (default) to make them pop a bit more. The press_spacing (0.66 default) is based off latitude and helps
ax argument allows for sending current axis to the HiLo plot
Path effects on the symbols and pressure readings - outline them in black (default) with linewidth
2.5 (default) to make them pop a bit more. The press_spacing (0.66 default) is based off latitude and helps
serarate the pressure reading and the symbol with the outline effects making them overlap.
This function will find and plot relative maximum and minimum for a 2D grid. The function
can be used to plot an H for maximum values (e.g., High pressure) and an L for minimum
values (e.g., low pressue). It is best to used filetered data to obtain a synoptic scale
Expand Down Expand Up @@ -41,9 +41,8 @@ def plot_maxmin_points(ax,lon, lat, data, extrema, nsize, symbol,color='k', outl
data_ext = minimum_filter(data, nsize, mode='nearest')
else:
raise ValueError('Value for hilo must be either max or min')

mxy, mxx = np.where(data_ext == data)
#print(mxy,mxx)

for i in range(len(mxy)):
A = ax.text(lon[mxy[i], mxx[i]], lat[mxy[i], mxx[i]], symbol, color=color, size=24,
Expand All @@ -55,5 +54,3 @@ def plot_maxmin_points(ax,lon, lat, data, extrema, nsize, symbol,color='k', outl
color=color, size=12, clip_on=True, fontweight='bold',
horizontalalignment='center', verticalalignment='top', transform=transform)
B.set_path_effects(outline_effect)


0 comments on commit 1c70999

Please sign in to comment.