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

Merged
merged 5 commits into from
Sep 10, 2015
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
6 changes: 6 additions & 0 deletions data/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ To make obs_test raw images, from the obs_test directory:
data/utils/assembleLsstChannels.py /lsst4/krughoff/Tuesday_data/imSim/S12_lsstsim/raw/v890880321-fr/E000/R22/S00
mv image.fits raw_v3_fr.fits

To make an obs_test defects file from the bias frame generated above, from the obs_test directory:

setup -r .
data/utils/defectsFromBias.py data/input/bias/bias.fits.gz
mv defects_c0.fits data/input/defects/

## Hints for using the data

To run processCcd.py (the r band image requires increasing nCrPixelMax to be successfully processed):
Expand Down
Binary file modified data/input/bias/bias.fits.gz
100755 → 100644
Binary file not shown.
Binary file modified data/input/flat/flat_fg.fits.gz
100755 → 100644
Binary file not shown.
Binary file modified data/input/flat/flat_fr.fits.gz
Binary file not shown.
Binary file modified data/input/raw/raw_v1_fg.fits.gz
100755 → 100644
Binary file not shown.
Binary file modified data/input/raw/raw_v2_fg.fits.gz
Binary file not shown.
Binary file modified data/input/raw/raw_v3_fr.fits.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions data/utils/assembleLsstChannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
def openChannelImage(dirPath, x, y):
"""Open an LSSTSim channel image
"""
globStr = os.path.join(dirPath, "imsim_*_R22_S00_C%d%d*" % (x, y))
globStr = os.path.join(dirPath, "imsim_*_R22_S00_C%d%d*" % (y, x))
inImagePathList = glob.glob(globStr)
if len(inImagePathList) != 1:
raise RuntimeError("Found %s instead of 1 file" % (inImagePathList,))
Expand Down Expand Up @@ -95,12 +95,12 @@ def assembleImage(dirPath):
inView = inExposure.Factory(inExposure, inSubBBox)
inMIView = inView.getMaskedImage()

# rotate the data by 180 degreees for the y = 1 channels
# flip image about x axis for the y = 1 channels
if y == 1:
inArrList = inMIView.getArrays()
for arr in inArrList:
if numpy.any(arr != 0):
arr[:, :] = numpy.array(arr[::-1, ::-1])
arr[:,:] = numpy.flipud(arr)

xStart = x * subDim[0]
yStart = y * subDim[1]
Expand Down
36 changes: 21 additions & 15 deletions python/lsst/obs/test/testCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import numpy
import lsst.afw.cameraGeom as cameraGeom
import lsst.afw.geom as afwGeom
from lsst.afw.table import AmpInfoCatalog, AmpInfoTable, LL, UR
from lsst.afw.table import AmpInfoCatalog, AmpInfoTable, LL
from lsst.afw.cameraGeom.cameraFactory import makeDetector

class TestCamera(cameraGeom.Camera):
Expand Down Expand Up @@ -118,10 +118,7 @@ def _makeAmpInfoCatalog(self):
xBiasExtent = 4
xRawExtent = xDataExtent + xBiasExtent
yRawExtent = yDataExtent
gain = 1.7 # amplifier gain in e-/ADU
# bias = 1000 # amplifier bias
readNoise = 7.0 # amplifier read noise, in e-
# darkCurrent = 0.02 # amplifier dark current
readNoise = 3.975 # amplifier read noise, in e-
linearityType = "PROPORTIONAL"
linearityThreshold = 0
linearityMax = 65535
Expand All @@ -136,6 +133,20 @@ def _makeAmpInfoCatalog(self):
ampCatalog = AmpInfoCatalog(schema)
for ampX in (0, 1):
for ampY in (0, 1):
# amplifier gain (e-/ADU) and read noiuse (ADU/pixel) from lsstSim raw data
# note that obs_test amp <ampX><ampY> = lsstSim amp C<ampY>,<ampX> (axes are swapped)
gain = {
(0, 0): 1.7741, # C0,0
(0, 1): 1.65881, # C1,0
(1, 0): 1.74151, # C0,1
(1, 1): 1.67073, # C1,1
}[(ampX, ampY)]
readNoise = {
(0, 0): 3.97531706217237, # C0,0
(0, 1): 4.08263755342685, # C1,0
(1, 0): 4.02753931932633, # C0,1
(1, 1): 4.1890610691135, # C1,1
}[(ampX, ampY)]
record = ampCatalog.addNew()
record.setName("%d%d" % (ampX, ampY))
record.setBBox(afwGeom.Box2I(
Expand All @@ -145,16 +156,11 @@ def _makeAmpInfoCatalog(self):

x0Raw = ampX * xRawExtent
y0Raw = ampY * yRawExtent
if ampY == 0:
# bias region (which is prescan, in this case) is before the data
readCorner = LL
x0Bias = x0Raw
x0Data = x0Bias + xBiasExtent
else:
# bias region (which is prescan, in this case) is after the data
readCorner = UR
x0Data = x0Raw
x0Bias = x0Data + xDataExtent

# bias region (which is prescan, in this case) is before the data
readCorner = LL
x0Bias = x0Raw
x0Data = x0Bias + xBiasExtent

record.setRawBBox(afwGeom.Box2I(
afwGeom.Point2I(x0Raw, y0Raw),
Expand Down