Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 45610 #223

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/news/DM-45610.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``UnparkDome`` SAL Script for ``maintel``.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python
# This file is part of ts_standardscripts
#
# Developed for the LSST Telescope and Site Systems.
# 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/>.

import asyncio

from lsst.ts.standardscripts.maintel.mtdome import UnparkDome

asyncio.run(UnparkDome.amain())
1 change: 1 addition & 0 deletions python/lsst/ts/standardscripts/maintel/mtdome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from .enable_dome_following import *
from .park_dome import *
from .slew_dome import *
from .unpark_dome import *
62 changes: 62 additions & 0 deletions python/lsst/ts/standardscripts/maintel/mtdome/unpark_dome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This file is part of ts_standardscripts
#
# Developed for the LSST Telescope and Site Systems.
# 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/>.

__all__ = ["UnparkDome"]

from lsst.ts import salobj
from lsst.ts.observatory.control.maintel.mtcs import MTCS


class UnparkDome(salobj.BaseScript):
"""Unpark Dome for the MTDome.

Parameters
----------
index : `int`
Index of Script SAL component.

Notes
-----
**Checkpoints**

None

"""

def __init__(self, index):
super().__init__(index=index, descr="Unpark Dome for the MTDome.")

self.mtcs = None

@classmethod
def get_schema(cls):
# This script does not require any configuration
return None

async def configure(self, config):
if self.mtcs is None:
self.mtcs = MTCS(domain=self.domain, log=self.log)

def set_metadata(self, metadata):
metadata.duration = 5.0

async def run(self):
await self.mtcs.unpark_dome()
38 changes: 38 additions & 0 deletions tests/test_maintel_unpark_dome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file is part of ts_standardscripts
#
# Developed for the LSST Telescope and Site Systems.
# 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/>.

import unittest

from lsst.ts import standardscripts
from lsst.ts.standardscripts.maintel.mtdome import UnparkDome


class TestUnparkDome(
standardscripts.BaseScriptTestCase, unittest.IsolatedAsyncioTestCase
):
async def basic_make_script(self, index):
self.script = UnparkDome(index=index)
return self.script

async def test_executable(self):
scripts_dir = standardscripts.get_scripts_dir()
script_path = scripts_dir / "maintel" / "mtdome" / "unpark_dome.py"
await self.check_executable(script_path)
Loading