Skip to content
Snippets Groups Projects
Commit 73ab2554 authored by Coda Phillips's avatar Coda Phillips
Browse files

Rename output files

parent ecc6d8f5
No related branches found
No related tags found
No related merge requests found
import netCDF4 import netCDF4
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import mpld3 import mpld3
from aeri_tools.io.dmv.housekeeping import get_all_housekeeping from aeri_tools.io.dmv.housekeeping import get_all_housekeeping
...@@ -17,15 +19,15 @@ global_ftp_dir = None ...@@ -17,15 +19,15 @@ global_ftp_dir = None
@app.route('/') @app.route('/')
def index(): def index():
ae_dirs = glob(os.path.join(global_ftp_dir, 'AE*/*.qc')) ae_dirs = glob(os.path.join(global_ftp_dir, 'AE*/*QC.nc'))
ae_dirs = [a.lstrip('/') for a in ae_dirs] ae_dirs = [a.lstrip('/') for a in ae_dirs]
return flask.render_template('index.html', ae_dirs=ae_dirs) return flask.render_template('index.html', ae_dirs=ae_dirs)
@app.route('/qc/<path:qc_path>') @app.route('/qc/<path:qc_path>')
def qc_day(qc_path): def qc_day(qc_path):
qc_path = '/'+qc_path qc_path = '/'+qc_path
cxs_path = qc_path.replace('.qc','B1.CXS') cxs_path = qc_path.replace('QC.nc','B1.CXS')
sum_path = qc_path.replace('.qc','.SUM') sum_path = qc_path.replace('QC.nc','.SUM')
cxs = get_all_housekeeping(cxs_path) cxs = get_all_housekeeping(cxs_path)
frame = cxs.combine_first(get_all_housekeeping(sum_path)) frame = cxs.combine_first(get_all_housekeeping(sum_path))
...@@ -114,5 +116,5 @@ if __name__ == '__main__': ...@@ -114,5 +116,5 @@ if __name__ == '__main__':
generate_all_plots(os.path.abspath(args.ftp)) generate_all_plots(os.path.abspath(args.ftp))
else: else:
global_ftp_dir = os.path.abspath(args.ftp) global_ftp_dir = os.path.abspath(args.ftp)
app.run(debug=True) app.run('0.0.0.0', debug=True)
...@@ -75,7 +75,7 @@ def update_all(ftp_dir, parameters=None): ...@@ -75,7 +75,7 @@ def update_all(ftp_dir, parameters=None):
def files_to_update(cxs_files, update_only=True): def files_to_update(cxs_files, update_only=True):
for cxs_file in cxs_files: for cxs_file in cxs_files:
possible_sum = os.path.join(os.path.dirname(cxs_file), cxs_file.replace('B1.CXS','.SUM')) possible_sum = os.path.join(os.path.dirname(cxs_file), cxs_file.replace('B1.CXS','.SUM'))
possible_qc = os.path.join(os.path.dirname(cxs_file), cxs_file.replace('B1.CXS','.qc')) possible_qc = os.path.join(os.path.dirname(cxs_file), cxs_file.replace('B1.CXS','QC.nc'))
if os.path.isfile(possible_sum): if os.path.isfile(possible_sum):
sum_file = possible_sum sum_file = possible_sum
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment