Commit 632e1616 authored by sarrvesh's avatar sarrvesh

add beamformed details to pdf

parent dfd45a41
...@@ -276,13 +276,17 @@ def on_resolve_click(n, close_msg_box, target_name, is_open): ...@@ -276,13 +276,17 @@ def on_resolve_click(n, close_msg_box, target_name, is_open):
State('elevation-plot', 'figure'), State('elevation-plot', 'figure'),
State('distance-table', 'figure'), State('distance-table', 'figure'),
State('dateRow', 'date') State('dateRow', 'date'),
State('obsModeRow', 'value'),
State('tabModeRow', 'value'),
State('stokesRow', 'value')
] ]
) )
def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_chan, def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_chan,
n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg, is_dysco, n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg, is_dysco,
im_noise_val, raw_size, proc_size, pipe_time, is_msg_box_open, im_noise_val, raw_size, proc_size, pipe_time, is_msg_box_open,
elevation_fig, distance_table, obs_date): elevation_fig, distance_table, obs_date, obs_mode, tab_mode, stokes):
"""Function defines what to do when the generate pdf button is clicked""" """Function defines what to do when the generate pdf button is clicked"""
if is_msg_box_open is True and close_msg_box is not None: if is_msg_box_open is True and close_msg_box is not None:
# The message box is open and the user has clicked the close # The message box is open and the user has clicked the close
...@@ -305,7 +309,8 @@ def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_c ...@@ -305,7 +309,8 @@ def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_c
g.generate_pdf(rel_path, obs_t, n_core, n_remote, n_int, n_chan, g.generate_pdf(rel_path, obs_t, n_core, n_remote, n_int, n_chan,
n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg, n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg,
is_dysco, im_noise_val, raw_size, proc_size, pipe_time, is_dysco, im_noise_val, raw_size, proc_size, pipe_time,
elevation_fig, distance_table, obs_date) elevation_fig, distance_table, obs_date,
obs_mode, tab_mode, stokes)
return {'display':'block'}, '/luci/{}'.format(rel_path), False return {'display':'block'}, '/luci/{}'.format(rel_path), False
@app.server.route('/luci/static/<resource>') @app.server.route('/luci/static/<resource>')
......
...@@ -74,7 +74,7 @@ def make_pdf_plot(elevation_fig, outfilename): ...@@ -74,7 +74,7 @@ def make_pdf_plot(elevation_fig, outfilename):
def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t, def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t,
antenna_set, pipe_type, t_avg, f_avg, is_dysco, im_noise_val, antenna_set, pipe_type, t_avg, f_avg, is_dysco, im_noise_val,
raw_size, proc_size, pipe_time, elevation_fig, distance_table, raw_size, proc_size, pipe_time, elevation_fig, distance_table,
obs_date): obs_date, obs_mode, tab_mode, stokes):
"""Function to generate a pdf file summarizing the content of the calculator. """Function to generate a pdf file summarizing the content of the calculator.
Return nothing.""" Return nothing."""
# Create an A4 sheet # Create an A4 sheet
...@@ -87,9 +87,26 @@ def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t ...@@ -87,9 +87,26 @@ def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t
string += '<thead><tr><th width="70%" align="left">Parameter</th>' string += '<thead><tr><th width="70%" align="left">Parameter</th>'
string += '<th width="30%" align="left">Value</th></tr></thead>' string += '<th width="30%" align="left">Value</th></tr></thead>'
string += '<tbody>' string += '<tbody>'
if obs_mode == 'Interferometric':
string += '<tr><td>Observation mode</td>'
string += ' <td>Interferometric</td></tr>'
else:
string += '<tr><td>Observation mode</td>'
string += ' <td>Beamformed</td></tr>'
string += '<tr><td>Tied array mode</td>'
string += ' <td>{}</td></tr>'.format(tab_mode)
string += '<tr><td>Stokes products to record</td>'
string += ' <td>{}</td></tr>'.format(stokes)
string += '<tr></tr>'
string += '<tr><td>Observation time (in seconds)</td>' string += '<tr><td>Observation time (in seconds)</td>'
string += ' <td>{}</td></tr>'.format(obs_t) string += ' <td>{}</td></tr>'.format(obs_t)
string += '<tr><td>No. of stations</td>' string += '<tr><td>No. of stations</td>'
if obs_mode == 'Beamformed' and tab_mode == 'Coherent':
string += ' <td>({}, {}, {})</td></tr>'.format(n_core, 0, 0)
else:
string += ' <td>({}, {}, {})</td></tr>'.format(n_core, n_remote, n_int) string += ' <td>({}, {}, {})</td></tr>'.format(n_core, n_remote, n_int)
string += '<tr><td>No. of subbands</td>' string += '<tr><td>No. of subbands</td>'
string += ' <td>{}</td></tr>'.format(n_sb) string += ' <td>{}</td></tr>'.format(n_sb)
...@@ -118,6 +135,7 @@ def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t ...@@ -118,6 +135,7 @@ def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t
string += ' <td>{}</td></tr>'.format('enabled') string += ' <td>{}</td></tr>'.format('enabled')
else: else:
string += ' <td>{}</td></tr>'.format('disabled') string += ' <td>{}</td></tr>'.format('disabled')
if obs_mode == 'Interferometric':
string += '<tr></tr>' string += '<tr></tr>'
string += '<tr><td>Theoretical image sensitivity (uJy/beam)</td>' string += '<tr><td>Theoretical image sensitivity (uJy/beam)</td>'
string += ' <td>{}</td></tr>'.format(im_noise_val) string += ' <td>{}</td></tr>'.format(im_noise_val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment