Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
L
LOFAR-calculator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Astronomy and Operations
SDC Operations
LOFAR-calculator
Commits
632e1616
Commit
632e1616
authored
Sep 25, 2020
by
sarrvesh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add beamformed details to pdf
parent
dfd45a41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
calculator.py
calculator.py
+8
-3
generatepdf.py
generatepdf.py
+23
-5
No files found.
calculator.py
View file @
632e1616
...
...
@@ -276,13 +276,17 @@ def on_resolve_click(n, close_msg_box, target_name, is_open):
State
(
'elevation-plot'
,
'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
,
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
,
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"""
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
...
...
@@ -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
,
n_sb
,
integ_t
,
ant_set
,
pipe_type
,
t_avg
,
f_avg
,
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
@
app
.
server
.
route
(
'/luci/static/<resource>'
)
...
...
generatepdf.py
View file @
632e1616
...
...
@@ -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
,
antenna_set
,
pipe_type
,
t_avg
,
f_avg
,
is_dysco
,
im_noise_val
,
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.
Return nothing."""
# Create an A4 sheet
...
...
@@ -87,10 +87,27 @@ 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
+=
'<th width="30%" align="left">Value</th></tr></thead>'
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
+=
' <td>{}</td></tr>'
.
format
(
obs_t
)
string
+=
'<tr><td>No. of stations</td>'
string
+=
' <td>({}, {}, {})</td></tr>'
.
format
(
n_core
,
n_remote
,
n_int
)
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
+=
'<tr><td>No. of subbands</td>'
string
+=
' <td>{}</td></tr>'
.
format
(
n_sb
)
string
+=
'<tr><td>No. of channels per subband</td>'
...
...
@@ -118,9 +135,10 @@ 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'
)
else
:
string
+=
' <td>{}</td></tr>'
.
format
(
'disabled'
)
string
+=
'<tr></tr>'
string
+=
'<tr><td>Theoretical image sensitivity (uJy/beam)</td>'
string
+=
' <td>{}</td></tr>'
.
format
(
im_noise_val
)
if
obs_mode
==
'Interferometric'
:
string
+=
'<tr></tr>'
string
+=
'<tr><td>Theoretical image sensitivity (uJy/beam)</td>'
string
+=
' <td>{}</td></tr>'
.
format
(
im_noise_val
)
string
+=
'<tr><td>Raw data size (in GB)</td>'
string
+=
' <td>{}</td></tr>'
.
format
(
raw_size
)
if
pipe_type
!=
'none'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment