Skip to content

Commit

Permalink
Change StarTrackerNarrw to StarTrackerNarrow
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLuptonTheGood committed Mar 4, 2024
1 parent be54b45 commit 04be251
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 38 deletions.
6 changes: 1 addition & 5 deletions doc/lsst.obs.rubinGenericCamera/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ lsst.obs.rubinGenericCamera

The ``obs_rubinGenericCamera`` module defines Rubin generic camera specific configurations.

*N.b.*: the narrow field camera is called ``starTrackerNarrw`` (with a missing ``o``) due to ``butler``
name limits. These are being addressed with ``RFC-984``; once that's been implemented we should change
the name to ``starTrackerNarrow``.

.. Add subsections with toctree to individual topic pages.
.. _lsst.obs.lsst-contributing:
Expand All @@ -31,7 +27,7 @@ Start with some environment variables (my data's at USDF), and a list of the ins
LABEL="rhl-scr"
COLLBASE=u/rhl/tmp
instruments="StarTrackerNarrw StarTrackerWide StarTrackerFast"
instruments="StarTrackerNarrow StarTrackerWide StarTrackerFast"
Clean up from previous attempts and initialise the ``butler``
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: ISR for Rubin StarTrackers on the RSST
instrument: lsst.obs.rubinGenericCamera.StarTrackerNarrw
instrument: lsst.obs.rubinGenericCamera.StarTrackerNarrow

tasks:
isr:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
#

name : "StarTrackerNarrw"
name : "StarTrackerNarrow"
plateScale : 390.357 # arcsec/mm: MFL 1.44042 arcsec/pixel; 3.69 micron pixels (see pixelSize below)

# Provide transformations *from* the nativeSys *to* the specified system (e.g. FieldAngle)
Expand Down
20 changes: 10 additions & 10 deletions python/lsst/obs/rubinGenericCamera/_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__all__ = ("RubinGenericCamera", "StarTrackerNarrw", "StarTrackerWide", "StarTrackerFast")
__all__ = ("RubinGenericCamera", "StarTrackerNarrow", "StarTrackerWide", "StarTrackerFast")

import os.path

Expand All @@ -28,7 +28,7 @@
from lsst.obs.base import VisitSystem
from lsst.obs.lsst import LsstCam
from .filters import RUBIN_GENERIC_CAMERA_FILTER_DEFINITIONS
from .translator import StarTrackerNarrwTranslator, StarTrackerWideTranslator, StarTrackerFastTranslator
from .translator import StarTrackerNarrowTranslator, StarTrackerWideTranslator, StarTrackerFastTranslator

PACKAGE_DIR = getPackageDir("obs_rubinGenericCamera")

Expand Down Expand Up @@ -99,7 +99,7 @@ def extractDetectorRecord(self, camGeomDetector):
)


class StarTrackerNarrw(RubinGenericCamera):
class StarTrackerNarrow(RubinGenericCamera):
"""Specialization of Rubin Generic Camera for the narrow-field StarTracker
Parameters
Expand All @@ -110,18 +110,18 @@ class StarTrackerNarrw(RubinGenericCamera):
An ordered list of filters to define the set of PhysicalFilters
associated with this instrument in the registry.
"""
instrument = "StarTrackerNarrw"
policyName = "starTrackerNarrw"
translatorClass = StarTrackerNarrwTranslator
instrument = "StarTrackerNarrow"
policyName = "starTrackerNarrow"
translatorClass = StarTrackerNarrowTranslator

def getRawFormatter(self, dataId):
# Docstring inherited from Instrument.getRawFormatter
# local import to prevent circular dependency
from .rawFormatter import StarTrackerNarrwRawFormatter
return StarTrackerNarrwRawFormatter
from .rawFormatter import StarTrackerNarrowRawFormatter
return StarTrackerNarrowRawFormatter


class StarTrackerWide(StarTrackerNarrw):
class StarTrackerWide(StarTrackerNarrow):
"""Specialization of Rubin Generic Camera for the wide-field StarTracker
Parameters
Expand All @@ -143,7 +143,7 @@ def getRawFormatter(self, dataId):
return StarTrackerWideRawFormatter


class StarTrackerFast(StarTrackerNarrw):
class StarTrackerFast(StarTrackerNarrow):
"""Specialization of Rubin Generic Camera for the high-cadence Star Tracker
Parameters
Expand Down
12 changes: 6 additions & 6 deletions python/lsst/obs/rubinGenericCamera/rawFormatter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__all__ = ["StarTrackerNarrwRawFormatter", "StarTrackerWideRawFormatter", "StarTrackerFastRawFormatter",]
__all__ = ["StarTrackerNarrowRawFormatter", "StarTrackerWideRawFormatter", "StarTrackerFastRawFormatter",]

from .translator import StarTrackerNarrwTranslator, StarTrackerWideTranslator, StarTrackerFastTranslator
from .translator import StarTrackerNarrowTranslator, StarTrackerWideTranslator, StarTrackerFastTranslator
from lsst.obs.base import FitsRawFormatterBase
from .filters import RUBIN_GENERIC_CAMERA_FILTER_DEFINITIONS
from ._instrument import StarTrackerNarrw, StarTrackerWide, StarTrackerFast
from ._instrument import StarTrackerNarrow, StarTrackerWide, StarTrackerFast


