Commit 0ecade3b authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parent 954210c4
......@@ -1907,8 +1907,8 @@ class MCIsimulator():
if j==0:
self.log.info('begin iteration........')
#if self.debug:
self.log.info('j = %i' % (j))
if self.debug:
self.log.info('j = %i' % (j))
starRa = 3600.0*( newRa[j] ) # ra of star, arcsecond
starDec = 3600.0*( newDec[j] ) # dec of star, arcsecond
......@@ -2013,8 +2013,7 @@ class MCIsimulator():
#self.log.info('Channel in =%s, PosX(in pixel)=%f, PosY(in pixel)=%f' % (channel[i], gx[ch], gy[ch]))
if self.debug:
self.log.info('Channel in =%s, PosX(in pixel)=%f, PosY(in pixel)=%f, Nphotons=%f' % (channel[i], gx[ch], gy[ch],intscales[ch]))
self.log.info('Star number on CCD is = %i' % (nlayccd))
......@@ -2091,7 +2090,7 @@ class MCIsimulator():
self.log.info('appfat= %s'%(self.appFatt))
if self.appFatt :
self.log.info('begin appfat ........')
#self.log.info('begin appfat ........')
### apply treering and bright fatter and diffusion;
SimpleTreeRing = galsim.SiliconSensor().simple_treerings(amplitude=self.information['treering'])
......@@ -2116,7 +2115,7 @@ class MCIsimulator():
cx0,cy0=centroid(image.array)
self.log.info('finish appfat ........')
#self.log.info('finish appfat ........')
############################################
############################################
......@@ -2542,41 +2541,24 @@ class MCIsimulator():
galRa = newRa[k1]*3600##*(srcs_cat[k1].header['new_ra'] -self.information['gal_ra'] +self.information['star_ra']) # ra of galaxies, arcsecond
galDec = newDec[k1]*3600####(srcs_cat[k1].header['new_dec']-self.information['gal_dec']+self.information['star_dec']) # dec of galaxies, arcsecond
#spa = srcs_cat[k1].header['spa']
###########################################################################
############################################################################
### test code ####
# galRa=self.information['star_ra']*3600
# galDec=self.information['star_dec']*3600
###########
# tx, ty = world_to_pixel(galRa/3600,
# galDec/3600,
# theta.deg,
# center_ra,
# center_dec,
# self.information['xsize']/2-0.5,
# self.information['ysize']/2-0.5,
# pixelsize=0.05)
#################################################################
fsx,fsy=cal_pos(center_ra,center_dec, rotTelPos, rotSkyPos, galRa, galDec)
# row= fsy/losscale+self.information['ysize']/2-0.5 ### row number on CCD image, dec direction ,y direction
# col= fsx/losscale+self.information['xsize']/2-0.5 ### col number on CCD image, ra direction, x direction
if abs(fsx)>235 or abs(fsy)>235:
continue
# if row>=self.information['ysize']+200 or row<=-200 or col>=self.information['xsize']+200 or col <=-200:
# continue
# # SED of j-th galaxy ,# unit of 10-17 erg/s/A/cm2
gal_flux=srcs_sed[k1+1].data ## here is k1+1, not k1, k1 begins with 0
# print('nlaccd = ', nlayccd)
################################
### rotate the lensed_images_g ###
......
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