Base
convection_neutral_profile(temp_start, p_start, temp_lcl, p_levels)
This returns the temperature of an air parcel at the given pressure levels, assuming it follows the
dry_profile up until the lcl_temp has been reached, followed by the moist_profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_start
|
float
|
Starting temperature of parcel. Units: Kelvin. |
required |
p_start
|
float
|
Starting pressure of parcel. Units: Pa. |
required |
temp_lcl
|
float
|
Temperature of LCL in K. |
required |
p_levels
|
ndarray
|
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in isca_tools/convection/base.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
dry_profile_pressure(temp_start, p_start, temp_levels)
Given a series of temp_levels, this function returns the pressure corresponding to each temperature, assuming
it follows a dry adiabat.
Can also use the pressure of the LCL if the LCL temperature is given as temp_levels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_start
|
float
|
Starting temperature of parcel. Units: Kelvin. |
required |
p_start
|
float
|
Starting pressure of parcel. Units: Pa. |
required |
temp_levels
|
Union[float, ndarray]
|
|
required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray]
|
|
Source code in isca_tools/convection/base.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
dry_profile_temp(temp_start, p_start, p_levels)
Returns the temperature of an air parcel at the given pressure levels, assuming it follows the dry adiabat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_start
|
float
|
Starting temperature of parcel. Units: Kelvin. |
required |
p_start
|
float
|
Starting pressure of parcel. Units: Pa. |
required |
p_levels
|
ndarray
|
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in isca_tools/convection/base.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
equivalent_potential_temp(temp, pressure, sphum=None, p_ref=100000.0)
Returns the virtual potential temperature using equation 9.40 of Holton 2004 textbook.
For a saturated parcel, this is \(\theta_e = \theta \exp (L_v q_s/c_pT)\).
For an unsaturated parcel (used if sphum given), it is \(\theta_e = \theta \exp (L_v q/c_pT_{LCL})\).
where \(q\) (\(q_s\)) is the (saturation) mixing ratio, \(T_{LCL}\) is the lifting condensation level temperature (using equation 10 from Bolton 1980) and \(\theta\) is the potential temperature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp
|
Union[float, ndarray]
|
|
required |
pressure
|
Union[float, ndarray]
|
|
required |
sphum
|
Optional[float]
|
|
None
|
p_ref
|
float
|
Reference pressure in Pa used to compute the potential temperature |
100000.0
|
Returns:
| Type | Description |
|---|---|
Union[float, ndarray]
|
|
Source code in isca_tools/convection/base.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
lapse_moist(temp, total_pressure, pressure_coords=False)
Returns the saturated moist adiabatic lapse rate, \(\Gamma_s = -dT/dz\), at a given temperature.
Comes from equation D.10 in Holton 2004.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp
|
Union[float, ndarray]
|
Temperature to compute lapse rate at. Units: Kelvin. |
required |
total_pressure
|
Union[float, ndarray]
|
Atmospheric pressure at altitude considered, \(p\), in Pa. |
required |
pressure_coords
|
bool
|
If |
False
|
Returns: Saturated moist adiabatic lapse rate. Units: \(Km^{-1}\).
Source code in isca_tools/convection/base.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
lcl_metpy(temp_2m, sphum_2m, pressure_surf)
Returns the pressure and temperature of the lifting condensation level, LCL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_2m
|
Union[float, ndarray, DataArray]
|
Near-surface (2m) air temperature in Kelvin. |
required |
sphum_2m
|
Union[float, ndarray, DataArray]
|
Near-surface (2m) specific humidity in kg/kg. |
required |
pressure_surf
|
Union[float, ndarray, DataArray]
|
Surface pressure in Pa. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
p_lcl |
Union[float, ndarray, DataArray]
|
LCL pressure in Pa. |
temp_lcl |
Union[float, ndarray, DataArray]
|
LCL temperature in Kelvin. |
Source code in isca_tools/convection/base.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
lcl_sigma_bolton_simple(rh_surf, temp_surf=280)
Computes a simple relationship for \(p_{LCL}/p_s\) as a function of surface relative humidity, \(r_s\), starting from Equation 22 in Bolton 1980. The final equation is:
where \(\alpha = \frac{c_p}{2840 R} \frac{(T_s - 55)^2}{T_s}\) and \(T_s\) is surface temperature. The dependence on surface temperature is weak, so recommend just providing a reasonable guess, so LCL variation is then just in terms of relative humidity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rh_surf
|
Union[float, ndarray, DataArray]
|
Surface relative humidity (\(0 < rh < 1\)). |
required |
temp_surf
|
Union[float, ndarray, DataArray]
|
Surface temperature used in calculation. Exact value is not important. |
280
|
Returns:
| Name | Type | Description |
|---|---|---|
sigma_lcl |
ndarray
|
Approximate value of \(p_{LCL}/p_s\). |
Source code in isca_tools/convection/base.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
lcl_temp_bolton(temp_surf, rh_surf)
Returns the temperature of the lifting condensation level, LCL, given the surface temperature and relative humidity.
Equation comes from Equation 22 in Bolton 1980.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_surf
|
Union[float, ndarray, DataArray]
|
Surface temperature in Kelvin. |
required |
rh_surf
|
Union[float, ndarray, DataArray]
|
Percentage surface relative humidity (\(0 < rh < 100\)). |
required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray, DataArray]
|
Temperature of LCL in Kelvin. |
Source code in isca_tools/convection/base.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
moist_profile(temp_start, p_start, p_levels)
Returns the temperature of an air parcel at the given pressure levels, assuming it follows the saturated moist adiabat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp_start
|
float
|
Starting temperature of parcel. Units: Kelvin. |
required |
p_start
|
float
|
Starting pressure of parcel. Units: Pa. |
required |
p_levels
|
ndarray
|
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
ndarray
|
Temperature at each pressure level indicated by |
Source code in isca_tools/convection/base.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
potential_temp(temp, pressure, p_ref=100000.0)
Returns the potential temperature: \(\theta = T\left(\frac{p_{ref}}{p}\right)^{\kappa}\)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temp
|
Union[float, ndarray]
|
|
required |
pressure
|
Union[float, ndarray]
|
|
required |
p_ref
|
float
|
Reference pressure in Pa used to compute the potential temperature |
100000.0
|
Returns:
| Type | Description |
|---|---|
Union[float, ndarray]
|
|
Source code in isca_tools/convection/base.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |