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 
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

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