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): ...@@ -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_' + 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 self.subdir = subdir
# Setup logger for each chip # 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() self.logger = logging.getLogger()
fh = logging.FileHandler(os.path.join(self.subdir, logger_filename), mode='w+', encoding='utf-8') fh = logging.FileHandler(os.path.join(self.subdir, logger_filename), mode='w+', encoding='utf-8')
fh.setLevel(logging.DEBUG) fh.setLevel(logging.DEBUG)
......
...@@ -494,7 +494,7 @@ class Chip(FocalPlane): ...@@ -494,7 +494,7 @@ class Chip(FocalPlane):
# Output images for calibration pointing # Output images for calibration pointing
###################################################################################### ######################################################################################
# Bias output # 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: if self.logger is not None:
self.logger.info(" Output N frame Bias files") self.logger.info(" Output N frame Bias files")
else: else:
...@@ -562,7 +562,7 @@ class Chip(FocalPlane): ...@@ -562,7 +562,7 @@ class Chip(FocalPlane):
del BiasCombImg del BiasCombImg
# Export combined (ncombine, Vignetting + PRNU) & single vignetting flat-field file # 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: if self.logger is not None:
self.logger.info(" Output N frame Flat-Field files") self.logger.info(" Output N frame Flat-Field files")
else: else:
...@@ -671,7 +671,7 @@ class Chip(FocalPlane): ...@@ -671,7 +671,7 @@ class Chip(FocalPlane):
del flat_img del flat_img
# Export Dark current images # 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: if self.logger is not None:
self.logger.info(" Output N frame Dark Current files") self.logger.info(" Output N frame Dark Current files")
else: 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