@@ -687,8 +687,7 @@ def angstrom_alpha(aod1, lambda1, aod2, lambda2):
687
687
688
688
def AM_AOD_PW_spectral_correction (airmass_absolute , aod500 , pw ,
689
689
module_type = None , coefficients = None ,
690
- min_aod500 = 0.05 , max_aod500 = 0.6 ,
691
- min_pw = 0.25 , max_pw = 4 ):
690
+ aod500_ref = 0.84 , pw_ref = 1.42 ):
692
691
r"""
693
692
Spectral mismatch modifier based on absolute (pressure-adjusted)
694
693
airmass (AM), aerosol optical depth (AOD) at 500 nm and
@@ -747,30 +746,17 @@ def AM_AOD_PW_spectral_correction(airmass_absolute, aod500, pw,
747
746
* 'asi' - anonymous amorphous silicon module.
748
747
* 'perovskite' - anonymous pervoskite module.
749
748
750
- coefficients : None or array-like, default None
749
+ coefficients : None or array-like, optional
751
750
the coefficients employed have been obtained with experimental
752
751
data in the city of Jaén, Spain. It is pending to verify if such
753
752
coefficients vary in places with extreme climates where AOD and
754
753
pw values are frequently high.
755
754
756
- min_aod500 : float, default 0.05
757
- minimum atmospheric aerosol optical depth at 500 nm. Any aod500 value
758
- lower than min_aod500 is set to min_aod500 to avoid model
759
- divergence. [unitless]
760
-
761
- max_aod500 : float, default 0.6
762
- maximum atmospheric aerosol optical depth at 500 nm. Any aod500 value
763
- higher than max_aod500 is set to NaN to avoid model
764
- divergence. [unitless]
765
-
766
- min_pw : float, default 0.25
767
- minimum atmospheric precipitable water. Any pw value lower than min_pw
768
- is set to min_pw to avoid model divergence. [cm]
769
-
770
- max_pw : float, default 4
771
- maximum atmospheric precipitable water. Any pw value higher than max_pw
772
- is set to NaN to avoid model divergence. [cm]
755
+ aod500_ref : numeric, default 0.84
756
+ TODO: description
773
757
758
+ pw_ref : numeric, default 1.42
759
+ TODO: description
774
760
775
761
Returns
776
762
-------
@@ -801,55 +787,6 @@ def AM_AOD_PW_spectral_correction(airmass_absolute, aod500, pw,
801
787
802
788
"""
803
789
804
- # --- Screen Input Data ---
805
-
806
- # *** ama ***
807
- # Replace Extremely High ama with ama 10 to prevent model divergence
808
- # ama > 10 will only occur very close to sunset
809
- if np .max (airmass_absolute ) > 10 :
810
- airmass_absolute = np .minimum (airmass_absolute , 10 )
811
-
812
- # Warn user about ama data that is exceptionally low
813
-
814
- if np .min (airmass_absolute ) < 0.58 :
815
- warn ('Exceptionally low air mass: ' +
816
- 'model not intended for extra-terrestrial use' )
817
- # pvl_absoluteairmass(1,pvl_alt2pres(4340)) = 0.58 Elevation of
818
- # Mina Pirquita, Argentian = 4340 m. Highest elevation city with
819
- # population over 50,000.
820
-
821
- # *** aod500 ***
822
- # Replace aod500 Values below 0.05 with 0.05 to prevent model from
823
- # diverging"
824
- aod500 = np .atleast_1d (aod500 )
825
- aod500 = aod500 .astype ('float64' )
826
- if np .min (aod500 ) < min_aod500 :
827
- aod500 = np .maximum (aod500 , min_aod500 )
828
- warn (f'Exceptionally low aod values replaced with { min_aod500 } to'
829
- 'prevent model divergence' )
830
-
831
- # Warn user about aod500 data that is exceptionally high
832
- if np .max (aod500 ) > max_aod500 :
833
- aod500 [aod500 > max_aod500 ] = np .nan
834
- warn ('Exceptionally high aod values replaced by np.nan: '
835
- 'check input data.' )
836
-
837
- # *** pw ***
838
- # Replace pw Values below 0.25 cm with 0.25 cm to prevent model from
839
- # diverging"
840
- pw = np .atleast_1d (pw )
841
- pw = pw .astype ('float64' )
842
- if np .min (pw ) < min_pw :
843
- pw = np .maximum (pw , min_pw )
844
- warn (f'Exceptionally low pw values replaced with { min_pw } cm to '
845
- 'prevent model divergence' )
846
-
847
- # Warn user about pw data that is exceptionally high
848
- if np .max (pw ) > max_pw :
849
- pw [pw > max_pw ] = np .nan
850
- warn ('Exceptionally high pw values replaced by np.nan: '
851
- 'check input data.' )
852
-
853
790
# Experimental coefficients
854
791
855
792
_coefficients = {}
@@ -866,7 +803,7 @@ def AM_AOD_PW_spectral_correction(airmass_absolute, aod500, pw,
866
803
0.9801 , 0.0283 , - 0.0092 , 0.0019 , - 0.0001 , 0.0117 ,
867
804
- 0.0126 , 0 , - 0.0011 , - 0.0019 , 1 , 0 )
868
805
_coefficients ['asi' ] = (
869
- 1.1060 , - 0.0848 , 0.0302 , - 0.0076 , 0.0006 , - 0.12838 ,
806
+ 1.1060 , - 0.0848 , 0.0302 , - 0.0076 , 0.0006 , - 0.1283 ,
870
807
0.0986 , - 0.0254 , 0.0156 , 0.0146 , 1 , 0 )
871
808
_coefficients ['perovskite' ] = (
872
809
1.0637 , - 0.0491 , 0.0180 , - 0.0047 , 0.0004 , - 0.0773 ,
@@ -886,16 +823,13 @@ def AM_AOD_PW_spectral_correction(airmass_absolute, aod500, pw,
886
823
# Evaluate Spectral Shift
887
824
coeff = coefficients
888
825
ama = airmass_absolute
889
- aod500_ref = 0.84
890
- pw_ref = 1.42
891
-
892
826
modifier = (
893
827
coeff [0 ] + (ama ) * coeff [1 ] + (ama * ama ) * coeff [2 ]
894
828
+ (ama * ama * ama ) * coeff [3 ] + (ama * ama * ama * ama ) * coeff [4 ]
895
829
+ (aod500 - aod500_ref ) * coeff [5 ]
896
830
+ ((aod500 - aod500_ref ) * (ama ) * coeff [6 ]) * coeff [10 ]
897
831
+ ((aod500 - aod500_ref ) * (np .log (ama )) * coeff [6 ]) * coeff [11 ]
898
- + (aod500 - aod500_ref ) + (ama * ama ) * coeff [7 ]
832
+ + (aod500 - aod500_ref ) * (ama * ama ) * coeff [7 ]
899
833
+ (pw - pw_ref ) * coeff [8 ] + (pw - pw_ref ) * (np .log (ama )) * coeff [9 ])
900
834
901
835
return modifier
0 commit comments