pycontrails 0.54.3__cp313-cp313-macosx_11_0_arm64.whl → 0.54.5__cp313-cp313-macosx_11_0_arm64.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 +54 -29
- pycontrails/core/flight.py +218 -301
- pycontrails/core/interpolation.py +63 -60
- pycontrails/core/met.py +193 -125
- pycontrails/core/models.py +27 -13
- pycontrails/core/polygon.py +15 -15
- pycontrails/core/rgi_cython.cpython-313-darwin.so +0 -0
- pycontrails/core/vector.py +119 -96
- 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 +5 -5
- pycontrails/models/apcemm/utils.py +1 -1
- pycontrails/models/cocip/__init__.py +2 -2
- pycontrails/models/cocip/cocip.py +23 -24
- 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 +37 -96
- pycontrails/models/dry_advection.py +60 -19
- pycontrails/models/emissions/__init__.py +2 -2
- pycontrails/models/emissions/black_carbon.py +108 -108
- pycontrails/models/emissions/emissions.py +87 -87
- pycontrails/models/emissions/ffm2.py +35 -35
- pycontrails/models/humidity_scaling/humidity_scaling.py +23 -23
- pycontrails/models/issr.py +2 -2
- 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 +76 -66
- pycontrails/models/ps_model/ps_model.py +16 -16
- 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.5.dist-info}/METADATA +2 -2
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/NOTICE +1 -1
- pycontrails-0.54.5.dist-info/RECORD +111 -0
- pycontrails-0.54.3.dist-info/RECORD +0 -111
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/LICENSE +0 -0
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/WHEEL +0 -0
- {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/top_level.txt +0 -0
pycontrails/physics/geo.py
CHANGED
|
@@ -62,20 +62,20 @@ def haversine(lons0: ArrayLike, lats0: ArrayLike, lons1: ArrayLike, lats1: Array
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
def segment_haversine(
|
|
65
|
-
longitude: npt.NDArray[np.
|
|
66
|
-
) -> npt.NDArray[np.
|
|
65
|
+
longitude: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating]
|
|
66
|
+
) -> npt.NDArray[np.floating]:
|
|
67
67
|
r"""Calculate haversine distance between consecutive points along path.
|
|
68
68
|
|
|
69
69
|
Parameters
|
|
70
70
|
----------
|
|
71
|
-
longitude : npt.NDArray[np.
|
|
71
|
+
longitude : npt.NDArray[np.floating]
|
|
72
72
|
1D Longitude values with index corresponding to latitude inputs, [:math:`\deg`]
|
|
73
|
-
latitude : npt.NDArray[np.
|
|
73
|
+
latitude : npt.NDArray[np.floating]
|
|
74
74
|
1D Latitude values with index corresponding to longitude inputs, [:math:`\deg`]
|
|
75
75
|
|
|
76
76
|
Returns
|
|
77
77
|
-------
|
|
78
|
-
npt.NDArray[np.
|
|
78
|
+
npt.NDArray[np.floating]
|
|
79
79
|
Haversine distance between (lat_i, lon_i) and (lat_i+1, lon_i+1), [:math:`m`]
|
|
80
80
|
The final entry of the output is set to nan.
|
|
81
81
|
|
|
@@ -97,8 +97,8 @@ def segment_haversine(
|
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
def azimuth_to_direction(
|
|
100
|
-
azimuth_: npt.NDArray[np.
|
|
101
|
-
) -> tuple[npt.NDArray[np.
|
|
100
|
+
azimuth_: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating]
|
|
101
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
102
102
|
r"""Calculate rectangular direction from spherical azimuth.
|
|
103
103
|
|
|
104
104
|
This implementation uses the equation
|
|
@@ -109,14 +109,14 @@ def azimuth_to_direction(
|
|
|
109
109
|
|
|
110
110
|
Parameters
|
|
111
111
|
----------
|
|
112
|
-
azimuth_ : npt.NDArray[np.
|
|
112
|
+
azimuth_ : npt.NDArray[np.floating]
|
|
113
113
|
Angle measured clockwise from true north, [:math:`\deg`]
|
|
114
|
-
latitude : npt.NDArray[np.
|
|
114
|
+
latitude : npt.NDArray[np.floating]
|
|
115
115
|
Latitude value of the point, [:math:`\deg`]
|
|
116
116
|
|
|
117
117
|
Returns
|
|
118
118
|
-------
|
|
119
|
-
tuple[npt.NDArray[np.
|
|
119
|
+
tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]
|
|
120
120
|
A tuple of sine and cosine values.
|
|
121
121
|
"""
|
|
122
122
|
cos_lat = np.cos(units.degrees_to_radians(latitude))
|
|
@@ -138,22 +138,22 @@ def azimuth_to_direction(
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
def azimuth(
|
|
141
|
-
lons0: npt.NDArray[np.
|
|
142
|
-
lats0: npt.NDArray[np.
|
|
143
|
-
lons1: npt.NDArray[np.
|
|
144
|
-
lats1: npt.NDArray[np.
|
|
145
|
-
) -> npt.NDArray[np.
|
|
141
|
+
lons0: npt.NDArray[np.floating],
|
|
142
|
+
lats0: npt.NDArray[np.floating],
|
|
143
|
+
lons1: npt.NDArray[np.floating],
|
|
144
|
+
lats1: npt.NDArray[np.floating],
|
|
145
|
+
) -> npt.NDArray[np.floating]:
|
|
146
146
|
r"""Calculate angle relative to true north for set of coordinates.
|
|
147
147
|
|
|
148
148
|
Parameters
|
|
149
149
|
----------
|
|
150
|
-
lons0 : npt.NDArray[np.
|
|
150
|
+
lons0 : npt.NDArray[np.floating]
|
|
151
151
|
Longitude values of initial endpoints, [:math:`\deg`].
|
|
152
|
-
lats0 : npt.NDArray[np.
|
|
152
|
+
lats0 : npt.NDArray[np.floating]
|
|
153
153
|
Latitude values of initial endpoints, [:math:`\deg`].
|
|
154
|
-
lons1 : npt.NDArray[np.
|
|
154
|
+
lons1 : npt.NDArray[np.floating]
|
|
155
155
|
Longitude values of terminal endpoints, [:math:`\deg`].
|
|
156
|
-
lats1 : npt.NDArray[np.
|
|
156
|
+
lats1 : npt.NDArray[np.floating]
|
|
157
157
|
Latitude values of terminal endpoints, [:math:`\deg`].
|
|
158
158
|
|
|
159
159
|
References
|
|
@@ -162,7 +162,7 @@ def azimuth(
|
|
|
162
162
|
|
|
163
163
|
Returns
|
|
164
164
|
-------
|
|
165
|
-
npt.NDArray[np.
|
|
165
|
+
npt.NDArray[np.floating]
|
|
166
166
|
Azimuth relative to true north (:math:`0\deg`), [:math:`\deg`]
|
|
167
167
|
|
|
168
168
|
See Also
|
|
@@ -186,22 +186,22 @@ def azimuth(
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
def segment_azimuth(
|
|
189
|
-
longitude: npt.NDArray[np.
|
|
190
|
-
) -> npt.NDArray[np.
|
|
189
|
+
longitude: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating]
|
|
190
|
+
) -> npt.NDArray[np.floating]:
|
|
191
191
|
r"""Calculate the angle between coordinate segments and true north.
|
|
192
192
|
|
|
193
193
|
`np.nan` is added to the final value so the length of the output is the same as the inputs.
|
|
194
194
|
|
|
195
195
|
Parameters
|
|
196
196
|
----------
|
|
197
|
-
longitude : npt.NDArray[np.
|
|
197
|
+
longitude : npt.NDArray[np.floating]
|
|
198
198
|
Longitude values, [:math:`\deg`]
|
|
199
|
-
latitude : npt.NDArray[np.
|
|
199
|
+
latitude : npt.NDArray[np.floating]
|
|
200
200
|
Latitude values, [:math:`\deg`]
|
|
201
201
|
|
|
202
202
|
Returns
|
|
203
203
|
-------
|
|
204
|
-
npt.NDArray[np.
|
|
204
|
+
npt.NDArray[np.floating]
|
|
205
205
|
Azimuth relative to true north (:math:`0\deg`), [:math:`\deg`]
|
|
206
206
|
Final entry of each array is set to `np.nan`.
|
|
207
207
|
|
|
@@ -227,22 +227,22 @@ def segment_azimuth(
|
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
def longitudinal_angle(
|
|
230
|
-
lons0: npt.NDArray[np.
|
|
231
|
-
lats0: npt.NDArray[np.
|
|
232
|
-
lons1: npt.NDArray[np.
|
|
233
|
-
lats1: npt.NDArray[np.
|
|
234
|
-
) -> tuple[npt.NDArray[np.
|
|
230
|
+
lons0: npt.NDArray[np.floating],
|
|
231
|
+
lats0: npt.NDArray[np.floating],
|
|
232
|
+
lons1: npt.NDArray[np.floating],
|
|
233
|
+
lats1: npt.NDArray[np.floating],
|
|
234
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
235
235
|
r"""Calculate angle with longitudinal axis for sequence of segments.
|
|
236
236
|
|
|
237
237
|
Parameters
|
|
238
238
|
----------
|
|
239
|
-
lons0 : npt.NDArray[np.
|
|
239
|
+
lons0 : npt.NDArray[np.floating]
|
|
240
240
|
Longitude values of initial endpoints, [:math:`\deg`].
|
|
241
|
-
lats0 : npt.NDArray[np.
|
|
241
|
+
lats0 : npt.NDArray[np.floating]
|
|
242
242
|
Latitude values of initial endpoints, [:math:`\deg`].
|
|
243
|
-
lons1 : npt.NDArray[np.
|
|
243
|
+
lons1 : npt.NDArray[np.floating]
|
|
244
244
|
Longitude values of terminal endpoints, [:math:`\deg`].
|
|
245
|
-
lats1 : npt.NDArray[np.
|
|
245
|
+
lats1 : npt.NDArray[np.floating]
|
|
246
246
|
Latitude values of terminal endpoints, [:math:`\deg`].
|
|
247
247
|
|
|
248
248
|
References
|
|
@@ -251,9 +251,9 @@ def longitudinal_angle(
|
|
|
251
251
|
|
|
252
252
|
Returns
|
|
253
253
|
-------
|
|
254
|
-
sin_a : npt.NDArray[np.
|
|
254
|
+
sin_a : npt.NDArray[np.floating]
|
|
255
255
|
Sine values.
|
|
256
|
-
cos_a : npt.NDArray[np.
|
|
256
|
+
cos_a : npt.NDArray[np.floating]
|
|
257
257
|
Cosine values.
|
|
258
258
|
"""
|
|
259
259
|
lons0 = units.degrees_to_radians(lons0)
|
|
@@ -275,22 +275,22 @@ def longitudinal_angle(
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
def segment_angle(
|
|
278
|
-
longitude: npt.NDArray[np.
|
|
279
|
-
) -> tuple[npt.NDArray[np.
|
|
278
|
+
longitude: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating]
|
|
279
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
280
280
|
r"""Calculate the angle between coordinate segments and the longitudinal axis.
|
|
281
281
|
|
|
282
282
|
`np.nan` is added to the final value so the length of the output is the same as the inputs.
|
|
283
283
|
|
|
284
284
|
Parameters
|
|
285
285
|
----------
|
|
286
|
-
longitude : npt.NDArray[np.
|
|
286
|
+
longitude : npt.NDArray[np.floating]
|
|
287
287
|
Longitude values, [:math:`\deg`]
|
|
288
|
-
latitude : npt.NDArray[np.
|
|
288
|
+
latitude : npt.NDArray[np.floating]
|
|
289
289
|
Latitude values, [:math:`\deg`]
|
|
290
290
|
|
|
291
291
|
Returns
|
|
292
292
|
-------
|
|
293
|
-
tuple[npt.NDArray[np.
|
|
293
|
+
tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]
|
|
294
294
|
sin(a), cos(a), where ``a`` is the angle between the segment and the longitudinal axis.
|
|
295
295
|
Final entry of each array is set to `np.nan`.
|
|
296
296
|
|
|
@@ -332,10 +332,10 @@ def segment_angle(
|
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
def segment_length(
|
|
335
|
-
longitude: npt.NDArray[np.
|
|
336
|
-
latitude: npt.NDArray[np.
|
|
337
|
-
altitude: npt.NDArray[np.
|
|
338
|
-
) -> npt.NDArray[np.
|
|
335
|
+
longitude: npt.NDArray[np.floating],
|
|
336
|
+
latitude: npt.NDArray[np.floating],
|
|
337
|
+
altitude: npt.NDArray[np.floating],
|
|
338
|
+
) -> npt.NDArray[np.floating]:
|
|
339
339
|
r"""Calculate the segment length between coordinates by assuming a great circle distance.
|
|
340
340
|
|
|
341
341
|
Requires coordinates to be in EPSG:4326.
|
|
@@ -345,16 +345,16 @@ def segment_length(
|
|
|
345
345
|
|
|
346
346
|
Parameters
|
|
347
347
|
----------
|
|
348
|
-
longitude : npt.NDArray[np.
|
|
348
|
+
longitude : npt.NDArray[np.floating]
|
|
349
349
|
Longitude values, [:math:`\deg`]
|
|
350
|
-
latitude : npt.NDArray[np.
|
|
350
|
+
latitude : npt.NDArray[np.floating]
|
|
351
351
|
Latitude values, [:math:`\deg`]
|
|
352
|
-
altitude : npt.NDArray[np.
|
|
352
|
+
altitude : npt.NDArray[np.floating]
|
|
353
353
|
Altitude values, [:math:`m`]
|
|
354
354
|
|
|
355
355
|
Returns
|
|
356
356
|
-------
|
|
357
|
-
npt.NDArray[np.
|
|
357
|
+
npt.NDArray[np.floating]
|
|
358
358
|
Array of distances in [:math:`m`] between coordinates.
|
|
359
359
|
Final entry of each array is set to `np.nan`.
|
|
360
360
|
|
|
@@ -371,11 +371,11 @@ def segment_length(
|
|
|
371
371
|
|
|
372
372
|
|
|
373
373
|
def forward_azimuth(
|
|
374
|
-
lons: npt.NDArray[np.
|
|
375
|
-
lats: npt.NDArray[np.
|
|
376
|
-
az: npt.NDArray[np.
|
|
377
|
-
dist: npt.NDArray[np.
|
|
378
|
-
) -> tuple[npt.NDArray[np.
|
|
374
|
+
lons: npt.NDArray[np.floating],
|
|
375
|
+
lats: npt.NDArray[np.floating],
|
|
376
|
+
az: npt.NDArray[np.floating] | float,
|
|
377
|
+
dist: npt.NDArray[np.floating] | float,
|
|
378
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
379
379
|
r"""Calculate coordinates along forward azimuth.
|
|
380
380
|
|
|
381
381
|
This function is identical to the `pyproj.Geod.fwd` method when working on
|
|
@@ -384,19 +384,19 @@ def forward_azimuth(
|
|
|
384
384
|
|
|
385
385
|
Parameters
|
|
386
386
|
----------
|
|
387
|
-
lons : npt.NDArray[np.
|
|
387
|
+
lons : npt.NDArray[np.floating]
|
|
388
388
|
Array of longitude values.
|
|
389
|
-
lats : npt.NDArray[np.
|
|
389
|
+
lats : npt.NDArray[np.floating]
|
|
390
390
|
Array of latitude values.
|
|
391
|
-
az : npt.NDArray[np.
|
|
391
|
+
az : npt.NDArray[np.floating] | float
|
|
392
392
|
Azimuth, measured in [:math:`\deg`].
|
|
393
|
-
dist : npt.NDArray[np.
|
|
393
|
+
dist : npt.NDArray[np.floating] | float
|
|
394
394
|
Distance [:math:`m`] between initial longitude latitude values and
|
|
395
395
|
point to be computed.
|
|
396
396
|
|
|
397
397
|
Returns
|
|
398
398
|
-------
|
|
399
|
-
tuple[npt.NDArray[np.
|
|
399
|
+
tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]
|
|
400
400
|
Tuple of longitude latitude arrays.
|
|
401
401
|
|
|
402
402
|
See Also
|
|
@@ -1010,7 +1010,7 @@ def advect_horizontal(
|
|
|
1010
1010
|
|
|
1011
1011
|
|
|
1012
1012
|
def spatial_bounding_box(
|
|
1013
|
-
longitude: npt.NDArray[np.
|
|
1013
|
+
longitude: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating], buffer: float = 1.0
|
|
1014
1014
|
) -> tuple[float, float, float, float]:
|
|
1015
1015
|
r"""
|
|
1016
1016
|
Construct rectangular spatial bounding box from a set of waypoints.
|
|
@@ -1073,17 +1073,17 @@ def domain_surface_area(
|
|
|
1073
1073
|
|
|
1074
1074
|
|
|
1075
1075
|
def grid_surface_area(
|
|
1076
|
-
longitude: npt.NDArray[np.
|
|
1076
|
+
longitude: npt.NDArray[np.floating], latitude: npt.NDArray[np.floating]
|
|
1077
1077
|
) -> xr.DataArray:
|
|
1078
1078
|
r"""
|
|
1079
1079
|
Calculate surface area that is covered by each pixel in a longitude-latitude grid.
|
|
1080
1080
|
|
|
1081
1081
|
Parameters
|
|
1082
1082
|
----------
|
|
1083
|
-
longitude: npt.NDArray[np.
|
|
1083
|
+
longitude: npt.NDArray[np.floating]
|
|
1084
1084
|
Longitude coordinates in a longitude-latitude grid, [:math:`\deg`].
|
|
1085
1085
|
Must be in ascending order.
|
|
1086
|
-
latitude: npt.NDArray[np.
|
|
1086
|
+
latitude: npt.NDArray[np.floating]
|
|
1087
1087
|
Latitude coordinates in a longitude-latitude grid, [:math:`\deg`].
|
|
1088
1088
|
Must be in ascending order.
|
|
1089
1089
|
|
|
@@ -1119,19 +1119,19 @@ def grid_surface_area(
|
|
|
1119
1119
|
|
|
1120
1120
|
|
|
1121
1121
|
def _area_between_latitude_and_north_pole(
|
|
1122
|
-
latitude: npt.NDArray[np.
|
|
1123
|
-
) -> npt.NDArray[np.
|
|
1122
|
+
latitude: npt.NDArray[np.floating],
|
|
1123
|
+
) -> npt.NDArray[np.floating]:
|
|
1124
1124
|
r"""
|
|
1125
1125
|
Calculate surface area from the provided latitude to the North Pole.
|
|
1126
1126
|
|
|
1127
1127
|
Parameters
|
|
1128
1128
|
----------
|
|
1129
|
-
latitude: npt.NDArray[np.
|
|
1129
|
+
latitude: npt.NDArray[np.floating]
|
|
1130
1130
|
1D Latitude values with index corresponding to latitude inputs, [:math:`\deg`]
|
|
1131
1131
|
|
|
1132
1132
|
Returns
|
|
1133
1133
|
-------
|
|
1134
|
-
npt.NDArray[np.
|
|
1134
|
+
npt.NDArray[np.floating]
|
|
1135
1135
|
Surface area from latitude to North Pole, [:math:`m^{2}`]
|
|
1136
1136
|
"""
|
|
1137
1137
|
lat_radians = units.degrees_to_radians(latitude)
|