Commit a8c5018a authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

test

parent b69ef51d
Loading
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
@@ -2035,7 +2035,7 @@ class MCIsimulator():
        ####################   generate star image  ##########
        
        if self.debug: 
            nstar=100
            nstar=1000
        else:
            nstar=nsrcs
            
@@ -2088,7 +2088,7 @@ class MCIsimulator():

            if self.debug:             
                if nlayccd>10:
                    continue
                    break
                
            st_ra.append( np.float64(starRa/3600.0))
            st_dec.append(np.float64(starDec/3600.0))
@@ -2144,7 +2144,7 @@ class MCIsimulator():
                # Input redshift
                redshift = 0
                
                self.log.info('load star catlog 777777777')                
                              
                # Loading galaxy SED template
                t=sed.Gal_Temp(self.information['dir_path'])
                # Calculating the magnitude (u, g, r, i, z) of each template
@@ -2152,7 +2152,7 @@ class MCIsimulator():
                # Calculating flux
                ugriz = np.array([umag, gmag, rmag, imag, zmag])
                star_flux = sed.Model_Galaxy_SED(wave, ugriz, redshift, t, self.information['dir_path']) 
                self.log.info('load star catlog 888888888888')
                
                
                
                
@@ -2218,7 +2218,7 @@ class MCIsimulator():
            st_magz.append(zmag)
            
           
            
            self.log.info('load star catlog 888888888888')
            ######################################################################
            psf=dict() 
            
@@ -2251,13 +2251,16 @@ class MCIsimulator():
                stamp_img = galsim.Image(conv, copy=True)                        
                stamp_img.setOrigin(0,0)                            
                stamp_img.scale=0.025                             
            
                self.log.info('load star catlog 999999999')
                #################################################   
                    
                photons=galsim.PhotonArray.makeFromImage(stamp_img, max_flux=min(1.0, stamp_img.array.max()/10000.0))
                
                cx0,cy0=centroid(stamp_img.array)
                
                
                self.log.info('load star catlog 99999999999998')
                
                if self.appFatt : 
                    
                ### apply treering and bright fatter and diffusion;                        
@@ -2294,6 +2297,9 @@ class MCIsimulator():
                
                photons.addTo(final_image[ch]) 
                
                
                self.log.info('load star catlog 11111111111')
            
                ###############################
                ###### debug code 
                # fi= galsim.ImageF(int(self.information['xsize']), int(self.information['ysize']))
@@ -2316,6 +2322,8 @@ class MCIsimulator():
                ###############################################################
        print('total star nummber on CCD is: ',nlayccd )
        
        self.log.info('total star nummber on CCD = %i' % (nlayccd))
        
        tab=Table()            
        tab['st_ra']  =np.asarray(st_ra)
        tab['st_dec'] =np.asarray(st_dec)
@@ -2819,9 +2827,9 @@ class MCIsimulator():
                ######## test code   ##########
                
                if self.debug:                
                    if nlayccd>10:
                    if nlayccd>4:
                        #########
                        continue
                        break
            
                ############################33
                            
@@ -5430,7 +5438,7 @@ class MCIsimulator():
        ####################################################################
        if self.source in sourcelist:
            if self.cosmicRays:
                if self.debug == False: 
                # if self.debug == False: 
                self.addCosmicRays()
                print('addCosmicRays finisth')
                     
@@ -5454,7 +5462,7 @@ class MCIsimulator():
        #################################################

        if self.bleeding:
            if self.debug== False: 
            # if self.debug== False: 
            self.image_g=self.applyBleeding(self.image_g.copy())
            self.image_r=self.applyBleeding(self.image_r.copy())
            self.image_i=self.applyBleeding(self.image_i.copy())
@@ -5483,7 +5491,7 @@ class MCIsimulator():
        #################################################################
        if self.source in sourcelist:
            if self.radiationDamage:
                if self.debug == False: 
                # if self.debug == False: 
                self.applyRadiationDamage()
                print('applyRadiationDamage()')
        ######################################################################