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 
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 
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()))
def as_vector_string(string_vals)
Definition: util.py:4

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10