Skip to content

Commit

Permalink
update Mosaic3 nominal calibrations, and make the nominal values per-amp
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Feb 15, 2016
1 parent f39eda9 commit 5beea62
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions measure_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@

import tractor

def get_nominal_cal(cam, band):
def get_nominal_cal(cam, band, ext=None):
if cam.lower() in ['decam']:
return decam_nominal_cal[band]
if cam.lower() in ['mosaic', 'mosaic3']:
return mosaic_nominal_cal[band]
d = mosaic_nominal_cal
return d.get((band, ext), d[band])

# zp, sky, kx
decam_nominal_cal = dict(
Expand All @@ -51,10 +52,17 @@ def get_nominal_cal(cam, band):
r = (27.01,
20.91,
0.10),
z = (26.46,
z = (26.26.518,
18.46,
0.06,),
)
mosaic_nominal_cal.update({
('z', 'im4' ): 26.406,
('z', 'im7' ): 26.609,
('z', 'im11'): 26.556,
('z', 'im16'): 26.499,
})

# Color terms
ps1_to_mosaic = ps1_to_decam

Expand Down Expand Up @@ -86,6 +94,9 @@ def __init__(self, fn, ext, aprad=7., skyrad_inner=7., skyrad_outer=10.,
self.det_thresh = 20

self.debug = True

def get_nominal_cal(self, band, ext=None):
return get_nominal_cal(band, ext=ext)

def remove_sky_gradients(self, img):
# Ugly removal of sky gradients by subtracting median in first x and then y
Expand Down Expand Up @@ -204,7 +215,7 @@ def run(self, ps=None, focus=False, momentsize=5):
exptime = primhdr['EXPTIME']
airmass = primhdr['AIRMASS']
print('Band', band, 'Exptime', exptime, 'Airmass', airmass)
zp0, sky0, kx = self.get_nominal_cal(band)
zp0, sky0, kx = self.get_nominal_cal(band, ext=self.ext)

# Find the sky value and noise level
sky,sig1 = self.get_sky_and_sigma(img)
Expand Down Expand Up @@ -779,9 +790,6 @@ class DECamMeasurer(RawMeasurer):
def read_raw(self, F, ext):
return read_raw_decam(F, ext)

def get_nominal_cal(self, band):
return decam_nominal_cal[band]

def get_sky_and_sigma(self, img):
sky,sig1 = sensible_sigmaclip(img[1500:2500, 500:1000])
return sky,sig1
Expand Down Expand Up @@ -827,9 +835,6 @@ def read_raw(self, F, ext):
img[trimA] = trimg
return img,hdr

def get_nominal_cal(self, band):
return mosaic_nominal_cal[band]

def get_sky_and_sigma(self, img):
# Spline sky model to handle (?) ghost / pupil?
from tractor.splinesky import SplineSky
Expand Down

0 comments on commit 5beea62

Please sign in to comment.