Skip to content

Commit

Permalink
Add Chinese GaoFen-4 PMI supports
Browse files Browse the repository at this point in the history
  • Loading branch information
fengqiaogh committed Jul 11, 2024
1 parent 42cf2ba commit 4e848e8
Showing 1 changed file with 279 additions and 2 deletions.
281 changes: 279 additions & 2 deletions Py6S/Params/wavelength.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def Wavelength(start_wavelength, end_wavelength=None, filter=None):
wv_id = start_wavelength[0]
if wv_id > 0:
# It's one of the new predefined wavelengths that I've added
return Wavelength(start_wavelength[1], start_wavelength[2], start_wavelength[3])
return Wavelength(
start_wavelength[1], start_wavelength[2], start_wavelength[3]
)
else:
wv_type = "%d (Chosen Band)\n" % (-1 * wv_id)
data = None
Expand Down Expand Up @@ -105,7 +107,9 @@ def Wavelength(start_wavelength, end_wavelength=None, filter=None):
else:
# Filter has been given, so we must use it.
# We check filter has been given at 2.5nm intervals
n_req_filter_values = round((end_wavelength - start_wavelength) / 0.0025) + 1
n_req_filter_values = (
round((end_wavelength - start_wavelength) / 0.0025) + 1
)
if len(filter) != n_req_filter_values:
raise sixs_exceptions.ParameterError(
"wavelength",
Expand Down Expand Up @@ -4823,6 +4827,279 @@ class PredefinedWavelengths:
),
)

# Chinese GaoFen-4 PMI spectral response functions
# Code used to create these things in
# https://github.com/fengqiaogh/rsr_tables
GF4_PMI_02 = (
140,
0.42750,
0.55250,
np.array(
[
0.01118,
0.03168,
0.07144,
0.12730,
0.18528,
0.28259,
0.40089,
0.46410,
0.49304,
0.50492,
0.52048,
0.53962,
0.55537,
0.57093,
0.58597,
0.60058,
0.61831,
0.63818,
0.65922,
0.68289,
0.70541,
0.72523,
0.74705,
0.76845,
0.78602,
0.80680,
0.83290,
0.85899,
0.88372,
0.90607,
0.92198,
0.93871,
0.95575,
0.97155,
0.98262,
0.99203,
0.99865,
0.99832,
0.97461,
0.90408,
0.76521,
0.57874,
0.38810,
0.23382,
0.13315,
0.07305,
0.04063,
0.02254,
0.01309,
0.00795,
0.00517,
]
),
)

GF4_PMI_03 = (
141,
0.50500,
0.62500,
np.array(
[
0.01108,
0.03779,
0.10335,
0.23132,
0.40561,
0.57850,
0.70739,
0.78550,
0.83728,
0.87663,
0.90765,
0.92955,
0.93864,
0.95081,
0.96262,
0.97347,
0.98363,
0.99271,
1.00000,
0.99184,
0.98096,
0.96699,
0.95099,
0.93450,
0.91913,
0.90734,
0.90203,
0.90563,
0.91493,
0.92331,
0.92475,
0.91785,
0.90807,
0.90161,
0.90005,
0.89972,
0.89347,
0.87052,
0.81898,
0.71626,
0.56729,
0.39329,
0.23632,
0.12744,
0.06359,
0.03235,
0.01690,
0.00948,
0.00542,
]
),
)

GF4_PMI_04 = (
142,
0.60000,
0.71250,
np.array(
[
0.00594,
0.00970,
0.01714,
0.03369,
0.06872,
0.14367,
0.27714,
0.47730,
0.70050,
0.87736,
0.97326,
0.99882,
0.99673,
0.99069,
0.98765,
0.98712,
0.98774,
0.98814,
0.98690,
0.98389,
0.98044,
0.97572,
0.96999,
0.96166,
0.95068,
0.93804,
0.92516,
0.91225,
0.89819,
0.88116,
0.86048,
0.83663,
0.81195,
0.78781,
0.76130,
0.72144,
0.65477,
0.54886,
0.41382,
0.27545,
0.16227,
0.08878,
0.04612,
0.02445,
0.01310,
0.00740,
]
),
)

GF4_PMI_05 = (
143,
0.72500,
0.93250,
np.array(
[
0.00514,
0.00851,
0.01473,
0.02696,
0.04949,
0.09160,
0.16240,
0.27537,
0.42965,
0.61206,
0.78677,
0.91639,
0.98397,
0.99398,
0.98466,
0.98517,
0.99091,
0.99722,
1.00000,
0.99746,
0.99106,
0.98214,
0.97160,
0.95927,
0.94522,
0.93021,
0.91579,
0.90298,
0.89138,
0.87994,
0.86765,
0.85513,
0.84105,
0.82548,
0.80887,
0.79147,
0.77389,
0.75721,
0.74245,
0.73006,
0.72034,
0.70982,
0.69950,
0.69023,
0.68193,
0.67365,
0.66396,
0.65202,
0.63828,
0.62329,
0.60759,
0.59744,
0.58639,
0.57480,
0.56301,
0.55070,
0.53815,
0.52646,
0.51600,
0.50588,
0.49498,
0.48306,
0.47105,
0.45976,
0.44956,
0.44098,
0.43299,
0.42316,
0.41033,
0.39258,
0.36994,
0.34205,
0.30771,
0.26730,
0.22351,
0.17922,
0.13725,
0.10038,
0.06975,
0.04649,
0.02967,
0.01859,
0.01134,
0.00687,
]
),
)

# All of the original predefined wavelengths from 6S
# CONSTANT_NAME = (ID for Constant, Start Wavelength, End Wavelength)
METEOSAT_VISIBLE = (-2, 0.35, 1.11)
Expand Down

0 comments on commit 4e848e8

Please sign in to comment.