Commit a733afaf authored by Fang Yuedong's avatar Fang Yuedong
Browse files

fix cat&log file naming, fix CAL output option logic

parent 40121255
......@@ -23,12 +23,12 @@ class ChipOutput(object):
# self.cat_name = 'MSC_' + config["obs_setting"]["date_obs"] + config["obs_setting"]["time_obs"] + "_" + str(pointing_ID).rjust(7, '0') + "_" + self.chipLabel.rjust(2,'0') + ".cat"
self.cat_name = "MSC_1%s_chip_%s_filt_%s"%(str(pointing_ID).rjust(7, '0'), focal_plane.getChipLabel(chip.chipID), filt.filter_type) + ".cat"
self.cat_name = "MSC_1%s_chip_%s_filt_%s"%(str(pointing_ID).rjust(8, '0'), focal_plane.getChipLabel(chip.chipID), filt.filter_type) + ".cat"
self.subdir = subdir
# Setup logger for each chip
logger_filename = "MSC_1%s_chip_%s_filt_%s"%(str(pointing_ID).rjust(7, '0'), focal_plane.getChipLabel(chip.chipID), filt.filter_type) + ".log"
logger_filename = "MSC_1%s_chip_%s_filt_%s"%(str(pointing_ID).rjust(8, '0'), focal_plane.getChipLabel(chip.chipID), filt.filter_type) + ".log"
self.logger = logging.getLogger()
fh = logging.FileHandler(os.path.join(self.subdir, logger_filename), mode='w+', encoding='utf-8')
fh.setLevel(logging.DEBUG)
......
......@@ -494,7 +494,7 @@ class Chip(FocalPlane):
# Output images for calibration pointing
######################################################################################
# Bias output
if config["output_setting"]["bias_output"] == True and pointing_type=='CAL':
if config["ins_effects"]["add_bias"] == True and config["output_setting"]["bias_output"] == True and pointing_type=='CAL':
if self.logger is not None:
self.logger.info(" Output N frame Bias files")
else:
......@@ -562,7 +562,7 @@ class Chip(FocalPlane):
del BiasCombImg
# Export combined (ncombine, Vignetting + PRNU) & single vignetting flat-field file
if config["output_setting"]["flat_output"] == True and pointing_type=='CAL':
if config["ins_effects"]["flat_fielding"] == True and config["output_setting"]["flat_output"] == True and pointing_type=='CAL':
if self.logger is not None:
self.logger.info(" Output N frame Flat-Field files")
else:
......@@ -671,7 +671,7 @@ class Chip(FocalPlane):
del flat_img
# Export Dark current images
if config["output_setting"]["dark_output"] == True and pointing_type=='CAL':
if config["ins_effects"]["add_dark"] == True and config["output_setting"]["dark_output"] == True and pointing_type=='CAL':
if self.logger is not None:
self.logger.info(" Output N frame Dark Current files")
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment