From 0b7bbc4001b12b4b93da1bc941f8f86bfaa62739 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Thu, 21 Nov 2024 09:25:37 -0700 Subject: [PATCH] MTScheduler: Add configuration for pointing model survey. --- .../maintel/fbs_config_ptg_model.py | 90 ++++++++++++++++ .../observing_blocks_maintel/BLOCK-324.json | 100 ++++++++++++++++++ .../observing_blocks_maintel/BLOCK-328.json | 35 ++++++ Scheduler/v7/maintel_fbs_ptg_model.yaml | 48 +++++++++ 4 files changed, 273 insertions(+) create mode 100644 Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py create mode 100644 Scheduler/observing_blocks_maintel/BLOCK-324.json create mode 100644 Scheduler/observing_blocks_maintel/BLOCK-328.json create mode 100644 Scheduler/v7/maintel_fbs_ptg_model.yaml diff --git a/Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py b/Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py new file mode 100644 index 00000000..e7bb40e1 --- /dev/null +++ b/Scheduler/feature_scheduler/maintel/fbs_config_ptg_model.py @@ -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 . + +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() diff --git a/Scheduler/observing_blocks_maintel/BLOCK-324.json b/Scheduler/observing_blocks_maintel/BLOCK-324.json new file mode 100644 index 00000000..3ee3d7d5 --- /dev/null +++ b/Scheduler/observing_blocks_maintel/BLOCK-324.json @@ -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": "" +} \ No newline at end of file diff --git a/Scheduler/observing_blocks_maintel/BLOCK-328.json b/Scheduler/observing_blocks_maintel/BLOCK-328.json new file mode 100644 index 00000000..bfddf7e7 --- /dev/null +++ b/Scheduler/observing_blocks_maintel/BLOCK-328.json @@ -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": "" +} \ No newline at end of file diff --git a/Scheduler/v7/maintel_fbs_ptg_model.yaml b/Scheduler/v7/maintel_fbs_ptg_model.yaml new file mode 100644 index 00000000..5efe6750 --- /dev/null +++ b/Scheduler/v7/maintel_fbs_ptg_model.yaml @@ -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 +