Skip to content

Commit 83436e8

Browse files
committed
Return scalar on profile
1 parent 8e070a0 commit 83436e8

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/metpy/calc/thermo.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4622,8 +4622,8 @@ def galvez_davison_index(pressure, temperature, mixing_ratio, surface_pressure,
46224622
# Calculate adjusted equivalent potential temperatures
46234623
alpha = units.Quantity(-10, 'K')
46244624
eptp_a = th950 * np.exp(l_0 * r950 / (mpconsts.Cp_d * t850))
4625-
eptp_b = ((th850 + th700) / 2 *
4626-
np.exp(l_0 * (r850 + r700) / 2 / (mpconsts.Cp_d * t850)) + alpha)
4625+
eptp_b = ((th850 + th700) / 2
4626+
* np.exp(l_0 * (r850 + r700) / 2 / (mpconsts.Cp_d * t850)) + alpha)
46274627
eptp_c = th500 * np.exp(l_0 * r500 / (mpconsts.Cp_d * t850)) + alpha
46284628

46294629
# Calculate Column Buoyanci Index (CBI)
@@ -4661,10 +4661,15 @@ def galvez_davison_index(pressure, temperature, mixing_ratio, surface_pressure,
46614661
terrain_correction = 18 - 9000 / (surface_pressure.m_as('hPa') - 500)
46624662

46634663
# Calculate G.D.I.
4664-
return (column_buoyancy_index
4665-
+ mid_tropospheric_warming_index
4666-
+ inversion_index
4667-
+ terrain_correction)
4664+
gdi = (column_buoyancy_index
4665+
+ mid_tropospheric_warming_index
4666+
+ inversion_index
4667+
+ terrain_correction)
4668+
4669+
if gdi.size == 1:
4670+
return gdi[0]
4671+
else:
4672+
return gdi
46684673

46694674

46704675
@exporter.export

0 commit comments

Comments
 (0)