Skip to content

Commit

Permalink
Merge pull request #482 from NCAR/skewt_units
Browse files Browse the repository at this point in the history
Fix for skewt plots
  • Loading branch information
anissa111 committed Jul 29, 2022
2 parents abb92e7 + 50633c1 commit a36033b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Gallery/Skew-T/NCL_skewt_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@
skew.plot(p, parcel_prof, color='red', linestyle='--')
u = np.where(p >= 100 * units.hPa, u, np.nan)
v = np.where(p >= 100 * units.hPa, v, np.nan)
p = np.where(p >= 100 * units.hPa, p, np.nan)
p = np.where(ds[1].values >= 100, ds[1].values,
np.nan) # unitless for plot_barbs

# Add wind barbs
skew.plot_barbs(p[::2],
skew.plot_barbs(pressure=p[::2],
u=u[::2],
v=v[::2],
xloc=1.05,
Expand Down
2 changes: 1 addition & 1 deletion Gallery/Skew-T/NCL_skewt_3_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ds = pd.read_csv(gdf.get('ascii_files/sounding_ATS.csv'), header=None)

# Extract the data
p = ds[0].values * units.hPa # Pressure [mb/hPa]
p = ds[0].values # Pressure [mb/hPa] (unitless for plot_barbs)
tc = ds[1].values * units.degC # Temperature [C]
tdc = ds[2].values * units.degC # Dew pt temp [C]
wspd = ds[5].values * units.knots # Wind speed [knots or m/s]
Expand Down

0 comments on commit a36033b

Please sign in to comment.