diff --git a/ObservationSim/Instrument/Filter.py b/ObservationSim/Instrument/Filter.py index d02416950904d970585f4873e0183823c99377fa..7127dc7d74229dc4e7c0047bec7d5e4f5d21a61f 100755 --- a/ObservationSim/Instrument/Filter.py +++ b/ObservationSim/Instrument/Filter.py @@ -25,6 +25,7 @@ class Filter(object): self.bandpass_full, self.bandpass_sub_list = self._get_bandpasses() self.survey_type = self._getSurveyType() + def _getSurveyType(self): if self.filter_type in ["GI", "GV", "GU"]: return "spectroscopic" @@ -40,6 +41,7 @@ class Filter(object): self.sky_background = filter_param.param[filter_type][5] self.mag_saturation = filter_param.param[filter_type][6] self.mag_limiting = filter_param.param[filter_type][7] + self.zodical_spec = None def is_too_bright(self, mag, margin=-2.5): return mag <= self.mag_saturation + margin diff --git a/ObservationSim/ObservationSim.py b/ObservationSim/ObservationSim.py index da3e9f16ae8f973540f01553d46377e621cfefab..0822789e40b974826e0b836b79e187c6f5b80787 100755 --- a/ObservationSim/ObservationSim.py +++ b/ObservationSim/ObservationSim.py @@ -108,9 +108,10 @@ class Observation(object): chip.img.setOrigin(chip.bound.xmin, chip.bound.ymin) chip.img.wcs = wcs_fp - filt.setFilterStrayLightPixel(jtime = pointing.jdt, sat_pos = np.array([pointing.sat_x, pointing.sat_y, pointing.sat_z]), pointing_radec = np.array([pointing.ra,pointing.dec]), sun_pos = np.array([pointing.sun_x,pointing.sun_y,pointing.sun_z])) + if self.config["obs_setting"]["enable_straylight_model"]: + filt.setFilterStrayLightPixel(jtime = pointing.jdt, sat_pos = np.array([pointing.sat_x, pointing.sat_y, pointing.sat_z]), pointing_radec = np.array([pointing.ra,pointing.dec]), sun_pos = np.array([pointing.sun_x,pointing.sun_y,pointing.sun_z])) - print("========================sky pix========================\n") + print("========================sky pix========================") print(filt.sky_background) if chip.survey_type == "photometric": diff --git a/config/config_C6.yaml b/config/config_C6.yaml index ff0e202ea0b84d3fcad52d9246197365da973569..087de4f806734afba835509cb784ee3fe5dc05ef 100644 --- a/config/config_C6.yaml +++ b/config/config_C6.yaml @@ -105,6 +105,9 @@ obs_setting: # Whether to enable astrometric modeling enable_astrometric_model: True + # Whether to enable straylight model + enable_straylight_model: False + # Cut by saturation magnitude in which band? cut_in_band: "z"