Skip to content

Commit

Permalink
Marriner Updates 20160713
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmorganson committed Jul 14, 2016
1 parent ebfa79a commit c92c662
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions python/pixcorrect/PixCorrectDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def main(cls):
logging.basicConfig(format="%(asctime)s %(levelname)s:\t%(message)s",
level=logging.WARNING)

global logger
logger = logging.getLogger()
#global logger
#logger = logging.getLogger()
if args.verbose > 0:
verbosity = logging.INFO if args.verbose==1 else logging.DEBUG
logger.setLevel(verbosity)
Expand Down
2 changes: 1 addition & 1 deletion python/pixcorrect/corr_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pixcorrect import proddir

# constants

global logger
logger = logging.getLogger('pixcorrect')

# exception classes
Expand Down
11 changes: 5 additions & 6 deletions python/pixcorrect/fix_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ def __call__(cls, image, bpm):
- `image`: DESImage to fix.
- `bpm`: DESBPMImage for this CCD
"""
#Modified 6/19/2016
#Modified 7/7/2016
#Use clipLine to fit column slope
#Change NEIGHBORS from 10 to 6
#Change VAR_TOLERANCE from 0.5 to 0.25
#Remove lower limit on correction
#Change mask bit usage
#Correct all correctable pixels, but use only "good" pixels to compute correction

logger.info('Fixing columns')

NEIGHBORS = 6 # Number of comparison columns to seek
Expand All @@ -138,8 +138,7 @@ def __call__(cls, image, bpm):
#fraction of the average number of sky pixels in the reference columns
#If the pixel values of a column vary in a bi-stable way, the high pixels may be
#interpreted as "objects" and the high variance may not be noticed.
COUNT_TOL = 0.80

COUNT_TOL = 0.85

if image.mask is None:
raise FixColumnsError('Input image does not have mask')
Expand Down Expand Up @@ -184,7 +183,7 @@ def __call__(cls, image, bpm):
if col_var <= 0.0:
logger.info("Error in clipped line fit for column {:d}".format(icol))
continue

# Now want to collect stats on up to NEIGHBORS nearby columns
norm_stats = []
ilow = icol
Expand Down Expand Up @@ -249,7 +248,7 @@ def __call__(cls, image, bpm):
if col_n < COUNT_TOL*norm_n:
logger.info('Too few sky pixels to fix column {:d}'.format(icol))
continue

#Valid correction. Calculate correction & error estimate
norm_mean = np.sum(mean*wt)/np.sum(wt)
correction = norm_mean - col_mean
Expand Down
6 changes: 4 additions & 2 deletions python/pixcorrect/make_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __call__(cls, image, bpm_im, saturate, clear):
except:
return 1

# Enable the following kluge code to work with old style BPM's
#====Temporary kluge until we get the new BPMS
#Replace CORR with BIAS_COL
#bitmask = BPMDEF_CORR
#mark = (bpm_im.mask & bitmask) != 0
Expand Down Expand Up @@ -140,7 +140,9 @@ def __call__(cls, image, bpm_im, saturate, clear):
for icol in biascols:
#Clear FUNKY_COL bit if set for all pixels in this column
#The reason for clearing the bit is that the FUNKY_COL detection is
#sensitive to hot bias pixels and may flag those columns by "mistake"
#sensitive to hot bias pixels and may flag those columns by "mistake"
#First clear BAD BPM bit if set because of funky column
image.mask[:,icol][bpm_im.mask[:,icol]==BPMDEF_FUNKY_COL] &= ~BADPIX_BPM
bpm_im.mask[:,icol] -= (bpm_im.mask[:,icol] & BPMDEF_FUNKY_COL )
#Correctable columns have exactly 1 BIAS_HOT pixel
if N_BIAS_HOT[icol] == 1:
Expand Down

0 comments on commit c92c662

Please sign in to comment.