Commit a8b75053 authored by Zhang Xin's avatar Zhang Xin
Browse files

add straylight limit for big value

parent d008c206
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -115,10 +115,14 @@ class Filter(object):
        sl = Straylight(jtime=jtime, sat_pos=sat_pos, pointing_radec=pointing_radec,sun_pos=sun_pos)
        if self.filter_type in ["GU","GV","GI"]:
            s_pix, spec = sl.calculateStrayLightGrating(grating = self.filter_type.upper())
            if s_pix>0.8:
                s_pix = 0.8
            self.sky_background = s_pix
            self.zodical_spec = spec
        elif self.filter_type.lower() in ["nuv","u","g","r","i","z","y"]:
            s_pix = sl.calculateStrayLightFilter(filter=self.filter_type.lower())
            if s_pix>1:
                s_pix = 1
            self.sky_background = s_pix
            self.zodical_spec = None