class RubinGenericCameraRawFormatter(FitsRawFormatterBase):
Expand All @@ -15,9 +15,9 @@ def getDetector(self, id):
return self.cameraClass().getCamera()[id]


class StarTrackerNarrwRawFormatter(RubinGenericCameraRawFormatter):
cameraClass = StarTrackerNarrw
translatorClass = StarTrackerNarrwTranslator
class StarTrackerNarrowRawFormatter(RubinGenericCameraRawFormatter):
cameraClass = StarTrackerNarrow
translatorClass = StarTrackerNarrowTranslator


class StarTrackerWideRawFormatter(RubinGenericCameraRawFormatter):
Expand Down
10 changes: 5 additions & 5 deletions python/lsst/obs/rubinGenericCamera/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from lsst.utils import getPackageDir

__all__ = ["StarTrackerNarrwTranslator", "StarTrackerWideTranslator", "StarTrackerFastTranslator",]
__all__ = ["StarTrackerNarrowTranslator", "StarTrackerWideTranslator", "StarTrackerFastTranslator",]


class RubinGenericCameraTranslator(LsstBaseTranslator):
Expand Down Expand Up @@ -141,14 +141,14 @@ def _is_startracker(cls, header, filename=None):
return (True, camId)


class StarTrackerNarrwTranslator(StarTrackerTranslator):
name = "StarTrackerNarrw"
class StarTrackerNarrowTranslator(StarTrackerTranslator):
name = "StarTrackerNarrow"
"""Name of this translation class"""

supported_instrument = "StarTrackerNarrw"
supported_instrument = "StarTrackerNarrow"
"""Supports the Rubin Star Tracker narrow-field instrument."""

_const_map = {"instrument": "StarTrackerNarrw",
_const_map = {"instrument": "StarTrackerNarrow",
"detector_serial": "00:0f:31:03:ae:60", # MAC address
}

Expand Down
10 changes: 5 additions & 5 deletions tests/test_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lsst.utils.tests

from lsst.obs.base.ingest_tests import IngestTestBase
from lsst.obs.rubinGenericCamera import StarTrackerWide, StarTrackerNarrw, StarTrackerFast
from lsst.obs.rubinGenericCamera import StarTrackerWide, StarTrackerNarrow, StarTrackerFast
from lsst.obs.rubinGenericCamera.filters import RUBIN_GENERIC_CAMERA_FILTER_DEFINITIONS

testDataPackage = "obs_rubinGenericCamera"
Expand All @@ -17,16 +17,16 @@


@unittest.skipIf(testDataDirectory is None, "obs_rubinGenericCamera must be set up")
class StarTrackerNarrwIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
instrumentClassName = "lsst.obs.rubinGenericCamera.StarTrackerNarrw"
class StarTrackerNarrowIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
instrumentClassName = "lsst.obs.rubinGenericCamera.StarTrackerNarrow"

visits = None # we don't have a definition of visits

def setUp(self):
self.ingestdir = os.path.dirname(__file__)
self.instrument = StarTrackerNarrw()
self.instrument = StarTrackerNarrow()
self.file = os.path.join(testDataDirectory, "data", "input", "raw", "GC102_O_20221208_000211.fits.gz")
self.dataIds = [dict(instrument="StarTrackerNarrw", exposure=2022120800211, detector=0)]
self.dataIds = [dict(instrument="StarTrackerNarrow", exposure=2022120800211, detector=0)]
self.filterLabel = RUBIN_GENERIC_CAMERA_FILTER_DEFINITIONS[0].makeFilterLabel()

super().setUp()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
from lsst.obs.base.instrument_tests import InstrumentTests, InstrumentTestData


class TestStarTrackerNarrw(InstrumentTests, lsst.utils.tests.TestCase):
class TestStarTrackerNarrow(InstrumentTests, lsst.utils.tests.TestCase):
def setUp(self):
physical_filters = set(["empty"])

self.data = InstrumentTestData(name="StarTrackerNarrw",
self.data = InstrumentTestData(name="StarTrackerNarrow",
nDetectors=1,
firstDetectorName="CCD0",
physical_filters=physical_filters)
self.instrument = lsst.obs.rubinGenericCamera.StarTrackerNarrw()
self.instrument = lsst.obs.rubinGenericCamera.StarTrackerNarrow()


class TestStarTrackerWide(InstrumentTests, lsst.utils.tests.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import os.path
import unittest
import astropy.units as u
from lsst.obs.rubinGenericCamera.translator import StarTrackerNarrwTranslator, \
from lsst.obs.rubinGenericCamera.translator import StarTrackerNarrowTranslator, \
StarTrackerWideTranslator, StarTrackerFastTranslator # noqa: F401 -- register the translators

from astro_metadata_translator.tests import MetadataAssertHelper
Expand Down Expand Up @@ -67,7 +67,7 @@ def test_comCam_translator(self):
)),
("GC102_O_20221208_000211.yaml",
dict(telescope="Simonyi Survey Telescope",
instrument="StarTrackerNarrw",
instrument="StarTrackerNarrow",
boresight_rotation_coord="sky",
dark_time=3.0 * u.s,
detector_group="None",
Expand Down

0 comments on commit 04be251

Please sign in to comment.