ReFRACtor
ground.py
Go to the documentation of this file.
1
import
math
2
import
numpy
as
np
3
4
from
.base
import
Creator
5
from
.value
import
CreatorFlaggedValueMultiChannel
6
from
..
import
param
7
from
.util
import
as_vector_string
8
9
from
refractor
import
framework
as
rf
10
11
class
AlbedoFromSignalLevel
(
Creator
):
12
13
polynomial_degree =
param.Scalar
(int, default=1)
14
signal_level =
param.ArrayWithUnit
(dims=1)
15
solar_zenith =
param.ArrayWithUnit
(dims=1)
16
solar_strength =
param.Array
(dims=1)
17
solar_distance =
param.ArrayWithUnit
(dims=1)
18
stokes_coefficient =
param.Array
(dims=2)
19
num_channels =
param.Scalar
(int)
20
21
def
create
(self, **kwargs):
22
23
signal = self.
signal_level
()
24
sza_deg = self.
solar_zenith
()
25
solar_strength = self.
solar_strength
()
26
solar_distance = self.
solar_distance
()
27
stokes_I = self.
stokes_coefficient
()[:, 0]
28
29
albedo_val = np.zeros((self.
num_channels
(), self.
polynomial_degree
() + 1))
30
31
for
chan_idx
in
range(self.
num_channels
()):
32
# Account for solar distance Fsun = Fsun0 / (solar_distance_meters/AU)^2
33
# Create SolarDopplerShiftPolynomial so we can compute solar distance
34
chan_solar_strength = solar_strength[chan_idx] / solar_distance[chan_idx].value**2
35
36
# Account for stokes element for I
37
chan_solar_strength = chan_solar_strength * stokes_I[chan_idx]
38
39
sza_r = sza_deg[chan_idx].convert(
"rad"
).value
40
albedo_val[chan_idx, 0] = math.pi * signal[chan_idx].value / (math.cos(sza_r) * chan_solar_strength)
41
42
return
albedo_val
43
44
class
GroundLambertian
(
CreatorFlaggedValueMultiChannel
):
45
46
band_reference =
param.ArrayWithUnit
(dims=1)
47
desc_band_name =
param.Iterable
()
48
49
def
create
(self, **kwargs):
50
return
rf.GroundLambertian(self.
value
(), self.
retrieval_flag
(), self.
band_reference
(),
as_vector_string
(self.
desc_band_name
()))
Python.factory.creator.util.as_vector_string
def as_vector_string(string_vals)
Definition:
util.py:4
Python.factory.creator.ground.GroundLambertian.desc_band_name
desc_band_name
Definition:
ground.py:47
Python.factory.creator.value.CreatorFlaggedValueMultiChannel
Definition:
value.py:29
Python.factory.param.Scalar
Definition:
param.py:72
Python.factory.creator.ground.AlbedoFromSignalLevel.stokes_coefficient
stokes_coefficient
Definition:
ground.py:18
Python.factory.creator.value.CreatorFlaggedValueMultiChannel.value
value
Definition:
value.py:31
Python.factory.creator.ground.GroundLambertian.band_reference
band_reference
Definition:
ground.py:46
Python.factory.param.ArrayWithUnit
Definition:
param.py:142
Python.factory.param.Iterable
Definition:
param.py:107
Python.factory.creator.ground.AlbedoFromSignalLevel
Definition:
ground.py:11
Python.factory.creator.value.CreatorFlaggedValueMultiChannel.retrieval_flag
def retrieval_flag(self, kwargs)
Definition:
value.py:34
Python.factory.creator.ground.AlbedoFromSignalLevel.create
def create(self, kwargs)
Definition:
ground.py:21
Python.factory.creator.ground.AlbedoFromSignalLevel.solar_zenith
solar_zenith
Definition:
ground.py:15
Python.factory.creator.base.Creator
Definition:
base.py:56
Python.factory.creator.ground.AlbedoFromSignalLevel.solar_strength
solar_strength
Definition:
ground.py:16
Python.factory.param.Array
Definition:
param.py:87
Python.factory.creator.ground.AlbedoFromSignalLevel.solar_distance
solar_distance
Definition:
ground.py:17
Python.factory.creator.ground.GroundLambertian
Definition:
ground.py:44
Python.factory.creator.ground.AlbedoFromSignalLevel.signal_level
signal_level
Definition:
ground.py:14
Python.factory.creator.ground.AlbedoFromSignalLevel.num_channels
num_channels
Definition:
ground.py:19
Python.factory.creator.ground.AlbedoFromSignalLevel.polynomial_degree
polynomial_degree
Definition:
ground.py:13
Python.factory.creator.ground.GroundLambertian.create
def create(self, kwargs)
Definition:
ground.py:49
Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10