Skip to content

Commit

Permalink
MTScheduler: Add configuration for pointing model survey.
Browse files Browse the repository at this point in the history
  • Loading branch information
tribeiro committed Nov 21, 2024
1 parent 4af21b5 commit 09bd473
Show file tree
Hide file tree
Showing 6 changed files with 411 additions and 0 deletions.
90 changes: 90 additions & 0 deletions Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This file is part of ts_config_ocs.
#
# Developed for the Vera Rubin Observatory Telescope and Site System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from lsst.ts.fbs.utils.maintel.make_fieldsurvey_scheduler import (
MakeFieldSurveyScheduler,
)
from rubin_scheduler.scheduler import basis_functions, detailers


def get_scheduler():
"""Construct feature based scheduler.
Returns
-------
nside : int
Healpix map resolution.
scheduler : Core_scheduler
Feature based scheduler.
"""

nside = 32

make_scheduler = MakeFieldSurveyScheduler(nside=nside, ntiers=1)

nvisits = {"u_02": 0, "g_01": 0, "r_03": 1, "i_06": 0, "z_03": 0, "y": 0}
sequence = ["r_03"]
# exposure time in seconds
exptimes = {"u_02": 38, "g_01": 30, "r_03": 15, "i_06": 30, "z_03": 30, "y": 30}
# 1 --> single 30 second exposuree
nexps = {"u_02": 1, "g_01": 1, "r_03": 1, "i_06": 1, "z_03": 1, "y": 1}

min_alt = 40.0

field_survey_kwargs = {
"nvisits": nvisits,
"sequence": sequence,
"exptimes": exptimes,
"nexps": nexps,
}

config_basis_functions = [
basis_functions.AltAzShadowMaskBasisFunction(
nside=nside,
min_alt=min_alt,
max_alt=83.0,
shadow_minutes=2.0,
),
]

config_detailers = [detailers.AltAz2RaDecDetailer()]

observation_reason = "ptg_model"
science_program = "BLOCK-328" # json BLOCK to be used
survey_name = science_program # match nextVisit metadata

tier = 0

make_scheduler.add_field_altaz_surveys(
tier,
observation_reason,
science_program,
survey_name=survey_name,
basis_functions=config_basis_functions,
detailers=config_detailers,
**field_survey_kwargs,
)

return make_scheduler.get_scheduler()


if __name__ == "config":
nside, scheduler = get_scheduler()
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This file is part of ts_config_ocs.
#
# Developed for the Vera Rubin Observatory Telescope and Site System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from lsst.ts.fbs.utils.maintel.make_fieldsurvey_scheduler import (
MakeFieldSurveyScheduler,
)
from rubin_scheduler.scheduler import basis_functions, detailers


def get_scheduler():
"""Construct feature based scheduler.
Returns
-------
nside : int
Healpix map resolution.
scheduler : Core_scheduler
Feature based scheduler.
"""

nside = 32

make_scheduler = MakeFieldSurveyScheduler(nside=nside, ntiers=1)

nvisits = {"u_02": 0, "g_01": 0, "r_03": 1, "i_06": 0, "z_03": 0, "y": 0}
sequence = ["r_03"]
# exposure time in seconds
exptimes = {"u_02": 38, "g_01": 30, "r_03": 15, "i_06": 30, "z_03": 30, "y": 30}
# 1 --> single 30 second exposuree
nexps = {"u_02": 1, "g_01": 1, "r_03": 1, "i_06": 1, "z_03": 1, "y": 1}

min_alt = 40.0

field_survey_kwargs = {
"nvisits": nvisits,
"sequence": sequence,
"exptimes": exptimes,
"nexps": nexps,
}

config_basis_functions = [
basis_functions.AltAzShadowMaskBasisFunction(
nside=nside,
min_alt=min_alt,
max_alt=83.0,
shadow_minutes=2.0,
),
]

config_detailers = [detailers.AltAz2RaDecDetailer()]

observation_reason = "ptg_model"
science_program = "BLOCK-324" # json BLOCK to be used
survey_name = science_program # match nextVisit metadata

