ReFRACtor
met.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
ValueFromMet
(
Creator
):
9
"Extracts the surface pressure value from the attached meterological file"
10
11
met =
param.InstanceOf
(rf.Meteorology)
12
field =
param.Scalar
(str)
13
14
def
create
(self, **kwargs):
15
16
field_val = getattr(self.
met
(), self.
field
())
17
if
np.isscalar(field_val):
18
return
np.full(1, field_val)
19
else
:
20
return
field_val
Python.factory.creator.met.ValueFromMet.create
def create(self, kwargs)
Definition:
met.py:14
Python.factory.creator.met.ValueFromMet
Definition:
met.py:8
Python.factory.param.Scalar
Definition:
param.py:72
Python.factory.creator.met.ValueFromMet.field
field
Definition:
met.py:12
Python.factory.creator.base.Creator
Definition:
base.py:56
Python.factory.param.InstanceOf
Definition:
param.py:124
Python.factory.creator.met.ValueFromMet.met
met
Definition:
met.py:11
Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10