Skip to content

Commit

Permalink
layers ts sample
Browse files Browse the repository at this point in the history
IssueID #1988: Review - Ionosphere layers - always show layers
IssueID #1960: ionosphere_layers

Return the anomalous_timeseries as an array to sample and just use the
ts_json file if there is no ionosphere_json_file

Modified:
skyline/webapp/ionosphere_backend.py
  • Loading branch information
earthgecko committed Nov 29, 2017
1 parent 50e4002 commit 9846b8a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions skyline/webapp/ionosphere_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,10 @@ def new_load_metric_vars(metric_vars_file):
ts_json = ['error: no timeseries json file', ts_json_file]
if path.isfile(ts_json_file):
try:
ts_json = []
# ts_json = []
with open(ts_json_file) as f:
for line in f:
ts_json.append(line)

ts_json_ok = True
except:
ts_json_ok = False
Expand Down Expand Up @@ -538,6 +537,15 @@ def new_load_metric_vars(metric_vars_file):
anomalous_timeseries = literal_eval(timeseries_array_str)
except:
ionosphere_json_ok = False
# @added 20171130 - Task #1988: Review - Ionosphere layers - always show layers
# Feature #1960: ionosphere_layers
# Return the anomalous_timeseries as an array to sample and just use the
# ts_json file if there is no ionosphere_json_file
if not anomalous_timeseries:
with open((ts_json_file), 'r') as f:
raw_timeseries = f.read()
timeseries_array_str = str(raw_timeseries).replace('(', '[').replace(')', ']')
anomalous_timeseries = literal_eval(timeseries_array_str)

# @added 20170308 - Feature #1960: ionosphere_layers
if layers_id_matched_file:
Expand Down

0 comments on commit 9846b8a

Please sign in to comment.