pycontrails 0.54.3__cp313-cp313-win_amd64.whl → 0.54.4__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pycontrails might be problematic. Click here for more details.
- pycontrails/__init__.py +2 -2
- pycontrails/_version.py +2 -2
- pycontrails/core/__init__.py +1 -1
- pycontrails/core/aircraft_performance.py +58 -58
- pycontrails/core/cache.py +7 -7
- pycontrails/core/fleet.py +25 -21
- pycontrails/core/flight.py +213 -301
- pycontrails/core/interpolation.py +56 -56
- pycontrails/core/met.py +48 -39
- pycontrails/core/models.py +25 -11
- pycontrails/core/polygon.py +15 -15
- pycontrails/core/rgi_cython.cp313-win_amd64.pyd +0 -0
- pycontrails/core/vector.py +22 -22
- pycontrails/datalib/_met_utils/metsource.py +8 -5
- pycontrails/datalib/ecmwf/__init__.py +14 -14
- pycontrails/datalib/ecmwf/common.py +1 -1
- pycontrails/datalib/ecmwf/era5.py +7 -7
- pycontrails/datalib/ecmwf/hres.py +3 -3
- pycontrails/datalib/ecmwf/ifs.py +1 -1
- pycontrails/datalib/gfs/__init__.py +6 -6
- pycontrails/datalib/gfs/gfs.py +2 -2
- pycontrails/datalib/goes.py +5 -5
- pycontrails/ext/empirical_grid.py +1 -1
- pycontrails/models/apcemm/apcemm.py +3 -3
- pycontrails/models/cocip/__init__.py +2 -2
- pycontrails/models/cocip/cocip.py +15 -15
- pycontrails/models/cocip/cocip_params.py +2 -11
- pycontrails/models/cocip/cocip_uncertainty.py +24 -18
- pycontrails/models/cocip/contrail_properties.py +331 -316
- pycontrails/models/cocip/output_formats.py +53 -53
- pycontrails/models/cocip/radiative_forcing.py +135 -131
- pycontrails/models/cocip/radiative_heating.py +135 -135
- pycontrails/models/cocip/unterstrasser_wake_vortex.py +90 -87
- pycontrails/models/cocip/wake_vortex.py +92 -92
- pycontrails/models/cocip/wind_shear.py +8 -8
- pycontrails/models/cocipgrid/cocip_grid.py +93 -87
- pycontrails/models/dry_advection.py +10 -5
- pycontrails/models/emissions/__init__.py +2 -2
- pycontrails/models/emissions/black_carbon.py +108 -108
- pycontrails/models/emissions/emissions.py +85 -85
- pycontrails/models/emissions/ffm2.py +35 -35
- pycontrails/models/humidity_scaling/humidity_scaling.py +23 -23
- pycontrails/models/ps_model/__init__.py +1 -1
- pycontrails/models/ps_model/ps_aircraft_params.py +8 -4
- pycontrails/models/ps_model/ps_grid.py +74 -64
- pycontrails/models/ps_model/ps_model.py +14 -14
- pycontrails/models/ps_model/ps_operational_limits.py +20 -18
- pycontrails/models/tau_cirrus.py +8 -1
- pycontrails/physics/geo.py +67 -67
- pycontrails/physics/jet.py +79 -79
- pycontrails/physics/units.py +14 -14
- pycontrails/utils/json.py +1 -2
- pycontrails/utils/types.py +12 -7
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.4.dist-info}/METADATA +2 -2
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.4.dist-info}/NOTICE +1 -1
- pycontrails-0.54.4.dist-info/RECORD +111 -0
- pycontrails-0.54.3.dist-info/RECORD +0 -111
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.4.dist-info}/LICENSE +0 -0
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.4.dist-info}/WHEEL +0 -0
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.4.dist-info}/top_level.txt +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import dataclasses
|
|
5
6
|
import logging
|
|
6
|
-
from dataclasses import asdict, dataclass
|
|
7
7
|
from typing import Any, ClassVar
|
|
8
8
|
|
|
9
9
|
import numpy as np
|
|
@@ -70,7 +70,7 @@ class habit_dirichlet(rv_frozen):
|
|
|
70
70
|
return habit_weights
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
@dataclass
|
|
73
|
+
@dataclasses.dataclass
|
|
74
74
|
class CocipUncertaintyParams(CocipParams):
|
|
75
75
|
"""Model parameters for CoCiP epistemic uncertainty.
|
|
76
76
|
|
|
@@ -117,26 +117,30 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
117
117
|
#: Schumann takes ``wind_shear_enhancement_exponent`` = 0.5 and discusses the case of 0 and 2/3
|
|
118
118
|
#: as possibilities.
|
|
119
119
|
#: With a value of 0, wind shear is not enhanced.
|
|
120
|
-
wind_shear_enhancement_exponent_uncertainty: rv_frozen | None =
|
|
121
|
-
|
|
120
|
+
wind_shear_enhancement_exponent_uncertainty: rv_frozen | None = dataclasses.field(
|
|
121
|
+
default_factory=lambda: stats.triang(
|
|
122
|
+
loc=0.0, c=CocipParams.wind_shear_enhancement_exponent, scale=1.0
|
|
123
|
+
)
|
|
122
124
|
)
|
|
123
125
|
|
|
124
126
|
#: Schumann takes ``initial_wake_vortex_depth`` = 0.5 and discusses some
|
|
125
127
|
#: uncertainty in this value. This parameter should be non-negative.
|
|
126
|
-
initial_wake_vortex_depth_uncertainty: rv_frozen | None =
|
|
127
|
-
|
|
128
|
+
initial_wake_vortex_depth_uncertainty: rv_frozen | None = dataclasses.field(
|
|
129
|
+
default_factory=lambda: stats.triang(
|
|
130
|
+
loc=0.3, c=CocipParams.initial_wake_vortex_depth, scale=0.4
|
|
131
|
+
)
|
|
128
132
|
)
|
|
129
133
|
|
|
130
134
|
#: Schumann takes a default value of 0.1 and describes it as an "important adjustable parameter"
|
|
131
135
|
#: Currently, `CocipParams` uses a default value of 0.5
|
|
132
|
-
sedimentation_impact_factor_uncertainty: rv_frozen | None =
|
|
133
|
-
loc=CocipParams.sedimentation_impact_factor, scale=0.1
|
|
136
|
+
sedimentation_impact_factor_uncertainty: rv_frozen | None = dataclasses.field(
|
|
137
|
+
default_factory=lambda: stats.norm(loc=CocipParams.sedimentation_impact_factor, scale=0.1)
|
|
134
138
|
)
|
|
135
139
|
|
|
136
140
|
#: Teoh 2022 (to appear) takes values between 70% decrease and 100% increase.
|
|
137
141
|
#: This coincides with the log normal distribution defined below.
|
|
138
|
-
nvpm_ei_n_enhancement_factor_uncertainty: rv_frozen | None =
|
|
139
|
-
s=0.15, scale=1 / stats.lognorm(s=0.15).mean()
|
|
142
|
+
nvpm_ei_n_enhancement_factor_uncertainty: rv_frozen | None = dataclasses.field(
|
|
143
|
+
default_factory=lambda: stats.lognorm(s=0.15, scale=1 / stats.lognorm(s=0.15).mean())
|
|
140
144
|
)
|
|
141
145
|
|
|
142
146
|
#: Scale shortwave radiative forcing.
|
|
@@ -145,8 +149,8 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
145
149
|
#: by `libRadTran <http://www.libradtran.org/doku.php>`_.
|
|
146
150
|
#: We use the average RMS error across all habit types (pg 1397) as the standard deviation
|
|
147
151
|
#: of a normally distributed scaling factor for SW forcing
|
|
148
|
-
rf_sw_enhancement_factor_uncertainty: rv_frozen | None =
|
|
149
|
-
loc=CocipParams.rf_sw_enhancement_factor, scale=0.106
|
|
152
|
+
rf_sw_enhancement_factor_uncertainty: rv_frozen | None = dataclasses.field(
|
|
153
|
+
default_factory=lambda: stats.norm(loc=CocipParams.rf_sw_enhancement_factor, scale=0.106)
|
|
150
154
|
)
|
|
151
155
|
|
|
152
156
|
#: Scale longwave radiative forcing.
|
|
@@ -154,8 +158,8 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
154
158
|
#: fit to the data generated by `libRadTran <http://www.libradtran.org/doku.php>`_.
|
|
155
159
|
#: We use the average RMS error across all habit types (pg 1397) as the standard deviation
|
|
156
160
|
#: of a normally distributed scaling factor for LW forcing.
|
|
157
|
-
rf_lw_enhancement_factor_uncertainty: rv_frozen | None =
|
|
158
|
-
loc=CocipParams.rf_lw_enhancement_factor, scale=0.071
|
|
161
|
+
rf_lw_enhancement_factor_uncertainty: rv_frozen | None = dataclasses.field(
|
|
162
|
+
default_factory=lambda: stats.norm(loc=CocipParams.rf_lw_enhancement_factor, scale=0.071)
|
|
159
163
|
)
|
|
160
164
|
|
|
161
165
|
#: Scale the habit distributions by a dirichlet distribution
|
|
@@ -163,7 +167,9 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
163
167
|
#: where :math:`\text{G}_{i}` is the approximate habit weight distributions
|
|
164
168
|
#: defined in :attr:`CocipParams().habit_distributions`.
|
|
165
169
|
#: Higher values of :math:`\text{C}` correspond to higher confidence in initial estimates.
|
|
166
|
-
habit_distributions_uncertainty: rv_frozen | None =
|
|
170
|
+
habit_distributions_uncertainty: rv_frozen | None = dataclasses.field(
|
|
171
|
+
default_factory=habit_dirichlet
|
|
172
|
+
)
|
|
167
173
|
|
|
168
174
|
def __post_init__(self) -> None:
|
|
169
175
|
"""Override values of model parameters according to ranges."""
|
|
@@ -192,7 +198,7 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
192
198
|
|
|
193
199
|
out = {}
|
|
194
200
|
|
|
195
|
-
param_dict = asdict(self)
|
|
201
|
+
param_dict = dataclasses.asdict(self)
|
|
196
202
|
for uncertainty_param, dist in param_dict.items():
|
|
197
203
|
if uncertainty_param.endswith("_uncertainty") and dist is not None:
|
|
198
204
|
param = uncertainty_param.split("_uncertainty")[0]
|
|
@@ -212,7 +218,7 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
212
218
|
|
|
213
219
|
return out
|
|
214
220
|
|
|
215
|
-
def rvs(self, size: None | int = None) -> dict[str, np.float64 | npt.NDArray[np.
|
|
221
|
+
def rvs(self, size: None | int = None) -> dict[str, np.float64 | npt.NDArray[np.floating]]:
|
|
216
222
|
"""Call each distribution's `rvs` method to generate random parameters.
|
|
217
223
|
|
|
218
224
|
Seed calls to `rvs` with class variable `rng`.
|
|
@@ -224,7 +230,7 @@ class CocipUncertaintyParams(CocipParams):
|
|
|
224
230
|
|
|
225
231
|
Returns
|
|
226
232
|
-------
|
|
227
|
-
dict[str, float | npt.NDArray[np.
|
|
233
|
+
dict[str, float | npt.NDArray[np.floating]]
|
|
228
234
|
Dictionary of random parameters. Dictionary keys consists of names of parameters in
|
|
229
235
|
`CocipParams` to be overridden by random value.
|
|
230
236
|
|