ReFRACtor
solar_model.py
Go to the documentation of this file.
1
import
numpy
as
np
2
3
from
.base
import
Creator
4
from
..
import
param
5
6
from
refractor
import
framework
as
rf
7
8
class
SolarAbsorptionAndContinuum
(
Creator
):
9
10
doppler =
param.Iterable
(rf.SolarDopplerShift)
11
absorption =
param.Iterable
(rf.SolarAbsorptionSpectrum)
12
continuum =
param.Iterable
(rf.SolarContinuumSpectrum)
13
14
def
create
(self, **kwargs):
15
16
solar = []
17
for
doppler, absorption, continuum
in
zip(self.
doppler
(), self.
absorption
(), self.
continuum
()):
18
solar.append( rf.SolarAbsorptionAndContinuum(doppler, absorption, continuum) )
19
return
solar
20
21
class
SolarDopplerShiftPolynomial
(
Creator
):
22
23
time =
param.Iterable
(rf.Time)
24
latitude =
param.ArrayWithUnit
(dims=1)
25
solar_zenith =
param.ArrayWithUnit
(dims=1)
26
solar_azimuth =
param.ArrayWithUnit
(dims=1)
27
surface_height =
param.ArrayWithUnit
(dims=1)
28
constants =
param.InstanceOf
(rf.Constant)
29
num_channels =
param.Scalar
(int)
30
31
def
create
(self, **kwargs):
32
33
do_doppler_shift =
True
34
35
doppler_shift = []
36
for
chan_index
in
range(self.
num_channels
()):
37
doppler_shift.append( rf.SolarDopplerShiftPolynomial(self.
time
()[chan_index],
38
self.
latitude
()[chan_index],
39
self.
solar_zenith
()[chan_index],
40
self.
solar_azimuth
()[chan_index],
41
self.
surface_height
()[chan_index],
42
self.
constants
(),
43
do_doppler_shift) )
44
return
doppler_shift
45
46
class
SolarAbsorptionTable
(
Creator
):
47
48
solar_data_file =
param.Scalar
(str)
49
num_channels =
param.Scalar
(int)
50
51
def
create
(self, **kwargs):
52
solar_file = rf.HdfFile(self.
solar_data_file
())
53
54
absorption = []
55
for
chan_index
in
range(self.
num_channels
()):
56
absorption.append( rf.SolarAbsorptionTable(solar_file,
"/Solar/Absorption/Absorption_%d"
% (chan_index + 1)) )
57
return
absorption
58
59
class
SolarContinuumTable
(
Creator
):
60
61
solar_data_file =
param.Scalar
(str)
62
convert_from_photon =
param.Scalar
(bool, default=
False
)
63
num_channels =
param.Scalar
(int)
64
65
def
create
(self, **kwargs):
66
solar_file = rf.HdfFile(self.
solar_data_file
())
67
68
continuum = []
69
for
chan_index
in
range(self.
num_channels
()):
70
continuum.append( rf.SolarContinuumTable(solar_file,
"/Solar/Continuum/Continuum_%d"
% (chan_index + 1),
71
self.
convert_from_photon
()) )
72
return
continuum
Python.factory.creator.solar_model.SolarAbsorptionTable.solar_data_file
solar_data_file
Definition:
solar_model.py:48
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.constants
constants
Definition:
solar_model.py:28
Python.factory.creator.solar_model.SolarAbsorptionTable.num_channels
num_channels
Definition:
solar_model.py:49
Python.factory.param.Scalar
Definition:
param.py:72
Python.factory.param.ArrayWithUnit
Definition:
param.py:142
Python.factory.param.Iterable
Definition:
param.py:107
Python.factory.creator.solar_model.SolarAbsorptionAndContinuum.absorption
absorption
Definition:
solar_model.py:11
Python.factory.creator.solar_model.SolarContinuumTable.create
def create(self, kwargs)
Definition:
solar_model.py:65
Python.factory.creator.solar_model.SolarAbsorptionAndContinuum.create
def create(self, kwargs)
Definition:
solar_model.py:14
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial
Definition:
solar_model.py:21
Python.factory.creator.base.Creator
Definition:
base.py:56
Python.factory.creator.solar_model.SolarContinuumTable.convert_from_photon
convert_from_photon
Definition:
solar_model.py:62
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.solar_azimuth
solar_azimuth
Definition:
solar_model.py:26
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.num_channels
num_channels
Definition:
solar_model.py:29
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.latitude
latitude
Definition:
solar_model.py:24
Python.factory.creator.solar_model.SolarContinuumTable.num_channels
num_channels
Definition:
solar_model.py:63
Python.factory.creator.solar_model.SolarAbsorptionAndContinuum.doppler
doppler
Definition:
solar_model.py:10
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.time
time
Definition:
solar_model.py:23
Python.factory.param.InstanceOf
Definition:
param.py:124
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.solar_zenith
solar_zenith
Definition:
solar_model.py:25
Python.factory.creator.solar_model.SolarContinuumTable
Definition:
solar_model.py:59
Python.factory.creator.solar_model.SolarAbsorptionAndContinuum
Definition:
solar_model.py:8
Python.factory.creator.solar_model.SolarAbsorptionTable.create
def create(self, kwargs)
Definition:
solar_model.py:51
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.create
def create(self, kwargs)
Definition:
solar_model.py:31
Python.factory.creator.solar_model.SolarDopplerShiftPolynomial.surface_height
surface_height
Definition:
solar_model.py:27
Python.factory.creator.solar_model.SolarAbsorptionTable
Definition:
solar_model.py:46
Python.factory.creator.solar_model.SolarContinuumTable.solar_data_file
solar_data_file
Definition:
solar_model.py:61
Python.factory.creator.solar_model.SolarAbsorptionAndContinuum.continuum
continuum
Definition:
solar_model.py:12
Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10