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
6da7feaa
Commit
6da7feaa
authored
Jan 14, 2020
by
sarrvesh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show error while trying to demix more than 2 sources
parent
56088cc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
backend.py
backend.py
+10
-1
calculator.py
calculator.py
+2
-1
No files found.
backend.py
View file @
6da7feaa
...
...
@@ -103,7 +103,7 @@ def calculate_proc_size(obs_t, int_time, n_baselines, n_chan, n_sb, pipe_type,
return
'{:0.2f}'
.
format
(
tot_size
)
def
validate_inputs
(
obs_t
,
n_core
,
n_remote
,
n_int
,
n_sb
,
integ_t
,
t_avg
,
f_avg
,
src_name
,
coord
,
hba_mode
):
f_avg
,
src_name
,
coord
,
hba_mode
,
pipe_type
,
ateam_names
):
"""Valid text input supplied by the user: observation time, number of
subbands, and integration time. Following checks will be performed:
- obs_time is a valid positive number
...
...
@@ -118,6 +118,7 @@ def validate_inputs(obs_t, n_core, n_remote, n_int, n_sb, integ_t, t_avg,
- src_name is a string
- coord is a valid AstroPy coordinate
- While observing with HBA, check if the targets are inside the tile beam.
- ateam_names <= 2 if pipe_type is not "None"
Return state=True/False accompanied by an error msg
Note: all input parameters are still strings."""
msg
=
''
...
...
@@ -163,6 +164,14 @@ def validate_inputs(obs_t, n_core, n_remote, n_int, n_sb, integ_t, t_avg,
int
(
str
(
f_avg
))
except
ValueError
:
msg
+=
'Invalid frequency averaging factor specified.'
# Validate the number of A-team sources if a pipeline is specified
# Figure out the number of ateam sources specified
if
ateam_names
==
None
:
n_ateams
=
0
else
:
n_ateams
=
len
(
ateam_names
)
if
pipe_type
!=
'none'
and
n_ateams
>
2
:
msg
+=
'Cannot demix more than two A-team sources.'
# Validate the coordinates specified under target setup
if
coord
is
not
''
:
# Warn if the number of targets do not match the number of coordinates
...
...
calculator.py
View file @
6da7feaa
...
...
@@ -300,7 +300,8 @@ def on_calculate_click(n, n_clicks, obs_t, n_core, n_remote, n_int, n_chan, n_sb
n_int
=
'0'
status
,
msg
=
bk
.
validate_inputs
(
obs_t
,
int
(
n_core
),
int
(
n_remote
),
\
int
(
n_int
),
n_sb
,
integ_t
,
t_avg
,
f_avg
,
\
src_name
,
coord
,
hba_mode
)
src_name
,
coord
,
hba_mode
,
pipe_type
,
\
ateam_names
)
if
status
is
False
:
return
''
,
''
,
''
,
''
,
msg
,
True
,
\
{
'display'
:
'none'
},
{},
{
'display'
:
'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