Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG Fix leftover references to ETA_STR #126

Merged
merged 3 commits into from
Jan 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions aospy/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ def __init__(self, proj=None, model=None, run=None, ens_mem=None, var=None,
- Averages over each region specified via `region`:

- 'reg.av', 'reg.std', 'reg.ts' : analogous to 'av', 'std', 'ts'

dtype_out_vert : {None, 'vert_av', 'vert_int'}, optional
How to reduce the data vertically:

- None : no vertical reduction (i.e. output is defined vertically)
- 'vert_av' : mass-weighted vertical average
- 'vert_int' : mass-weighted vertical integral

"""

# TODO: This tuple-izing is for support of calculations where variables
# come from different runs. However, this is a very fragile way
# of implementing that functionality. Eventually it will be
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(self, proj=None, model=None, run=None, ens_mem=None, var=None,
class Calc(object):
"""Class for executing, saving, and loading a single computation.

Calc objects are instantiated with a single argument: a `CalcInterface`
Calc objects are instantiated with a single argument: a `CalcInterface`
object that includes all of the parameters necessary to determine what
calculations to perform.
"""
Expand Down Expand Up @@ -419,7 +419,7 @@ def _get_input_data(self, var, start_date, end_date, n):
set_dt = True if not hasattr(self, 'dt') else False
cond_pfull = ((not hasattr(self, internal_names.PFULL_STR))
and var.def_vert and
self.dtype_in_vert == ETA_STR)
self.dtype_in_vert == internal_names.ETA_STR)
data = self.data_loader.load_variable(var, start_date, end_date,
self.time_offset,
**self.data_loader_attrs)
Expand All @@ -439,7 +439,7 @@ def _get_input_data(self, var, start_date, end_date, n):
pass
# Force all data to be at full pressure levels, not half levels.
bool_to_pfull = (self.dtype_in_vert == internal_names.ETA_STR and
var.def_vert == internal_names.PFULL_STR)
var.def_vert == internal_names.PHALF_STR)
if bool_to_pfull:
data = utils.vertcoord.to_pfull_from_phalf(data,
self.pfull_coord)
Expand Down Expand Up @@ -779,7 +779,7 @@ def _get_data_subset(self, data, region=False, time=False,
if 'monthly_from_' in self.dtype_in_time:
data = np.mean(data, axis=0)[np.newaxis, :]
if np.any(vert):
if self.dtype_in_vert == ETA_STR:
if self.dtype_in_vert == internal_names.ETA_STR:
data = data[{PFULL_STR: vert}]
else:
if np.max(self.model[n].level) > 1e4:
Expand Down