Commit 288a26ac authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

Replace csst_ifs_sim.py

parent f612f57f
Loading
Loading
Loading
Loading
Loading
+15 −18
Original line number Diff line number Diff line
@@ -718,8 +718,7 @@ class StrayLight(object):
        self.ecliptic = self.equator.transform_to('barycentrictrueecliptic')
        self.pointing = transRaDec2D(radec[0], radec[1])
        self.slcdll = ctypes.CDLL(
            # dylib
            os.path.join(self.path, 'IFS_inputdata/refs/libstraylight.so'))
            os.path.join(self.path, 'IFS_inputdata/refs/libstraylight.so'))  # dylib

        self.slcdll.Calculate.argtypes = [ctypes.c_double, ctypes.POINTER(ctypes.c_double),
                                          ctypes.POINTER(ctypes.c_double), ctypes.POINTER(
@@ -2291,10 +2290,8 @@ class IFSsimulator():
        crImage_r = np.zeros((3072, 6144), dtype=float)

        # cosmic ray instance
        cosmics_b = cosmicrays(self.log, crImage_b,
                               self.information['exptime'], crInfo=self.cr)
        cosmics_r = cosmicrays(self.log, crImage_r,
                               self.information['exptime'], crInfo=self.cr)
        cosmics_b = cosmicrays(self.log, crImage_b, self.information['exptime'], crInfo=self.cr)
        cosmics_r = cosmicrays(self.log, crImage_r, self.information['exptime'], crInfo=self.cr)

        CCD_cr_b = cosmics_b.addUpToFraction(
            self.information['coveringfraction']*self.information['exptime']/300.0, limit=None)
@@ -3550,7 +3547,7 @@ class IFSsimulator():

        # ###################   detector information##########################

        hdu_b.header['CAMERA'] = ('Blue', 'camera of IFS')
        hdu_b.header['DETECTOR'] = ('Blue', 'detector')
        hdu_b.header['DETSN'] = ('CCD231-c4-00', 'detector serial number')
        hdu_b.header['DETNAME'] = ('blue', 'detector name')
        hdu_b.header['DETSIZE'] = ('2048*4096', 'detector size')
@@ -3575,7 +3572,7 @@ class IFSsimulator():
        #######################################################################
        # Readout information, revised on 2024.2.27

        frame_time_b = 0.09216  # data frame transfer time in Bule camera
        frame_time_b = 0.09216  # data frame transfer time in Bule DETECTOR
        exptimes = self.information['exposuretimes']
        for k in range(exptimes):

@@ -3667,7 +3664,7 @@ class IFSsimulator():
            hdu_b.header['Hole'] = ('yes', 'apply hole to LAMP')

        #####################################################################
        # ###################    red camera  ######################
        # ###################    red DETECTOR  ######################

        # create a new FITS file, using HDUList instance
        ofd_r = fits.PrimaryHDU()
@@ -3934,7 +3931,7 @@ class IFSsimulator():

        # ##################   detector information############################

        hdu_r.header['CAMERA'] = ('Red', 'camera of IFS')
        hdu_r.header['DETECTOR'] = ('Red', 'detector')
        hdu_r.header['DETSN'] = ('CCD231-c6-00', 'detector serial number')
        hdu_r.header['DETNAME'] = ('red', 'detector name')

@@ -3961,7 +3958,7 @@ class IFSsimulator():

##############################################################################
        # Readout information
        frame_time_r = 0.13824  # data frame transfer time in red camera
        frame_time_r = 0.13824  # data frame transfer time in red DETECTOR

        for k in range(exptimes):
            tt = (self.information['exptime']+frame_time_r)*(k)
@@ -4096,10 +4093,10 @@ class IFSsimulator():
            '========================================================================', before='CMIRRPOS')

        hdu_b.header.add_comment(
            '========================================================================', before='CAMERA')
        hdu_b.header.add_comment('DETECTOR INFORMATION', before='CAMERA')
            '========================================================================', before='DETECTOR')
        hdu_b.header.add_comment('DETECTOR INFORMATION', before='DETECTOR')
        hdu_b.header.add_comment(
            '========================================================================', before='CAMERA')
            '========================================================================', before='DETECTOR')

        hdu_b.header.add_comment(
            '========================================================================', before='EXPT0_1')
@@ -4118,10 +4115,10 @@ class IFSsimulator():
            '========================================================================', before='CMIRRPOS')

        hdu_r.header.add_comment(
            '========================================================================', before='CAMERA')
        hdu_r.header.add_comment('DETECTOR INFORMATION', before='CAMERA')
            '========================================================================', before='DETECTOR')
        hdu_r.header.add_comment('DETECTOR INFORMATION', before='DETECTOR')
        hdu_r.header.add_comment(
            '========================================================================', before='CAMERA')
            '========================================================================', before='DETECTOR')

        hdu_r.header.add_comment(
            '========================================================================', before='EXPT0_1')