tier = 0

make_scheduler.add_field_altaz_surveys(
tier,
observation_reason,
science_program,
survey_name=survey_name,
basis_functions=config_basis_functions,
detailers=config_detailers,
**field_survey_kwargs,
)

return make_scheduler.get_scheduler()


if __name__ == "config":
nside, scheduler = get_scheduler()
100 changes: 100 additions & 0 deletions Scheduler/observing_blocks_maintel/BLOCK-324.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "PtgModel",
"id": "30f42f3f-56b0-4d87-94ef-cddb21a802af",
"program": "BLOCK-324",
"constraints": [],
"scripts": [
{
"name": "maintel/track_target.py",
"standard": true,
"parameters": {
"target_name": "$name",
"slew_icrs": {
"ra": "$ra",
"dec": "$dec"
},
"rot_value": "$rot",
"rot_type": "PhysicalSky",
"az_wrap_strategy": "NOUNWRAP"
}
},
{
"name": "maintel/close_loop_comcam.py",
"standard": true,
"parameters": {
"exposure_time": 15,
"max_iter": 2,
"gain_sequence": [
0.75,
0.5
],
"mode": "FAM",
"program": "$program",
"note": "pointing_lut_closed_loop",
"reason": "PtgModel",
"used_dofs": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46
],
"apply_corrections": true,
"use_ocps": true
}
},
{
"name": "maintel/take_image_comcam.py",
"standard": true,
"parameters": {
"image_type": "ACQ",
"nimages": 1,
"exp_times": 15,
"reason": "PtgModel",
"program": "$program",
"filter": "r_03"
}
}
],
"configuration_schema": ""
}
35 changes: 35 additions & 0 deletions Scheduler/observing_blocks_maintel/BLOCK-328.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "PtgModel",
"id": "9692b87d-2f09-4c30-8aec-fe52a0a70864",
"program": "BLOCK-328",
"constraints": [],
"scripts": [
{
"name": "maintel/track_target.py",
"standard": true,
"parameters": {
"target_name": "$name",
"slew_icrs": {
"ra": "$ra",
"dec": "$dec"
},
"rot_value": "$rot",
"rot_type": "PhysicalSky",
"az_wrap_strategy": "NOUNWRAP"
}
},
{
"name": "maintel/take_image_comcam.py",
"standard": true,
"parameters": {
"image_type": "ACQ",
"nimages": 1,
"exp_times": 15,
"reason": "PtgModel",
"program": "$program",
"filter": "r_03"
}
}
],
"configuration_schema": ""
}
48 changes: 48 additions & 0 deletions Scheduler/v7/maintel_fbs_ptg_model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
maintel:
driver_type: feature_scheduler
mode: ADVANCE
startup_type: COLD
startup_database: /home/saluser/rubin_sim_data/fbs_observation_database.sql
instrument_name: CCCamera
models:
observatory_model:
camera:
filter_max_changes_burst_num: 1
filter_max_changes_avg_num: 30000
optics_loop_corr:
tel_optics_cl_alt_limit:
- 0
- 60
- 90
park:
filter_position: r_03
driver_configuration:
parameters:
night_boundary: -10.0
stop_tracking_observing_script_name: maintel/stop_tracking.py
feature_scheduler_driver_configuration:
observation_database_name: /home/saluser/rubin_sim_data/fbs_observation_database.sql
scheduler_config: /net/obs-env/auto_base_packages/ts_config_ocs/Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py
telemetry:
streams:
- name: seeing
efd_table: lsst.sal.DIMM.logevent_dimmMeasurement
efd_columns:
- fwhm
efd_delta_time: 300.0
fill_value: 1.0
- name: wind_speed
efd_table: lsst.sal.ESS.airFlow
efd_columns:
- speed
efd_delta_time: 300.0
fill_value: 0.0
csc_index: 301
- name: wind_direction
efd_table: lsst.sal.ESS.airFlow
efd_columns:
- direction
efd_delta_time: 300.0
fill_value: 0.0
csc_index: 301

Loading

0 comments on commit 09bd473

Please sign in to comment.