pycontrails 0.54.3__cp310-cp310-macosx_11_0_arm64.whl → 0.54.5__cp310-cp310-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.

Files changed (62) hide show
  1. pycontrails/__init__.py +2 -2
  2. pycontrails/_version.py +2 -2
  3. pycontrails/core/__init__.py +1 -1
  4. pycontrails/core/aircraft_performance.py +58 -58
  5. pycontrails/core/cache.py +7 -7
  6. pycontrails/core/fleet.py +54 -29
  7. pycontrails/core/flight.py +218 -301
  8. pycontrails/core/interpolation.py +63 -60
  9. pycontrails/core/met.py +193 -125
  10. pycontrails/core/models.py +27 -13
  11. pycontrails/core/polygon.py +15 -15
  12. pycontrails/core/rgi_cython.cpython-310-darwin.so +0 -0
  13. pycontrails/core/vector.py +119 -96
  14. pycontrails/datalib/_met_utils/metsource.py +8 -5
  15. pycontrails/datalib/ecmwf/__init__.py +14 -14
  16. pycontrails/datalib/ecmwf/common.py +1 -1
  17. pycontrails/datalib/ecmwf/era5.py +7 -7
  18. pycontrails/datalib/ecmwf/hres.py +3 -3
  19. pycontrails/datalib/ecmwf/ifs.py +1 -1
  20. pycontrails/datalib/gfs/__init__.py +6 -6
  21. pycontrails/datalib/gfs/gfs.py +2 -2
  22. pycontrails/datalib/goes.py +5 -5
  23. pycontrails/ext/empirical_grid.py +1 -1
  24. pycontrails/models/apcemm/apcemm.py +5 -5
  25. pycontrails/models/apcemm/utils.py +1 -1
  26. pycontrails/models/cocip/__init__.py +2 -2
  27. pycontrails/models/cocip/cocip.py +23 -24
  28. pycontrails/models/cocip/cocip_params.py +2 -11
  29. pycontrails/models/cocip/cocip_uncertainty.py +24 -18
  30. pycontrails/models/cocip/contrail_properties.py +331 -316
  31. pycontrails/models/cocip/output_formats.py +53 -53
  32. pycontrails/models/cocip/radiative_forcing.py +135 -131
  33. pycontrails/models/cocip/radiative_heating.py +135 -135
  34. pycontrails/models/cocip/unterstrasser_wake_vortex.py +90 -87
  35. pycontrails/models/cocip/wake_vortex.py +92 -92
  36. pycontrails/models/cocip/wind_shear.py +8 -8
  37. pycontrails/models/cocipgrid/cocip_grid.py +37 -96
  38. pycontrails/models/dry_advection.py +60 -19
  39. pycontrails/models/emissions/__init__.py +2 -2
  40. pycontrails/models/emissions/black_carbon.py +108 -108
  41. pycontrails/models/emissions/emissions.py +87 -87
  42. pycontrails/models/emissions/ffm2.py +35 -35
  43. pycontrails/models/humidity_scaling/humidity_scaling.py +23 -23
  44. pycontrails/models/issr.py +2 -2
  45. pycontrails/models/ps_model/__init__.py +1 -1
  46. pycontrails/models/ps_model/ps_aircraft_params.py +8 -4
  47. pycontrails/models/ps_model/ps_grid.py +76 -66
  48. pycontrails/models/ps_model/ps_model.py +16 -16
  49. pycontrails/models/ps_model/ps_operational_limits.py +20 -18
  50. pycontrails/models/tau_cirrus.py +8 -1
  51. pycontrails/physics/geo.py +67 -67
  52. pycontrails/physics/jet.py +79 -79
  53. pycontrails/physics/units.py +14 -14
  54. pycontrails/utils/json.py +1 -2
  55. pycontrails/utils/types.py +12 -7
  56. {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/METADATA +2 -2
  57. {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/NOTICE +1 -1
  58. pycontrails-0.54.5.dist-info/RECORD +111 -0
  59. pycontrails-0.54.3.dist-info/RECORD +0 -111
  60. {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/LICENSE +0 -0
  61. {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/WHEEL +0 -0
  62. {pycontrails-0.54.3.dist-info → pycontrails-0.54.5.dist-info}/top_level.txt +0 -0
@@ -26,15 +26,15 @@ from pycontrails.physics import constants, thermo
26
26
 
27
27
 
28
28
  def ice_particle_number_survival_fraction(
29
- air_temperature: npt.NDArray[np.float64],
30
- rhi_0: npt.NDArray[np.float64],
31
- ei_h2o: npt.NDArray[np.float64] | float,
32
- wingspan: npt.NDArray[np.float64] | float,
33
- true_airspeed: npt.NDArray[np.float64],
34
- fuel_flow: npt.NDArray[np.float64],
35
- aei_n: npt.NDArray[np.float64],
36
- z_desc: npt.NDArray[np.float64],
37
- ) -> npt.NDArray[np.float64]:
29
+ air_temperature: npt.NDArray[np.floating],
30
+ rhi_0: npt.NDArray[np.floating],
31
+ ei_h2o: npt.NDArray[np.floating] | float,
32
+ wingspan: npt.NDArray[np.floating] | float,
33
+ true_airspeed: npt.NDArray[np.floating],
34
+ fuel_flow: npt.NDArray[np.floating],
35
+ aei_n: npt.NDArray[np.floating],
36
+ z_desc: npt.NDArray[np.floating],
37
+ ) -> npt.NDArray[np.floating]:
38
38
  r"""
39
39
  Calculate fraction of ice particle number surviving the wake vortex phase and required inputs.
40
40
 
@@ -44,27 +44,27 @@ def ice_particle_number_survival_fraction(
44
44
 
45
45
  Parameters
46
46
  ----------
47
- air_temperature : npt.NDArray[np.float64]
47
+ air_temperature : npt.NDArray[np.floating]
48
48
  ambient temperature for each waypoint, [:math:`K`]
49
- rhi_0: npt.NDArray[np.float64]
49
+ rhi_0: npt.NDArray[np.floating]
50
50
  Relative humidity with respect to ice at the flight waypoint
51
- ei_h2o : npt.NDArray[np.float64] | float
51
+ ei_h2o : npt.NDArray[np.floating] | float
52
52
  Emission index of water vapor, [:math:`kg \ kg^{-1}`]
53
- wingspan : npt.NDArray[np.float64] | float
53
+ wingspan : npt.NDArray[np.floating] | float
54
54
  aircraft wingspan, [:math:`m`]
55
- true_airspeed : npt.NDArray[np.float64]
55
+ true_airspeed : npt.NDArray[np.floating]
56
56
  true airspeed for each waypoint, [:math:`m s^{-1}`]
57
- fuel_flow : npt.NDArray[np.float64]
57
+ fuel_flow : npt.NDArray[np.floating]
58
58
  Fuel mass flow rate, [:math:`kg s^{-1}`]
59
- aei_n : npt.NDArray[np.float64]
59
+ aei_n : npt.NDArray[np.floating]
60
60
  Apparent ice crystal number emissions index at contrail formation, [:math:`kg^{-1}`]
61
- z_desc : npt.NDArray[np.float64]
61
+ z_desc : npt.NDArray[np.floating]
62
62
  Final vertical displacement of the wake vortex, ``dz_max`` in :mod:`wake_vortex.py`,
63
63
  [:math:`m`].
64
64
 
65
65
  Returns
66
66
  -------
67
- npt.NDArray[np.float64]
67
+ npt.NDArray[np.floating]
68
68
  Fraction of contrail ice particle number that survive the wake vortex phase.
69
69
 
70
70
  References
@@ -86,28 +86,28 @@ def ice_particle_number_survival_fraction(
86
86
 
87
87
 
88
88
  def z_total_length_scale(
89
- aei_n: npt.NDArray[np.float64],
90
- z_atm: npt.NDArray[np.float64],
91
- z_emit: npt.NDArray[np.float64],
92
- z_desc: npt.NDArray[np.float64],
93
- ) -> npt.NDArray[np.float64]:
89
+ aei_n: npt.NDArray[np.floating],
90
+ z_atm: npt.NDArray[np.floating],
91
+ z_emit: npt.NDArray[np.floating],
92
+ z_desc: npt.NDArray[np.floating],
93
+ ) -> npt.NDArray[np.floating]:
94
94
  """
95
95
  Calculate the total length-scale effect of the wake vortex downwash.
96
96
 
97
97
  Parameters
98
98
  ----------
99
- aei_n : npt.NDArray[np.float64]
99
+ aei_n : npt.NDArray[np.floating]
100
100
  Apparent ice crystal number emissions index at contrail formation, [:math:`kg^{-1}`]
101
- z_atm : npt.NDArray[np.float64]
101
+ z_atm : npt.NDArray[np.floating]
102
102
  Length-scale effect of ambient supersaturation on the ice crystal mass budget, [:math:`m`]
103
- z_emit : npt.NDArray[np.float64]
103
+ z_emit : npt.NDArray[np.floating]
104
104
  Length-scale effect of water vapour emissions on the ice crystal mass budget, [:math:`m`]
105
- z_desc : npt.NDArray[np.float64]
105
+ z_desc : npt.NDArray[np.floating]
106
106
  Final vertical displacement of the wake vortex, `dz_max` in `wake_vortex.py`, [:math:`m`]
107
107
 
108
108
  Returns
109
109
  -------
110
- npt.NDArray[np.float64]
110
+ npt.NDArray[np.floating]
111
111
  Total length-scale effect of the wake vortex downwash, [:math:`m`]
112
112
  """
113
113
  alpha_base = (aei_n / 2.8e14) ** (-0.18)
@@ -121,25 +121,25 @@ def z_total_length_scale(
121
121
 
122
122
 
123
123
  def z_atm_length_scale(
124
- air_temperature: npt.NDArray[np.float64],
125
- rhi_0: npt.NDArray[np.float64],
124
+ air_temperature: npt.NDArray[np.floating],
125
+ rhi_0: npt.NDArray[np.floating],
126
126
  *,
127
127
  n_iter: int = 10,
128
- ) -> npt.NDArray[np.float64]:
128
+ ) -> npt.NDArray[np.floating]:
129
129
  """Calculate the length-scale effect of ambient supersaturation on the ice crystal mass budget.
130
130
 
131
131
  Parameters
132
132
  ----------
133
- air_temperature : npt.NDArray[np.float64]
133
+ air_temperature : npt.NDArray[np.floating]
134
134
  Ambient temperature for each waypoint, [:math:`K`].
135
- rhi_0 : npt.NDArray[np.float64]
135
+ rhi_0 : npt.NDArray[np.floating]
136
136
  Relative humidity with respect to ice at the flight waypoint.
137
137
  n_iter : int
138
138
  Number of iterations, set to 10 as default where ``z_atm`` is accurate to within +-1 m.
139
139
 
140
140
  Returns
141
141
  -------
142
- npt.NDArray[np.float64]
142
+ npt.NDArray[np.floating]
143
143
  The effect of the ambient supersaturation on the ice crystal mass budget,
144
144
  provided as a length scale equivalent, [:math:`m`].
145
145
 
@@ -174,28 +174,28 @@ def z_atm_length_scale(
174
174
 
175
175
 
176
176
  def emitted_water_vapour_concentration(
177
- ei_h2o: npt.NDArray[np.float64] | float,
178
- wingspan: npt.NDArray[np.float64] | float,
179
- true_airspeed: npt.NDArray[np.float64],
180
- fuel_flow: npt.NDArray[np.float64],
181
- ) -> npt.NDArray[np.float64]:
177
+ ei_h2o: npt.NDArray[np.floating] | float,
178
+ wingspan: npt.NDArray[np.floating] | float,
179
+ true_airspeed: npt.NDArray[np.floating],
180
+ fuel_flow: npt.NDArray[np.floating],
181
+ ) -> npt.NDArray[np.floating]:
182
182
  r"""
183
183
  Calculate aircraft-emitted water vapour concentration in the plume.
184
184
 
185
185
  Parameters
186
186
  ----------
187
- ei_h2o : npt.NDArray[np.float64] | float
187
+ ei_h2o : npt.NDArray[np.floating] | float
188
188
  Emission index of water vapor, [:math:`kg \ kg^{-1}`]
189
- wingspan : npt.NDArray[np.float64] | float
189
+ wingspan : npt.NDArray[np.floating] | float
190
190
  aircraft wingspan, [:math:`m`]
191
- true_airspeed : npt.NDArray[np.float64]
191
+ true_airspeed : npt.NDArray[np.floating]
192
192
  true airspeed for each waypoint, [:math:`m s^{-1}`]
193
- fuel_flow : npt.NDArray[np.float64]
193
+ fuel_flow : npt.NDArray[np.floating]
194
194
  Fuel mass flow rate, [:math:`kg s^{-1}`]
195
195
 
196
196
  Returns
197
197
  -------
198
- npt.NDArray[np.float64]
198
+ npt.NDArray[np.floating]
199
199
  Aircraft-emitted water vapour concentration in the plume, [:math:`kg m^{-3}`]
200
200
 
201
201
  Notes
@@ -208,22 +208,25 @@ def emitted_water_vapour_concentration(
208
208
 
209
209
 
210
210
  def z_emit_length_scale(
211
- rho_emit: npt.NDArray[np.float64], air_temperature: npt.NDArray[np.float64], *, n_iter: int = 10
212
- ) -> npt.NDArray[np.float64]:
211
+ rho_emit: npt.NDArray[np.floating],
212
+ air_temperature: npt.NDArray[np.floating],
213
+ *,
214
+ n_iter: int = 10,
215
+ ) -> npt.NDArray[np.floating]:
213
216
  """Calculate the length-scale effect of water vapour emissions on the ice crystal mass budget.
214
217
 
215
218
  Parameters
216
219
  ----------
217
- rho_emit : npt.NDArray[np.float64] | float
220
+ rho_emit : npt.NDArray[np.floating] | float
218
221
  Aircraft-emitted water vapour concentration in the plume, [:math:`kg m^{-3}`]
219
- air_temperature : npt.NDArray[np.float64]
222
+ air_temperature : npt.NDArray[np.floating]
220
223
  ambient temperature for each waypoint, [:math:`K`]
221
224
  n_iter : int
222
225
  Number of iterations, set to 10 as default where ``z_emit`` is accurate to within +-1 m.
223
226
 
224
227
  Returns
225
228
  -------
226
- npt.NDArray[np.float64]
229
+ npt.NDArray[np.floating]
227
230
  The effect of the aircraft water vapour emission on the ice crystal mass budget,
228
231
  provided as a length scale equivalent, [:math:`m`]
229
232
 
@@ -250,12 +253,12 @@ def z_emit_length_scale(
250
253
  return 0.5 * (z_1 + z_2)
251
254
 
252
255
 
253
- def plume_area(wingspan: npt.NDArray[np.float64] | float) -> npt.NDArray[np.float64] | float:
256
+ def plume_area(wingspan: npt.NDArray[np.floating] | float) -> npt.NDArray[np.floating] | float:
254
257
  """Calculate area of the wake-vortex plume.
255
258
 
256
259
  Parameters
257
260
  ----------
258
- wingspan : npt.NDArray[np.float64] | float
261
+ wingspan : npt.NDArray[np.floating] | float
259
262
  aircraft wingspan, [:math:`m`]
260
263
 
261
264
  Returns
@@ -272,33 +275,33 @@ def plume_area(wingspan: npt.NDArray[np.float64] | float) -> npt.NDArray[np.floa
272
275
 
273
276
 
274
277
  def z_desc_length_scale(
275
- wingspan: npt.NDArray[np.float64] | float,
276
- air_temperature: npt.NDArray[np.float64],
277
- air_pressure: npt.NDArray[np.float64],
278
- true_airspeed: npt.NDArray[np.float64],
279
- aircraft_mass: npt.NDArray[np.float64],
280
- dT_dz: npt.NDArray[np.float64],
281
- ) -> npt.NDArray[np.float64]:
278
+ wingspan: npt.NDArray[np.floating] | float,
279
+ air_temperature: npt.NDArray[np.floating],
280
+ air_pressure: npt.NDArray[np.floating],
281
+ true_airspeed: npt.NDArray[np.floating],
282
+ aircraft_mass: npt.NDArray[np.floating],
283
+ dT_dz: npt.NDArray[np.floating],
284
+ ) -> npt.NDArray[np.floating]:
282
285
  """Calculate the final vertical displacement of the wake vortex.
283
286
 
284
287
  Parameters
285
288
  ----------
286
- wingspan : npt.NDArray[np.float64] | float
289
+ wingspan : npt.NDArray[np.floating] | float
287
290
  aircraft wingspan, [:math:`m`]
288
- air_temperature : npt.NDArray[np.float64]
291
+ air_temperature : npt.NDArray[np.floating]
289
292
  ambient temperature for each waypoint, [:math:`K`]
290
- air_pressure : npt.NDArray[np.float64]
293
+ air_pressure : npt.NDArray[np.floating]
291
294
  pressure altitude at each waypoint, [:math:`Pa`]
292
- true_airspeed : npt.NDArray[np.float64]
295
+ true_airspeed : npt.NDArray[np.floating]
293
296
  true airspeed for each waypoint, [:math:`m s^{-1}`]
294
- aircraft_mass : npt.NDArray[np.float64] | float
297
+ aircraft_mass : npt.NDArray[np.floating] | float
295
298
  aircraft mass for each waypoint, [:math:`kg`]
296
- dT_dz : npt.NDArray[np.float64]
299
+ dT_dz : npt.NDArray[np.floating]
297
300
  potential temperature gradient, [:math:`K m^{-1}`]
298
301
 
299
302
  Returns
300
303
  -------
301
- npt.NDArray[np.float64]
304
+ npt.NDArray[np.floating]
302
305
  Final vertical displacement of the wake vortex, [:math:`m`]
303
306
 
304
307
  Notes
@@ -313,30 +316,30 @@ def z_desc_length_scale(
313
316
 
314
317
 
315
318
  def _initial_wake_vortex_circulation(
316
- wingspan: npt.NDArray[np.float64] | float,
317
- air_temperature: npt.NDArray[np.float64],
318
- air_pressure: npt.NDArray[np.float64],
319
- true_airspeed: npt.NDArray[np.float64],
320
- aircraft_mass: npt.NDArray[np.float64],
321
- ) -> npt.NDArray[np.float64]:
319
+ wingspan: npt.NDArray[np.floating] | float,
320
+ air_temperature: npt.NDArray[np.floating],
321
+ air_pressure: npt.NDArray[np.floating],
322
+ true_airspeed: npt.NDArray[np.floating],
323
+ aircraft_mass: npt.NDArray[np.floating],
324
+ ) -> npt.NDArray[np.floating]:
322
325
  """Calculate initial wake vortex circulation.
323
326
 
324
327
  Parameters
325
328
  ----------
326
- wingspan : npt.NDArray[np.float64] | float
329
+ wingspan : npt.NDArray[np.floating] | float
327
330
  aircraft wingspan, [:math:`m`]
328
- air_temperature : npt.NDArray[np.float64]
331
+ air_temperature : npt.NDArray[np.floating]
329
332
  ambient temperature for each waypoint, [:math:`K`]
330
- air_pressure : npt.NDArray[np.float64]
333
+ air_pressure : npt.NDArray[np.floating]
331
334
  pressure altitude at each waypoint, [:math:`Pa`]
332
- true_airspeed : npt.NDArray[np.float64]
335
+ true_airspeed : npt.NDArray[np.floating]
333
336
  true airspeed for each waypoint, [:math:`m s^{-1}`]
334
- aircraft_mass : npt.NDArray[np.float64] | float
337
+ aircraft_mass : npt.NDArray[np.floating] | float
335
338
  aircraft mass for each waypoint, [:math:`kg`]
336
339
 
337
340
  Returns
338
341
  -------
339
- npt.NDArray[np.float64]
342
+ npt.NDArray[np.floating]
340
343
  Initial wake vortex circulation, [:math:`m^{2} s^{-1}`]
341
344
 
342
345
  Notes
@@ -350,19 +353,19 @@ def _initial_wake_vortex_circulation(
350
353
 
351
354
 
352
355
  def _survival_fraction_from_length_scale(
353
- z_total: npt.NDArray[np.float64],
354
- ) -> npt.NDArray[np.float64]:
356
+ z_total: npt.NDArray[np.floating],
357
+ ) -> npt.NDArray[np.floating]:
355
358
  """
356
359
  Calculate fraction of ice particle number surviving the wake vortex phase.
357
360
 
358
361
  Parameters
359
362
  ----------
360
- z_total : npt.NDArray[np.float64]
363
+ z_total : npt.NDArray[np.floating]
361
364
  Total length-scale effect of the wake vortex downwash, [:math:`m`]
362
365
 
363
366
  Returns
364
367
  -------
365
- npt.NDArray[np.float64]
368
+ npt.NDArray[np.floating]
366
369
  Fraction of ice particle number surviving the wake vortex phase
367
370
  """
368
371
  f_surv = 0.45 + (1.19 / np.pi) * np.arctan(-1.35 + (z_total / 100.0))
@@ -371,23 +374,23 @@ def _survival_fraction_from_length_scale(
371
374
 
372
375
 
373
376
  def initial_contrail_depth(
374
- z_desc: npt.NDArray[np.float64],
375
- f_surv: npt.NDArray[np.float64],
376
- ) -> npt.NDArray[np.float64]:
377
+ z_desc: npt.NDArray[np.floating],
378
+ f_surv: npt.NDArray[np.floating],
379
+ ) -> npt.NDArray[np.floating]:
377
380
  """Calculate initial contrail depth using :cite:`unterstrasserPropertiesYoungContrails2016`.
378
381
 
379
382
  Parameters
380
383
  ----------
381
- z_desc : npt.NDArray[np.float64]
384
+ z_desc : npt.NDArray[np.floating]
382
385
  Final vertical displacement of the wake vortex, ``dz_max`` in :mod:`wake_vortex.py`,
383
386
  [:math:`m`].
384
- f_surv : npt.NDArray[np.float64]
387
+ f_surv : npt.NDArray[np.floating]
385
388
  Fraction of contrail ice particle number that survive the wake vortex phase.
386
389
  See :func:`ice_particle_survival_fraction`.
387
390
 
388
391
  Returns
389
392
  -------
390
- npt.NDArray[np.float64]
393
+ npt.NDArray[np.floating]
391
394
  Initial contrail depth, [:math:`m`]
392
395
 
393
396
  Notes