pycontrails 0.54.2__cp310-cp310-win_amd64.whl → 0.54.4__cp310-cp310-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 +75 -61
- pycontrails/core/cache.py +7 -7
- pycontrails/core/fleet.py +25 -21
- pycontrails/core/flight.py +215 -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.cp310-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/ecmwf/variables.py +1 -0
- pycontrails/datalib/gfs/__init__.py +6 -6
- pycontrails/datalib/gfs/gfs.py +2 -2
- pycontrails/datalib/goes.py +5 -5
- pycontrails/datalib/landsat.py +5 -8
- pycontrails/datalib/sentinel.py +7 -11
- pycontrails/ext/bada.py +3 -2
- pycontrails/ext/empirical_grid.py +1 -1
- pycontrails/ext/synthetic_flight.py +3 -2
- pycontrails/models/accf.py +40 -19
- pycontrails/models/apcemm/apcemm.py +5 -4
- pycontrails/models/cocip/__init__.py +2 -2
- pycontrails/models/cocip/cocip.py +16 -17
- 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 +118 -107
- pycontrails/models/dry_advection.py +59 -58
- 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 +3 -2
- pycontrails/models/ps_model/ps_aircraft_params.py +11 -6
- pycontrails/models/ps_model/ps_grid.py +256 -60
- pycontrails/models/ps_model/ps_model.py +18 -21
- pycontrails/models/ps_model/ps_operational_limits.py +58 -69
- pycontrails/models/tau_cirrus.py +8 -1
- pycontrails/physics/geo.py +216 -67
- pycontrails/physics/jet.py +220 -90
- pycontrails/physics/static/iata-cargo-load-factors-20241115.csv +71 -0
- pycontrails/physics/static/iata-passenger-load-factors-20241115.csv +71 -0
- pycontrails/physics/units.py +14 -14
- pycontrails/utils/json.py +1 -2
- pycontrails/utils/types.py +12 -7
- {pycontrails-0.54.2.dist-info → pycontrails-0.54.4.dist-info}/METADATA +10 -10
- {pycontrails-0.54.2.dist-info → pycontrails-0.54.4.dist-info}/NOTICE +1 -1
- pycontrails-0.54.4.dist-info/RECORD +111 -0
- {pycontrails-0.54.2.dist-info → pycontrails-0.54.4.dist-info}/WHEEL +1 -1
- pycontrails-0.54.2.dist-info/RECORD +0 -109
- {pycontrails-0.54.2.dist-info → pycontrails-0.54.4.dist-info}/LICENSE +0 -0
- {pycontrails-0.54.2.dist-info → pycontrails-0.54.4.dist-info}/top_level.txt +0 -0
|
@@ -369,7 +369,7 @@ class Emissions(Model):
|
|
|
369
369
|
|
|
370
370
|
def _nvpm_emission_indices_edb(
|
|
371
371
|
self, edb_nvpm: EDBnvpm, fuel: Fuel
|
|
372
|
-
) -> tuple[str, npt.NDArray[np.
|
|
372
|
+
) -> tuple[str, npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
373
373
|
"""Calculate emission indices for nvPM mass and number.
|
|
374
374
|
|
|
375
375
|
This method uses data from the ICAO EDB along with the T4/T2 methodology.
|
|
@@ -385,9 +385,9 @@ class Emissions(Model):
|
|
|
385
385
|
-------
|
|
386
386
|
nvpm_data_source : str
|
|
387
387
|
Source of nvpm data.
|
|
388
|
-
nvpm_ei_m : npt.NDArray[np.
|
|
388
|
+
nvpm_ei_m : npt.NDArray[np.floating]
|
|
389
389
|
Non-volatile particulate matter (nvPM) mass emissions index, [:math:`kg/kg_{fuel}`]
|
|
390
|
-
nvpm_ei_n : npt.NDArray[np.
|
|
390
|
+
nvpm_ei_n : npt.NDArray[np.floating]
|
|
391
391
|
Black carbon number emissions index, [:math:`kg_{fuel}^{-1}`]
|
|
392
392
|
|
|
393
393
|
References
|
|
@@ -408,7 +408,7 @@ class Emissions(Model):
|
|
|
408
408
|
|
|
409
409
|
def _nvpm_emission_indices_sac(
|
|
410
410
|
self, edb_gaseous: EDBGaseous, fuel: Fuel
|
|
411
|
-
) -> tuple[str, npt.NDArray[np.
|
|
411
|
+
) -> tuple[str, npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
412
412
|
"""Calculate EIs for nvPM mass and number assuming the profile of single annular combustors.
|
|
413
413
|
|
|
414
414
|
nvPM EI_m is calculated using the FOX and ImFOX methods, while the nvPM EI_n
|
|
@@ -425,9 +425,9 @@ class Emissions(Model):
|
|
|
425
425
|
-------
|
|
426
426
|
nvpm_data_source : str
|
|
427
427
|
Source of nvpm data.
|
|
428
|
-
nvpm_ei_m : npt.NDArray[np.
|
|
428
|
+
nvpm_ei_m : npt.NDArray[np.floating]
|
|
429
429
|
Non-volatile particulate matter (nvPM) mass emissions index, [:math:`kg/kg_{fuel}`]
|
|
430
|
-
nvpm_ei_n : npt.NDArray[np.
|
|
430
|
+
nvpm_ei_n : npt.NDArray[np.floating]
|
|
431
431
|
Black carbon number emissions index, [:math:`kg_{fuel}^{-1}`]
|
|
432
432
|
|
|
433
433
|
References
|
|
@@ -467,7 +467,7 @@ class Emissions(Model):
|
|
|
467
467
|
|
|
468
468
|
def _nvpm_emission_indices_constant(
|
|
469
469
|
self,
|
|
470
|
-
) -> tuple[str, npt.NDArray[np.
|
|
470
|
+
) -> tuple[str, npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
471
471
|
"""
|
|
472
472
|
Assume constant emission indices for nvPM mass and number.
|
|
473
473
|
|
|
@@ -481,9 +481,9 @@ class Emissions(Model):
|
|
|
481
481
|
-------
|
|
482
482
|
nvpm_data_source : str
|
|
483
483
|
Source of nvpm data.
|
|
484
|
-
nvpm_ei_m : npt.NDArray[np.
|
|
484
|
+
nvpm_ei_m : npt.NDArray[np.floating]
|
|
485
485
|
Non-volatile particulate matter (nvPM) mass emissions index, [:math:`kg/kg_{fuel}`]
|
|
486
|
-
nvpm_ei_n : npt.NDArray[np.
|
|
486
|
+
nvpm_ei_n : npt.NDArray[np.floating]
|
|
487
487
|
Black carbon number emissions index, [:math:`kg_{fuel}^{-1}`]
|
|
488
488
|
|
|
489
489
|
References
|
|
@@ -605,12 +605,12 @@ class Emissions(Model):
|
|
|
605
605
|
|
|
606
606
|
def nitrogen_oxide_emissions_index_ffm2(
|
|
607
607
|
edb_gaseous: EDBGaseous,
|
|
608
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
609
|
-
true_airspeed: npt.NDArray[np.
|
|
610
|
-
air_pressure: npt.NDArray[np.
|
|
611
|
-
air_temperature: npt.NDArray[np.
|
|
612
|
-
specific_humidity: None | npt.NDArray[np.
|
|
613
|
-
) -> npt.NDArray[np.
|
|
608
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
609
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
610
|
+
air_pressure: npt.NDArray[np.floating],
|
|
611
|
+
air_temperature: npt.NDArray[np.floating],
|
|
612
|
+
specific_humidity: None | npt.NDArray[np.floating] = None,
|
|
613
|
+
) -> npt.NDArray[np.floating]:
|
|
614
614
|
"""
|
|
615
615
|
Estimate the nitrogen oxide (NOx) emissions index (EI) using the Fuel Flow Method 2 (FFM2).
|
|
616
616
|
|
|
@@ -618,20 +618,20 @@ def nitrogen_oxide_emissions_index_ffm2(
|
|
|
618
618
|
----------
|
|
619
619
|
edb_gaseous : EDBGaseous
|
|
620
620
|
EDB gaseous data
|
|
621
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
621
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
622
622
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
623
|
-
true_airspeed: npt.NDArray[np.
|
|
623
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
624
624
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
625
|
-
air_pressure : npt.NDArray[np.
|
|
625
|
+
air_pressure : npt.NDArray[np.floating]
|
|
626
626
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
627
|
-
air_temperature : npt.NDArray[np.
|
|
627
|
+
air_temperature : npt.NDArray[np.floating]
|
|
628
628
|
ambient temperature for each waypoint, [:math:`K`]
|
|
629
|
-
specific_humidity: npt.NDArray[np.
|
|
629
|
+
specific_humidity: npt.NDArray[np.floating]
|
|
630
630
|
specific humidity for each waypoint, [:math:`kg_{H_{2}O}/kg_{air}`]
|
|
631
631
|
|
|
632
632
|
Returns
|
|
633
633
|
-------
|
|
634
|
-
npt.NDArray[np.
|
|
634
|
+
npt.NDArray[np.floating]
|
|
635
635
|
Nitrogen oxide emissions index for each waypoint, [:math:`kg_{NO_{X}}/kg_{fuel}`]
|
|
636
636
|
"""
|
|
637
637
|
res_nox = ffm2.estimate_nox(
|
|
@@ -647,11 +647,11 @@ def nitrogen_oxide_emissions_index_ffm2(
|
|
|
647
647
|
|
|
648
648
|
def carbon_monoxide_emissions_index_ffm2(
|
|
649
649
|
edb_gaseous: EDBGaseous,
|
|
650
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
651
|
-
true_airspeed: npt.NDArray[np.
|
|
652
|
-
air_pressure: npt.NDArray[np.
|
|
653
|
-
air_temperature: npt.NDArray[np.
|
|
654
|
-
) -> npt.NDArray[np.
|
|
650
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
651
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
652
|
+
air_pressure: npt.NDArray[np.floating],
|
|
653
|
+
air_temperature: npt.NDArray[np.floating],
|
|
654
|
+
) -> npt.NDArray[np.floating]:
|
|
655
655
|
"""
|
|
656
656
|
Estimate the carbon monoxide (CO) emissions index (EI) using the Fuel Flow Method 2 (FFM2).
|
|
657
657
|
|
|
@@ -659,18 +659,18 @@ def carbon_monoxide_emissions_index_ffm2(
|
|
|
659
659
|
----------
|
|
660
660
|
edb_gaseous : EDBGaseous
|
|
661
661
|
EDB gaseous data
|
|
662
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
662
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
663
663
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
664
|
-
true_airspeed: npt.NDArray[np.
|
|
664
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
665
665
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
666
|
-
air_pressure : npt.NDArray[np.
|
|
666
|
+
air_pressure : npt.NDArray[np.floating]
|
|
667
667
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
668
|
-
air_temperature : npt.NDArray[np.
|
|
668
|
+
air_temperature : npt.NDArray[np.floating]
|
|
669
669
|
ambient temperature for each waypoint, [:math:`K`]
|
|
670
670
|
|
|
671
671
|
Returns
|
|
672
672
|
-------
|
|
673
|
-
npt.NDArray[np.
|
|
673
|
+
npt.NDArray[np.floating]
|
|
674
674
|
Carbon monoxide emissions index for each waypoint, [:math:`kg_{CO}/kg_{fuel}`]
|
|
675
675
|
"""
|
|
676
676
|
res_co = ffm2.estimate_ei(
|
|
@@ -685,11 +685,11 @@ def carbon_monoxide_emissions_index_ffm2(
|
|
|
685
685
|
|
|
686
686
|
def hydrocarbon_emissions_index_ffm2(
|
|
687
687
|
edb_gaseous: EDBGaseous,
|
|
688
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
689
|
-
true_airspeed: npt.NDArray[np.
|
|
690
|
-
air_pressure: npt.NDArray[np.
|
|
691
|
-
air_temperature: npt.NDArray[np.
|
|
692
|
-
) -> npt.NDArray[np.
|
|
688
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
689
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
690
|
+
air_pressure: npt.NDArray[np.floating],
|
|
691
|
+
air_temperature: npt.NDArray[np.floating],
|
|
692
|
+
) -> npt.NDArray[np.floating]:
|
|
693
693
|
"""
|
|
694
694
|
Estimate the hydrocarbon (HC) emissions index (EI) using the Fuel Flow Method 2 (FFM2).
|
|
695
695
|
|
|
@@ -697,18 +697,18 @@ def hydrocarbon_emissions_index_ffm2(
|
|
|
697
697
|
----------
|
|
698
698
|
edb_gaseous : EDBGaseous
|
|
699
699
|
EDB gaseous data
|
|
700
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
700
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
701
701
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
702
|
-
true_airspeed: npt.NDArray[np.
|
|
702
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
703
703
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
704
|
-
air_pressure : npt.NDArray[np.
|
|
704
|
+
air_pressure : npt.NDArray[np.floating]
|
|
705
705
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
706
|
-
air_temperature : npt.NDArray[np.
|
|
706
|
+
air_temperature : npt.NDArray[np.floating]
|
|
707
707
|
ambient temperature for each waypoint, [:math:`K`]
|
|
708
708
|
|
|
709
709
|
Returns
|
|
710
710
|
-------
|
|
711
|
-
npt.NDArray[np.
|
|
711
|
+
npt.NDArray[np.floating]
|
|
712
712
|
Hydrocarbon emissions index for each waypoint, [:math:`kg_{HC}/kg_{fuel}`]
|
|
713
713
|
"""
|
|
714
714
|
res_hc = ffm2.estimate_ei(
|
|
@@ -723,12 +723,12 @@ def hydrocarbon_emissions_index_ffm2(
|
|
|
723
723
|
|
|
724
724
|
def get_nvpm_emissions_index_edb(
|
|
725
725
|
edb_nvpm: EDBnvpm,
|
|
726
|
-
true_airspeed: npt.NDArray[np.
|
|
727
|
-
air_temperature: npt.NDArray[np.
|
|
728
|
-
air_pressure: npt.NDArray[np.
|
|
729
|
-
thrust_setting: npt.NDArray[np.
|
|
726
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
727
|
+
air_temperature: npt.NDArray[np.floating],
|
|
728
|
+
air_pressure: npt.NDArray[np.floating],
|
|
729
|
+
thrust_setting: npt.NDArray[np.floating],
|
|
730
730
|
q_fuel: float,
|
|
731
|
-
) -> tuple[npt.NDArray[np.
|
|
731
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
732
732
|
r"""Calculate nvPM mass emissions index (nvpm_ei_m) and number emissions index (nvpm_ei_n).
|
|
733
733
|
|
|
734
734
|
Interpolate the non-volatile particulate matter (nvPM) mass and number emissions index from
|
|
@@ -741,24 +741,24 @@ def get_nvpm_emissions_index_edb(
|
|
|
741
741
|
----------
|
|
742
742
|
edb_nvpm : EDBnvpm
|
|
743
743
|
EDB nvPM data
|
|
744
|
-
true_airspeed: npt.NDArray[np.
|
|
744
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
745
745
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
746
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
746
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
747
747
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
748
|
-
air_temperature: npt.NDArray[np.
|
|
748
|
+
air_temperature: npt.NDArray[np.floating]
|
|
749
749
|
ambient temperature for each waypoint, [:math:`K`]
|
|
750
|
-
air_pressure: npt.NDArray[np.
|
|
750
|
+
air_pressure: npt.NDArray[np.floating]
|
|
751
751
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
752
|
-
thrust_setting : npt.NDArray[np.
|
|
752
|
+
thrust_setting : npt.NDArray[np.floating]
|
|
753
753
|
thrust setting
|
|
754
754
|
q_fuel : float
|
|
755
755
|
Lower calorific value (LCV) of fuel, [:math:`J \ kg_{fuel}^{-1}`].
|
|
756
756
|
|
|
757
757
|
Returns
|
|
758
758
|
-------
|
|
759
|
-
nvpm_ei_m : npt.NDArray[np.
|
|
759
|
+
nvpm_ei_m : npt.NDArray[np.floating]
|
|
760
760
|
Non-volatile particulate matter (nvPM) mass emissions index, [:math:`kg/kg_{fuel}`]
|
|
761
|
-
nvpm_ei_n : npt.NDArray[np.
|
|
761
|
+
nvpm_ei_n : npt.NDArray[np.floating]
|
|
762
762
|
Black carbon number emissions index, [:math:`kg_{fuel}^{-1}`]
|
|
763
763
|
"""
|
|
764
764
|
# Non-dimensionalized thrust setting
|
|
@@ -781,13 +781,13 @@ def get_nvpm_emissions_index_edb(
|
|
|
781
781
|
|
|
782
782
|
def nvpm_mass_emissions_index_sac(
|
|
783
783
|
edb_gaseous: EDBGaseous,
|
|
784
|
-
air_pressure: npt.NDArray[np.
|
|
785
|
-
true_airspeed: npt.NDArray[np.
|
|
786
|
-
air_temperature: npt.NDArray[np.
|
|
787
|
-
thrust_setting: npt.NDArray[np.
|
|
788
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
784
|
+
air_pressure: npt.NDArray[np.floating],
|
|
785
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
786
|
+
air_temperature: npt.NDArray[np.floating],
|
|
787
|
+
thrust_setting: npt.NDArray[np.floating],
|
|
788
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
789
789
|
hydrogen_content: float,
|
|
790
|
-
) -> npt.NDArray[np.
|
|
790
|
+
) -> npt.NDArray[np.floating]:
|
|
791
791
|
"""Estimate nvPM mass emission index for singular annular combustor (SAC) engines.
|
|
792
792
|
|
|
793
793
|
Here, SAC should not be confused with the Schmidt-Appleman Criterion.
|
|
@@ -799,22 +799,22 @@ def nvpm_mass_emissions_index_sac(
|
|
|
799
799
|
----------
|
|
800
800
|
edb_gaseous : EDBGaseous
|
|
801
801
|
EDB gaseous data
|
|
802
|
-
air_pressure: npt.NDArray[np.
|
|
802
|
+
air_pressure: npt.NDArray[np.floating]
|
|
803
803
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
804
|
-
true_airspeed: npt.NDArray[np.
|
|
804
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
805
805
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
806
|
-
air_temperature: npt.NDArray[np.
|
|
806
|
+
air_temperature: npt.NDArray[np.floating]
|
|
807
807
|
ambient temperature for each waypoint, [:math:`K`]
|
|
808
|
-
thrust_setting : npt.NDArray[np.
|
|
808
|
+
thrust_setting : npt.NDArray[np.floating]
|
|
809
809
|
thrust setting
|
|
810
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
810
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
811
811
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
812
812
|
hydrogen_content : float
|
|
813
813
|
Engine unique identification number from the ICAO EDB
|
|
814
814
|
|
|
815
815
|
Returns
|
|
816
816
|
-------
|
|
817
|
-
npt.NDArray[np.
|
|
817
|
+
npt.NDArray[np.floating]
|
|
818
818
|
nvPM mass emissions index, [:math:`kg/kg_{fuel}`]
|
|
819
819
|
"""
|
|
820
820
|
nvpm_ei_m_fox = black_carbon.mass_emissions_index_fox(
|
|
@@ -834,12 +834,12 @@ def nvpm_mass_emissions_index_sac(
|
|
|
834
834
|
|
|
835
835
|
def nvpm_geometric_mean_diameter_sac(
|
|
836
836
|
edb_gaseous: EDBGaseous,
|
|
837
|
-
air_pressure: npt.NDArray[np.
|
|
838
|
-
true_airspeed: npt.NDArray[np.
|
|
839
|
-
air_temperature: npt.NDArray[np.
|
|
840
|
-
thrust_setting: npt.NDArray[np.
|
|
837
|
+
air_pressure: npt.NDArray[np.floating],
|
|
838
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
839
|
+
air_temperature: npt.NDArray[np.floating],
|
|
840
|
+
thrust_setting: npt.NDArray[np.floating],
|
|
841
841
|
q_fuel: float,
|
|
842
|
-
) -> npt.NDArray[np.
|
|
842
|
+
) -> npt.NDArray[np.floating]:
|
|
843
843
|
r"""
|
|
844
844
|
Estimate nvPM geometric mean diameter for singular annular combustor (SAC) engines.
|
|
845
845
|
|
|
@@ -847,20 +847,20 @@ def nvpm_geometric_mean_diameter_sac(
|
|
|
847
847
|
----------
|
|
848
848
|
edb_gaseous : EDBGaseous
|
|
849
849
|
EDB gaseous data
|
|
850
|
-
air_pressure: npt.NDArray[np.
|
|
850
|
+
air_pressure: npt.NDArray[np.floating]
|
|
851
851
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
852
|
-
true_airspeed: npt.NDArray[np.
|
|
852
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
853
853
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
854
|
-
air_temperature: npt.NDArray[np.
|
|
854
|
+
air_temperature: npt.NDArray[np.floating]
|
|
855
855
|
ambient temperature for each waypoint, [:math:`K`]
|
|
856
|
-
thrust_setting : npt.NDArray[np.
|
|
856
|
+
thrust_setting : npt.NDArray[np.floating]
|
|
857
857
|
thrust setting
|
|
858
858
|
q_fuel : float
|
|
859
859
|
Lower calorific value (LCV) of fuel, [:math:`J \ kg_{fuel}^{-1}`].
|
|
860
860
|
|
|
861
861
|
Returns
|
|
862
862
|
-------
|
|
863
|
-
npt.NDArray[np.
|
|
863
|
+
npt.NDArray[np.floating]
|
|
864
864
|
nvPM geometric mean diameter, [:math:`m`]
|
|
865
865
|
"""
|
|
866
866
|
nvpm_gmd = black_carbon.geometric_mean_diameter_sac(
|
|
@@ -877,11 +877,11 @@ def nvpm_geometric_mean_diameter_sac(
|
|
|
877
877
|
|
|
878
878
|
def get_thrust_setting(
|
|
879
879
|
edb_gaseous: EDBGaseous,
|
|
880
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
881
|
-
air_pressure: npt.NDArray[np.
|
|
882
|
-
air_temperature: npt.NDArray[np.
|
|
883
|
-
true_airspeed: npt.NDArray[np.
|
|
884
|
-
) -> npt.NDArray[np.
|
|
880
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
881
|
+
air_pressure: npt.NDArray[np.floating],
|
|
882
|
+
air_temperature: npt.NDArray[np.floating],
|
|
883
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
884
|
+
) -> npt.NDArray[np.floating]:
|
|
885
885
|
"""
|
|
886
886
|
Approximate the engine thrust setting at cruise conditions.
|
|
887
887
|
|
|
@@ -893,18 +893,18 @@ def get_thrust_setting(
|
|
|
893
893
|
----------
|
|
894
894
|
edb_gaseous : EDBGaseous
|
|
895
895
|
EDB gaseous data
|
|
896
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
896
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
897
897
|
Fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
898
|
-
air_pressure: npt.NDArray[np.
|
|
898
|
+
air_pressure: npt.NDArray[np.floating]
|
|
899
899
|
Pressure altitude at each waypoint, [:math:`Pa`]
|
|
900
|
-
air_temperature: npt.NDArray[np.
|
|
900
|
+
air_temperature: npt.NDArray[np.floating]
|
|
901
901
|
Ambient temperature for each waypoint, [:math:`K`]
|
|
902
|
-
true_airspeed: npt.NDArray[np.
|
|
902
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
903
903
|
True airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
904
904
|
|
|
905
905
|
Returns
|
|
906
906
|
-------
|
|
907
|
-
npt.NDArray[np.
|
|
907
|
+
npt.NDArray[np.floating]
|
|
908
908
|
Engine thrust setting. Returns ``np.nan`` if engine data is
|
|
909
909
|
not available in the ICAO EDB dataset.
|
|
910
910
|
"""
|
|
@@ -172,27 +172,27 @@ def co_hc_emissions_index_profile(
|
|
|
172
172
|
|
|
173
173
|
def estimate_nox(
|
|
174
174
|
log_ei_nox_profile: EmissionsProfileInterpolator,
|
|
175
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
176
|
-
true_airspeed: npt.NDArray[np.
|
|
177
|
-
air_pressure: npt.NDArray[np.
|
|
178
|
-
air_temperature: npt.NDArray[np.
|
|
179
|
-
specific_humidity: None | npt.NDArray[np.
|
|
180
|
-
) -> npt.NDArray[np.
|
|
175
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
176
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
177
|
+
air_pressure: npt.NDArray[np.floating],
|
|
178
|
+
air_temperature: npt.NDArray[np.floating],
|
|
179
|
+
specific_humidity: None | npt.NDArray[np.floating] = None,
|
|
180
|
+
) -> npt.NDArray[np.floating]:
|
|
181
181
|
"""Estimate the nitrogen oxide (NOx) emissions index (EI) at cruise conditions.
|
|
182
182
|
|
|
183
183
|
Parameters
|
|
184
184
|
----------
|
|
185
185
|
log_ei_nox_profile: EmissionsProfileInterpolator
|
|
186
186
|
emissions profile containing the log of EI NOx versus log of fuel flow.
|
|
187
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
187
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
188
188
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
189
|
-
true_airspeed: npt.NDArray[np.
|
|
189
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
190
190
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
191
|
-
air_pressure : npt.NDArray[np.
|
|
191
|
+
air_pressure : npt.NDArray[np.floating]
|
|
192
192
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
193
|
-
air_temperature : npt.NDArray[np.
|
|
193
|
+
air_temperature : npt.NDArray[np.floating]
|
|
194
194
|
ambient temperature for each waypoint, [:math:`K`]
|
|
195
|
-
specific_humidity: npt.NDArray[np.
|
|
195
|
+
specific_humidity: npt.NDArray[np.floating] | None
|
|
196
196
|
specific humidity for each waypoint, [:math:`kg_{H_{2}O}/kg_{air}`]
|
|
197
197
|
"""
|
|
198
198
|
|
|
@@ -215,24 +215,24 @@ def estimate_nox(
|
|
|
215
215
|
|
|
216
216
|
def estimate_ei(
|
|
217
217
|
log_ei_profile: EmissionsProfileInterpolator,
|
|
218
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
219
|
-
true_airspeed: npt.NDArray[np.
|
|
220
|
-
air_pressure: npt.NDArray[np.
|
|
221
|
-
air_temperature: npt.NDArray[np.
|
|
222
|
-
) -> npt.NDArray[np.
|
|
218
|
+
fuel_flow_per_engine: npt.NDArray[np.floating],
|
|
219
|
+
true_airspeed: npt.NDArray[np.floating],
|
|
220
|
+
air_pressure: npt.NDArray[np.floating],
|
|
221
|
+
air_temperature: npt.NDArray[np.floating],
|
|
222
|
+
) -> npt.NDArray[np.floating]:
|
|
223
223
|
"""Estimate carbon monoxide (CO) or hydrocarbon (HC) emissions index (EI).
|
|
224
224
|
|
|
225
225
|
Parameters
|
|
226
226
|
----------
|
|
227
227
|
log_ei_profile: EmissionsProfileInterpolator
|
|
228
228
|
emissions profile containing the log of EI CO or EI HC versus log of fuel flow.
|
|
229
|
-
fuel_flow_per_engine: npt.NDArray[np.
|
|
229
|
+
fuel_flow_per_engine: npt.NDArray[np.floating]
|
|
230
230
|
fuel mass flow rate per engine, [:math:`kg s^{-1}`]
|
|
231
|
-
true_airspeed: npt.NDArray[np.
|
|
231
|
+
true_airspeed: npt.NDArray[np.floating]
|
|
232
232
|
true airspeed for each waypoint, [:math:`m s^{-1}`]
|
|
233
|
-
air_pressure : npt.NDArray[np.
|
|
233
|
+
air_pressure : npt.NDArray[np.floating]
|
|
234
234
|
pressure altitude at each waypoint, [:math:`Pa`]
|
|
235
|
-
air_temperature : npt.NDArray[np.
|
|
235
|
+
air_temperature : npt.NDArray[np.floating]
|
|
236
236
|
ambient temperature for each waypoint, [:math:`K`]
|
|
237
237
|
"""
|
|
238
238
|
mach_num = units.tas_to_mach_number(true_airspeed, air_temperature)
|
|
@@ -252,29 +252,29 @@ def estimate_ei(
|
|
|
252
252
|
|
|
253
253
|
|
|
254
254
|
def ei_at_cruise(
|
|
255
|
-
ei_sl: npt.NDArray[np.
|
|
256
|
-
theta_amb: npt.NDArray[np.
|
|
257
|
-
delta_amb: npt.NDArray[np.
|
|
255
|
+
ei_sl: npt.NDArray[np.floating],
|
|
256
|
+
theta_amb: npt.NDArray[np.floating],
|
|
257
|
+
delta_amb: npt.NDArray[np.floating],
|
|
258
258
|
ei_type: str,
|
|
259
|
-
) -> npt.NDArray[np.
|
|
259
|
+
) -> npt.NDArray[np.floating]:
|
|
260
260
|
"""Convert the estimated EI at sea level to cruise conditions.
|
|
261
261
|
|
|
262
262
|
Refer to Eqs. (15) and (16) in DuBois & Paynter (2006).
|
|
263
263
|
|
|
264
264
|
Parameters
|
|
265
265
|
----------
|
|
266
|
-
ei_sl : npt.NDArray[np.
|
|
266
|
+
ei_sl : npt.NDArray[np.floating]
|
|
267
267
|
Sea level EI values.
|
|
268
|
-
theta_amb : npt.NDArray[np.
|
|
268
|
+
theta_amb : npt.NDArray[np.floating]
|
|
269
269
|
Ratio of the ambient temperature to the temperature at mean sea-level.
|
|
270
|
-
delta_amb : npt.NDArray[np.
|
|
270
|
+
delta_amb : npt.NDArray[np.floating]
|
|
271
271
|
Ratio of the pressure altitude to the surface pressure.
|
|
272
272
|
ei_type : str
|
|
273
273
|
One of {"HC", "CO", "NOX"}
|
|
274
274
|
|
|
275
275
|
Returns
|
|
276
276
|
-------
|
|
277
|
-
npt.NDArray[np.
|
|
277
|
+
npt.NDArray[np.floating]
|
|
278
278
|
Estimated cruise EI values.
|
|
279
279
|
|
|
280
280
|
References
|
|
@@ -292,30 +292,30 @@ def ei_at_cruise(
|
|
|
292
292
|
|
|
293
293
|
|
|
294
294
|
def _get_humidity_correction_factor(
|
|
295
|
-
specific_humidity: npt.NDArray[np.
|
|
296
|
-
) -> npt.NDArray[np.
|
|
295
|
+
specific_humidity: npt.NDArray[np.floating],
|
|
296
|
+
) -> npt.NDArray[np.floating]:
|
|
297
297
|
return np.exp(-19 * (specific_humidity - 0.00634))
|
|
298
298
|
|
|
299
299
|
|
|
300
300
|
def _estimate_specific_humidity(
|
|
301
|
-
air_temperature: npt.NDArray[np.
|
|
302
|
-
) -> npt.NDArray[np.
|
|
301
|
+
air_temperature: npt.NDArray[np.floating], air_pressure: npt.NDArray[np.floating], rh: float
|
|
302
|
+
) -> npt.NDArray[np.floating]:
|
|
303
303
|
"""Estimate the specific humidity by assuming a fixed relative humidity.
|
|
304
304
|
|
|
305
305
|
Refer to Eqs. (43), (44) and (45) in DuBois & Paynter (2006).
|
|
306
306
|
|
|
307
307
|
Parameters
|
|
308
308
|
----------
|
|
309
|
-
air_temperature : npt.NDArray[np.
|
|
309
|
+
air_temperature : npt.NDArray[np.floating]
|
|
310
310
|
Air temperature, [:math:`K`]
|
|
311
|
-
air_pressure : npt.NDArray[np.
|
|
311
|
+
air_pressure : npt.NDArray[np.floating]
|
|
312
312
|
Air pressure, [:math:`Pa`]
|
|
313
313
|
rh : float
|
|
314
314
|
Relative humidity, [:math:`0 - 1`]
|
|
315
315
|
|
|
316
316
|
Returns
|
|
317
317
|
-------
|
|
318
|
-
npt.NDArray[np.
|
|
318
|
+
npt.NDArray[np.floating]
|
|
319
319
|
Estimated specific humidity, [:math:`kg kg^{-1}`]
|
|
320
320
|
|
|
321
321
|
References
|
|
@@ -625,7 +625,7 @@ def histogram_matching(
|
|
|
625
625
|
level_type: str,
|
|
626
626
|
member: int | None,
|
|
627
627
|
q_method: str | None,
|
|
628
|
-
) -> npt.NDArray[np.
|
|
628
|
+
) -> npt.NDArray[np.floating]:
|
|
629
629
|
"""Map ERA5-derived RHi to its corresponding IAGOS quantile via histogram matching.
|
|
630
630
|
|
|
631
631
|
This matching is performed on a **single** ERA5 ensemble member.
|
|
@@ -649,7 +649,7 @@ def histogram_matching(
|
|
|
649
649
|
|
|
650
650
|
Returns
|
|
651
651
|
-------
|
|
652
|
-
npt.NDArray[np.
|
|
652
|
+
npt.NDArray[np.floating]
|
|
653
653
|
The IAGOS quantiles corresponding to the ERA5-derived RHi values. Returned
|
|
654
654
|
as a numpy array with the same shape and dtype as ``era5_rhi``.
|
|
655
655
|
"""
|
|
@@ -691,8 +691,8 @@ def histogram_matching(
|
|
|
691
691
|
|
|
692
692
|
|
|
693
693
|
def histogram_matching_all_members(
|
|
694
|
-
era5_rhi_all_members: npt.NDArray[np.
|
|
695
|
-
) -> tuple[npt.NDArray[np.
|
|
694
|
+
era5_rhi_all_members: npt.NDArray[np.floating], member: int, q_method: str
|
|
695
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
696
696
|
"""Recalibrate ERA5-derived RHi values to IAGOS quantiles by histogram matching.
|
|
697
697
|
|
|
698
698
|
This recalibration requires values for **all** ERA5 ensemble members. Currently, the
|
|
@@ -700,7 +700,7 @@ def histogram_matching_all_members(
|
|
|
700
700
|
|
|
701
701
|
Parameters
|
|
702
702
|
----------
|
|
703
|
-
era5_rhi_all_members : npt.NDArray[np.
|
|
703
|
+
era5_rhi_all_members : npt.NDArray[np.floating]
|
|
704
704
|
ERA5-derived RHi values for all ensemble members. This array should have shape ``(n, 10)``.
|
|
705
705
|
member : int
|
|
706
706
|
The ERA5 ensemble member to use. Must be in the range ``[0, 10)``.
|
|
@@ -709,10 +709,10 @@ def histogram_matching_all_members(
|
|
|
709
709
|
|
|
710
710
|
Returns
|
|
711
711
|
-------
|
|
712
|
-
ensemble_mean_rhi : npt.NDArray[np.
|
|
712
|
+
ensemble_mean_rhi : npt.NDArray[np.floating]
|
|
713
713
|
The mean RHi values after histogram matching over all ensemble members.
|
|
714
714
|
This is an array of shape ``(n,)``.
|
|
715
|
-
ensemble_member_rhi : npt.NDArray[np.
|
|
715
|
+
ensemble_member_rhi : npt.NDArray[np.floating]
|
|
716
716
|
The RHi values after histogram matching for the given ensemble member.
|
|
717
717
|
This is an array of shape ``(n,)``.
|
|
718
718
|
"""
|
|
@@ -727,7 +727,7 @@ def histogram_matching_all_members(
|
|
|
727
727
|
|
|
728
728
|
# Perform histogram matching on all other ensemble members
|
|
729
729
|
# Add up the results into a single 'ensemble_mean_rhi' array
|
|
730
|
-
ensemble_mean_rhi: npt.NDArray[np.
|
|
730
|
+
ensemble_mean_rhi: npt.NDArray[np.floating] = 0.0 # type: ignore[assignment]
|
|
731
731
|
for r in range(n_members):
|
|
732
732
|
if r == member:
|
|
733
733
|
ensemble_mean_rhi += ensemble_member_rhi
|
|
@@ -743,25 +743,25 @@ def histogram_matching_all_members(
|
|
|
743
743
|
|
|
744
744
|
|
|
745
745
|
def eckel_scaling(
|
|
746
|
-
ensemble_mean_rhi: npt.NDArray[np.
|
|
747
|
-
ensemble_member_rhi: npt.NDArray[np.
|
|
746
|
+
ensemble_mean_rhi: npt.NDArray[np.floating],
|
|
747
|
+
ensemble_member_rhi: npt.NDArray[np.floating],
|
|
748
748
|
q_method: str,
|
|
749
|
-
) -> npt.NDArray[np.
|
|
749
|
+
) -> npt.NDArray[np.floating]:
|
|
750
750
|
"""Apply Eckel scaling to the given RHi values.
|
|
751
751
|
|
|
752
752
|
Parameters
|
|
753
753
|
----------
|
|
754
|
-
ensemble_mean_rhi : npt.NDArray[np.
|
|
754
|
+
ensemble_mean_rhi : npt.NDArray[np.floating]
|
|
755
755
|
The ensemble mean RHi values. This should be a 1D array with the same shape as
|
|
756
756
|
``ensemble_member_rhi``.
|
|
757
|
-
ensemble_member_rhi : npt.NDArray[np.
|
|
757
|
+
ensemble_member_rhi : npt.NDArray[np.floating]
|
|
758
758
|
The RHi values for a single ensemble member.
|
|
759
759
|
q_method : {None, "cubic-spline", "log-q-log-p"}
|
|
760
760
|
The interpolation method.
|
|
761
761
|
|
|
762
762
|
Returns
|
|
763
763
|
-------
|
|
764
|
-
npt.NDArray[np.
|
|
764
|
+
npt.NDArray[np.floating]
|
|
765
765
|
The scaled RHi values. Values are manually clipped at 0 to ensure
|
|
766
766
|
only non-negative values are returned.
|
|
767
767
|
|
|
@@ -984,11 +984,11 @@ class HistogramMatchingWithEckel(HumidityScaling):
|
|
|
984
984
|
@override
|
|
985
985
|
def scale( # type: ignore[override]
|
|
986
986
|
self,
|
|
987
|
-
specific_humidity: npt.NDArray[np.
|
|
988
|
-
air_temperature: npt.NDArray[np.
|
|
989
|
-
air_pressure: npt.NDArray[np.
|
|
987
|
+
specific_humidity: npt.NDArray[np.floating],
|
|
988
|
+
air_temperature: npt.NDArray[np.floating],
|
|
989
|
+
air_pressure: npt.NDArray[np.floating],
|
|
990
990
|
**kwargs: Any,
|
|
991
|
-
) -> tuple[npt.NDArray[np.
|
|
991
|
+
) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]:
|
|
992
992
|
"""Scale specific humidity values via histogram matching and Eckel scaling.
|
|
993
993
|
|
|
994
994
|
Unlike the method on the base class, the method assumes each of the input
|
|
@@ -996,22 +996,22 @@ class HistogramMatchingWithEckel(HumidityScaling):
|
|
|
996
996
|
|
|
997
997
|
Parameters
|
|
998
998
|
----------
|
|
999
|
-
specific_humidity : npt.NDArray[np.
|
|
999
|
+
specific_humidity : npt.NDArray[np.floating]
|
|
1000
1000
|
A 2D array of specific humidity values for all ERA5 ensemble members.
|
|
1001
1001
|
The shape of this array must be ``(n, 10)``, where ``n`` is the number
|
|
1002
1002
|
of observations and ``10`` is the number of ERA5 ensemble members.
|
|
1003
|
-
air_temperature : npt.NDArray[np.
|
|
1003
|
+
air_temperature : npt.NDArray[np.floating]
|
|
1004
1004
|
A 1D array of air temperature values with shape ``(n,)``.
|
|
1005
|
-
air_pressure : npt.NDArray[np.
|
|
1005
|
+
air_pressure : npt.NDArray[np.floating]
|
|
1006
1006
|
A 1D array of air pressure values with shape ``(n,)``.
|
|
1007
1007
|
kwargs: Any
|
|
1008
1008
|
Unused, kept for compatibility with the base class.
|
|
1009
1009
|
|
|
1010
1010
|
Returns
|
|
1011
1011
|
-------
|
|
1012
|
-
specific_humidity : npt.NDArray[np.
|
|
1012
|
+
specific_humidity : npt.NDArray[np.floating]
|
|
1013
1013
|
The recalibrated specific humidity values. A 1D array with shape ``(n,)``.
|
|
1014
|
-
rhi : npt.NDArray[np.
|
|
1014
|
+
rhi : npt.NDArray[np.floating]
|
|
1015
1015
|
The recalibrated RHi values. A 1D array with shape ``(n,)``.
|
|
1016
1016
|
"""
|
|
1017
1017
|
|
|
@@ -4,14 +4,15 @@ from pycontrails.models.ps_model.ps_aircraft_params import (
|
|
|
4
4
|
PSAircraftEngineParams,
|
|
5
5
|
load_aircraft_engine_params,
|
|
6
6
|
)
|
|
7
|
-
from pycontrails.models.ps_model.ps_grid import PSGrid, ps_nominal_grid
|
|
7
|
+
from pycontrails.models.ps_model.ps_grid import PSGrid, ps_nominal_grid, ps_nominal_optimize_mach
|
|
8
8
|
from pycontrails.models.ps_model.ps_model import PSFlight, PSFlightParams
|
|
9
9
|
|
|
10
10
|
__all__ = [
|
|
11
|
+
"PSAircraftEngineParams",
|
|
11
12
|
"PSFlight",
|
|
12
13
|
"PSFlightParams",
|
|
13
|
-
"PSAircraftEngineParams",
|
|
14
14
|
"PSGrid",
|
|
15
15
|
"load_aircraft_engine_params",
|
|
16
16
|
"ps_nominal_grid",
|
|
17
|
+
"ps_nominal_optimize_mach",
|
|
17
18
|
]
|