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 11653 #4

Merged
merged 2 commits into from
Oct 3, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/bias.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
config.isr.doLinearize=False
config.isr.doDefect=False
config.isr.doLinearize = False
config.isr.doDefect = False
6 changes: 3 additions & 3 deletions config/dark.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
config.isr.doLinearize=False
config.isr.doDefect=False
config.repair.cosmicray.nCrPixelMax=100000
config.isr.doLinearize = False
config.isr.doDefect = False
config.repair.cosmicray.nCrPixelMax = 100000
4 changes: 2 additions & 2 deletions config/flat.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
config.isr.doLinearize=False
config.isr.doDefect=False
config.isr.doLinearize = False
config.isr.doDefect = False
1 change: 1 addition & 0 deletions python/lsst/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import absolute_import
import pkgutil
import lsstimport
__path__ = pkgutil.extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions python/lsst/obs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import absolute_import
import pkgutil
import lsstimport
__path__ = pkgutil.extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions python/lsst/obs/comCam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import
from .version import *
from .comCam import *
from .comCamMapper import *
2 changes: 2 additions & 0 deletions python/lsst/obs/comCam/comCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import division, print_function
import os.path
import lsst.utils as utils
from lsst.obs.base.yamlCamera import YamlCamera


class ComCam(YamlCamera):
"""The Commissioning Camera (comCam)
"""
Expand Down
11 changes: 8 additions & 3 deletions python/lsst/obs/comCam/comCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import division, print_function

import lsst.afw.image.utils as afwImageUtils
import lsst.afw.geom as afwGeom
import lsst.afw.image as afwImage
Expand All @@ -29,6 +31,7 @@

__all__ = ["ComCamMapper"]


class ComCamMakeRawVisitInfo(MakeRawVisitInfo):
"""functor to make a VisitInfo from the FITS header of a raw image
"""
Expand All @@ -48,7 +51,6 @@ def setArgDict(self, md, argDict):

# Done setting argDict; check values now that all the header keywords have been consumed
argDict["darkTime"] = self.getDarkTime(argDict)


def getDateAvg(self, md, exposureTime):
"""Return date at the middle of the exposure
Expand All @@ -63,6 +65,7 @@ def getDateAvg(self, md, exposureTime):
dateObs = self.popIsoDate(md, "DATE-OBS")
return self.offsetDate(dateObs, 0.5*exposureTime)


def assemble_raw(dataId, componentInfo, cls):
"""Called by the butler to construct the composite type "raw"

Expand Down Expand Up @@ -111,6 +114,7 @@ def assemble_raw(dataId, componentInfo, cls):

return exposure


class ComCamMapper(CameraMapper):
packageName = 'obs_comCam'
MakeRawVisitInfoClass = ComCamMakeRawVisitInfo
Expand Down Expand Up @@ -184,6 +188,7 @@ def query_raw_amp(self, format, dataId):
# The composite type "raw" doesn't provide e.g. query_raw, so we defined type _raw in the .paf file
# with the same template, and forward requests as necessary
#

def query_raw(self, *args, **kwargs):
return self.query__raw(*args, **kwargs)

Expand All @@ -210,7 +215,7 @@ def bypass_raw_visitInfo(self, datasetType, pythonType, location, dataId):
else:
import re
import lsst.afw.image as afwImage

fileName = location.getLocationsWithRoot()[0]
mat = re.search(r"\[(\d+)\]$", fileName)
if mat:
Expand Down Expand Up @@ -246,7 +251,7 @@ def X_bypass_defects(self, datasetType, pythonType, location, dataId):
# These may be hot pixels, but we'll treat them as bad until we can get more data
(3801, 666, 3805, 669),
(3934, 582, 3936, 589),
)]
)]

def X__defectLookup(self, dataId):
""" This function needs to return a non-None value otherwise the mapper gives up
Expand Down
12 changes: 7 additions & 5 deletions python/lsst/obs/comCam/ingest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import print_function
from __future__ import division, print_function
import os
import re
from lsst.pipe.tasks.ingest import ParseTask
from lsst.pipe.tasks.ingestCalibs import CalibsParseTask
import lsst.log as lsstLog
import lsst.log as lsstLog

EXTENSIONS = ["fits", "gz", "fz"] # Filename extensions to strip off

Expand All @@ -19,7 +19,7 @@ def __init__(self, config, *args, **kwargs):

def getInfo(self, filename):
""" Get the basename and other data which is only available from the filename/path.

This seems fragile, but this is how the teststand data will *always* be written out,
as the software has been "frozen" as they are now in production mode.

Expand Down Expand Up @@ -83,9 +83,10 @@ def translate_wavelength(self, md):
"""
raw_wl = md.get("MONOWL")
wl = int(round(raw_wl))
if abs(raw_wl-wl)>=0.1:
if abs(raw_wl-wl) >= 0.1:
logger = lsstLog.Log.getLogger('obs.comCam.ingest')
logger.warn('Translated significantly non-integer wavelength; %s is more than 0.1nm from an integer value', raw_wl)
logger.warn(
'Translated significantly non-integer wavelength; %s is more than 0.1nm from an integer value', raw_wl)
return wl

def translate_visit(self, md):
Expand All @@ -109,6 +110,7 @@ def translate_visit(self, md):

##############################################################################################################


class ComCamCalibsParseTask(CalibsParseTask):
"""Parser for calibs"""

Expand Down