Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
b42bb709
Commit
b42bb709
authored
2 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-2344
: only loop over unique gridded timestamps
parent
ed006d37
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1075
TMSS-2344
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/services/scheduling/lib/constraints.py
+6
-6
6 additions, 6 deletions
SAS/TMSS/backend/services/scheduling/lib/constraints.py
with
6 additions
and
6 deletions
SAS/TMSS/backend/services/scheduling/lib/constraints.py
+
6
−
6
View file @
b42bb709
...
@@ -904,15 +904,15 @@ def evaluate_sky_min_elevation_constraint(scheduling_unit: models.SchedulingUnit
...
@@ -904,15 +904,15 @@ def evaluate_sky_min_elevation_constraint(scheduling_unit: models.SchedulingUnit
# evaluate at start/stop/center of observation
# evaluate at start/stop/center of observation
# take along the relative start_time of this task compared to the scheduling unit's start_time
# take along the relative start_time of this task compared to the scheduling unit's start_time
# currently we only check at bounds and center, we probably want to add some more samples in between later on
task_proposed_start_time
=
proposed_start_time
+
task
.
relative_start_time
task_proposed_start_time
=
proposed_start_time
+
task
.
relative_start_time
task_proposed_end_time
=
task_proposed_start_time
+
task
.
specified_duration
task_proposed_center_time
=
task_proposed_start_time
+
task
.
specified_duration
/
2
task_proposed_center_time
=
task_proposed_start_time
+
task
.
specified_duration
/
2
task_proposed_end_time
=
task_proposed_start_time
+
task
.
specified_duration
gridded_timestamps
=
set
([
gridder
.
grid_time
(
t
)
for
t
in
(
task_proposed_start_time
,
task_proposed_center_time
,
task_proposed_end_time
)])
# currently we only check at bounds and center, we probably want to add some more samples in between later on
for
gridded_timestamp
in
gridded_timestamps
:
for
timestamp
in
(
task_proposed_start_time
,
task_proposed_center_time
,
task_proposed_end_time
):
for
station
in
stations
:
for
station
in
stations
:
for
pointing
,
min_elevation
in
pointings_and_min_elevations
:
for
pointing
,
min_elevation
in
pointings_and_min_elevations
:
gridded_timestamp
=
gridder
.
grid_time
(
timestamp
)
station_target_rise_and_set_times
=
coordinates_timestamps_and_stations_to_target_rise_and_set
(
pointing
=
pointing
,
station_target_rise_and_set_times
=
coordinates_timestamps_and_stations_to_target_rise_and_set
(
pointing
=
pointing
,
timestamps
=
(
gridded_timestamp
,),
timestamps
=
(
gridded_timestamp
,),
stations
=
(
station
,),
stations
=
(
station
,),
...
@@ -940,8 +940,8 @@ def evaluate_sky_min_elevation_constraint(scheduling_unit: models.SchedulingUnit
...
@@ -940,8 +940,8 @@ def evaluate_sky_min_elevation_constraint(scheduling_unit: models.SchedulingUnit
# check if constraint is met...
# check if constraint is met...
if
rise_and_set_time
[
'
always_below_horizon
'
]
or
\
if
rise_and_set_time
[
'
always_below_horizon
'
]
or
\
(
rise_and_set_time
[
'
rise
'
]
is
not
None
and
timestamp
<
gridder
.
minus_margin
(
rise_and_set_time
[
'
rise
'
]))
or
\
(
rise_and_set_time
[
'
rise
'
]
is
not
None
and
gridded_
timestamp
<
gridder
.
minus_margin
(
rise_and_set_time
[
'
rise
'
]))
or
\
(
rise_and_set_time
[
'
set
'
]
is
not
None
and
timestamp
>
gridder
.
plus_margin
(
rise_and_set_time
[
'
set
'
])):
(
rise_and_set_time
[
'
set
'
]
is
not
None
and
gridded_
timestamp
>
gridder
.
plus_margin
(
rise_and_set_time
[
'
set
'
])):
elevation
=
compute_elevation
(
pointing
,
gridded_timestamp
,
station
)
elevation
=
compute_elevation
(
pointing
,
gridded_timestamp
,
station
)
if
elevation
<
min_elevation
.
rad
:
if
elevation
<
min_elevation
.
rad
:
# constraint not met. update result, and do early exit.
# constraint not met. update result, and do early exit.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment