Skip to content

Commit

Permalink
Merge pull request #76 from lsst-ts/tickets/DM-44028
Browse files Browse the repository at this point in the history
DM-44028: Support Summit Observing Weeks 17-18 of 2024
  • Loading branch information
tribeiro authored May 21, 2024
2 parents 89864d1 + 1b099d7 commit ec73ecf
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Install
run: |
$CONDA/bin/conda install -c lsstts ts-pre-commit-config -y
$CONDA/bin/conda install -c lsstts python=3.11 ts-pre-commit-config -y
- name: Generate pre commit configuration
run: |
Expand Down
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pipeline {
source ${env.SAL_SETUP_FILE}
cd ${env.WHOME}/ts_wep/
${env.SAL_USERS_HOME}/.checkout_repo.sh \${WORK_BRANCHES}
setup -k -r .
echo Checkout wep lfs data
Expand Down
21 changes: 21 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
Version History
===============

v0.13.3
-------

* Update Jenkinsfile to checkout the work branches for ts_wep.

* Update lint github action to pin python 3.11.

* In mtaos, update do_runOFC to allow users to pass in configuration.

* In model.py, update call to query datasets from the butler to retrieve the wavefront errors.

* Update unit tests to conform with latest changes in wep.

* In config_schema, remove configuration option from cutout pipeline.

* In ``utility.py``, mark ``getCamType`` as deprecated.

* In mtaos, pass data instrument name to the model class if it is defined in the configuration.

* In config_schema, add option to override the data instrument name.

v0.13.2
-------

Expand Down
20 changes: 14 additions & 6 deletions python/lsst/ts/mtaos/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@
type: string
additionalProperties: false
data_instrument_name:
description: >-
A dictionary that maps the name of the instrument to the name used in
the pipeline task.
type: object
properties:
comcam:
type: string
lsstCam:
type: string
lsstFamCam:
type: string
additionalProperties: false
pipeline_n_processes:
description: Number of processes to use when running pipeline.
type: integer
Expand Down Expand Up @@ -373,9 +387,6 @@
type: object
additionalProperties: false
properties:
donutTemplateSize:
type: integer
default: 160
donutStampSize:
type: integer
default: 160
Expand Down Expand Up @@ -404,9 +415,6 @@
type: object
additionalProperties: false
properties:
donutTemplateSize:
type: integer
default: 160
donutStampSize:
type: integer
default: 160
Expand Down
3 changes: 0 additions & 3 deletions python/lsst/ts/mtaos/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,6 @@ def _gather_outputs(
# Get output
data_ids = butler.registry.queryDatasets(
self.zernike_table_name,
dataId=dict(
instrument=self.data_instrument_name[instrument], exposure=visit_id
),
collections=[run_name],
)

Expand Down
10 changes: 5 additions & 5 deletions python/lsst/ts/mtaos/mtaos.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ async def configure(self, config: typing.Any) -> None:
),
pipeline_n_processes=config.pipeline_n_processes,
zernike_table_name=config.zernike_table_name,
data_instrument_name=(
config.data_instrument_name
if hasattr(config, "data_instrument_name")
else None
),
)

if dof_state0 is not None:
Expand Down Expand Up @@ -532,11 +537,6 @@ async def do_runOFC(self, data):
result="runOFC started.",
)

if len(data.config) > 0:
raise NotImplementedError(
"User provided configuration overrides not supported yet."
)

async with self.issue_correction_lock:
if data.userGain != 0.0:
warnings.warn(
Expand Down
11 changes: 1 addition & 10 deletions python/lsst/ts/mtaos/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from lsst.daf.butler import Butler
from lsst.obs.base import DefineVisitsTask, Instrument
from lsst.obs.lsst.translators.lsstCam import LsstCamTranslator
from lsst.ts.wep.utils import CamType
from lsst.utils import getPackageDir


Expand Down Expand Up @@ -142,15 +141,7 @@ def getCamType(camera):
ValueError
The camera is not supported.
"""

if camera == "lsstCam":
return CamType.LsstCam
elif camera == "lsstFamCam":
return CamType.LsstFamCam
elif camera == "comcam":
return CamType.ComCam
else:
raise ValueError("The camera (%s) is not supported." % camera)
raise DeprecationWarning("This method is deprecated.")


def getCscName():
Expand Down
5 changes: 0 additions & 5 deletions tests/test_configByFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import unittest

from lsst.ts import mtaos
from lsst.ts.wep.utils import CamType


class TestConfigByFile(unittest.TestCase):
Expand All @@ -41,10 +40,6 @@ def tearDown(self):
except KeyError:
pass

def testGetCamType(self):
camType = self.config.getCamType()
self.assertEqual(camType, CamType.ComCam)

def testGetInstName(self):
instName = self.config.getInstName()
self.assertEqual(instName, "comcam")
Expand Down
5 changes: 0 additions & 5 deletions tests/test_configByObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import unittest

from lsst.ts import mtaos
from lsst.ts.wep.utils import CamType


class Config(object):
Expand Down Expand Up @@ -57,10 +56,6 @@ def tearDown(self):
except KeyError:
pass

def testGetCamType(self):
camType = self.configObj.getCamType()
self.assertEqual(camType, CamType.ComCam)

def testGetInstName(self):
instName = self.configObj.getInstName()
self.assertEqual(instName, "comcam")
Expand Down
10 changes: 3 additions & 7 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ def test_generate_wep_configuration(self):
"doOverscan": True,
}
expected_zernike_science_sensor_config = {
"donutTemplateSize": 160,
"donutStampSize": 160,
"initialCutoutPadding": 40,
}
Expand Down Expand Up @@ -371,7 +370,6 @@ def test_generate_wep_configuration_custom_donut_catalog_online(self):
}

expected_zernike_science_sensor_config = {
"donutTemplateSize": 160,
"donutStampSize": 160,
"initialCutoutPadding": 40,
}
Expand Down Expand Up @@ -416,7 +414,6 @@ def test_generate_wep_configuration_custom_isr(self):
"doOverscan": True,
}
expected_zernike_science_sensor_config = {
"donutTemplateSize": 160,
"donutStampSize": 160,
"initialCutoutPadding": 40,
}
Expand Down Expand Up @@ -460,7 +457,6 @@ def test_generate_wep_configuration_custom_zernike_science_sensor(self):
"doOverscan": True,
}
expected_zernike_science_sensor_config = {
"donutTemplateSize": 160,
"donutStampSize": 160,
"initialCutoutPadding": 80,
}
Expand Down Expand Up @@ -546,9 +542,9 @@ def assert_estimate_zernikes_science_sensor_task(
assert "CutOutDonutsScienceSensorTask" in wep_configuration["tasks"]
assert "calcZernikesTask" in wep_configuration["tasks"]
assert "config" in wep_configuration["tasks"]["CutOutDonutsScienceSensorTask"]
for config in set(
("donutTemplateSize", "donutStampSize", "initialCutoutPadding")
).union(expected_zernike_science_sensor_config):
for config in set(("donutStampSize", "initialCutoutPadding")).union(
expected_zernike_science_sensor_config
):
assert (
config
in wep_configuration["tasks"]["CutOutDonutsScienceSensorTask"]["config"]
Expand Down
8 changes: 0 additions & 8 deletions tests/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from lsst.obs.lsst.translators.lsstCam import LsstCamTranslator
from lsst.ts import mtaos
from lsst.ts.wep.task.cutOutDonutsCwfsTask import CutOutDonutsCwfsTask
from lsst.ts.wep.utils import CamType
from lsst.ts.wep.utils import getModulePath as getModulePathWep


Expand Down Expand Up @@ -76,13 +75,6 @@ def testGetIsrDirPath(self):

os.environ.pop("ISRDIRPATH")

def testGetCamType(self):
self.assertEqual(mtaos.getCamType("lsstCam"), CamType.LsstCam)
self.assertEqual(mtaos.getCamType("lsstFamCam"), CamType.LsstFamCam)
self.assertEqual(mtaos.getCamType("comcam"), CamType.ComCam)

self.assertRaises(ValueError, mtaos.getCamType, "wrongType")

def testGetCscName(self):
cscName = mtaos.getCscName()
self.assertEqual(cscName, "MTAOS")
Expand Down

0 comments on commit ec73ecf

Please sign in to comment.