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

DM-16297: Changes for Gen3 support of LSST data #170

Merged
merged 8 commits into from
Sep 19, 2019
8 changes: 8 additions & 0 deletions python/lsst/obs/base/fitsRawFormatterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ def makeWcs(self, visitInfo, detector):
Raised if there is an error generating the SkyWcs, chained from the
lower-level exception if available.
"""
if self.observationInfo.tracking_radec is None:
# This is not an on-sky observation
return None

timj marked this conversation as resolved.
Show resolved Hide resolved
skyWcs = self._createSkyWcsFromMetadata()

log = lsst.log.Log.getLogger("fitsRawFormatter")
Expand All @@ -186,6 +190,10 @@ def _createSkyWcsFromMetadata(self):
The WCS that was created from ``self.metadata``, or None if that
creation fails due to invalid metadata.
"""
if self.observationInfo.tracking_radec is None:
# This is not an on-sky observation
return None

try:
return lsst.afw.geom.makeSkyWcs(self.metadata, strip=True)
except lsst.pex.exceptions.TypeError as e:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/base/gen3/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def ensureDimensions(self, file):
# Record that we've handled this entry.
self.dimensionEntriesDone[dimension].add(dimensionDataId)
# Do this after the loop to ensure all the dimensions are added
if self.config.doAddRegions:
if self.config.doAddRegions and obsInfo.tracking_radec is not None:
region = self.buildRegion(headers)
try:
self.butler.registry.setDimensionRegion(DataId(fullDataId,
Expand Down