Commit 5a850797 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

mag cut bug fix

parent 08fbbc91
...@@ -162,6 +162,15 @@ class Observation(object): ...@@ -162,6 +162,15 @@ class Observation(object):
chip_output.create_output_file() chip_output.create_output_file()
self.nobj = len(self.cat.objs) self.nobj = len(self.cat.objs)
for ifilt in range(len(self.all_filter)):
temp_filter = self.all_filter[ifilt]
# Update the limiting magnitude using exposure time in pointing
temp_filter.update_limit_saturation_mags(exptime=pointing.exp_time, chip=chip)
# Select cutting band filter for saturation/limiting magnitude
if temp_filter.filter_type.lower() == self.config["obs_setting"]["cut_in_band"].lower():
cut_filter = temp_filter
# Loop over objects # Loop over objects
missed_obj = 0 missed_obj = 0
bright_obj = 0 bright_obj = 0
...@@ -190,20 +199,12 @@ class Observation(object): ...@@ -190,20 +199,12 @@ class Observation(object):
target_filt=filt, target_filt=filt,
norm_filt=norm_filt, norm_filt=norm_filt,
) )
for ifilt in range(len(self.all_filter)): _, obj.param["mag_%s"%cut_filter.filter_type] = self.cat.convert_sed(
temp_filter = self.all_filter[ifilt]
_, obj.param["mag_%s"%temp_filter.filter_type] = self.cat.convert_sed(
mag=obj.param["mag_use_normal"], mag=obj.param["mag_use_normal"],
sed=sed_data, sed=sed_data,
target_filt=temp_filter, target_filt=cut_filter,
norm_filt=norm_filt, norm_filt=norm_filt,
) )
# Update the limiting magnitude using exposure time in pointing
temp_filter.update_limit_saturation_mags(exptime=pointing.exp_time, chip=chip)
# Select cutting band filter for saturation/limiting magnitude
if temp_filter.filter_type.lower() == self.config["obs_setting"]["cut_in_band"].lower():
cut_filter = temp_filter
except Exception as e: except Exception as e:
print(e) print(e)
......
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