diff --git a/csst_mci_sim/CTI/__pycache__/CTI.cpython-311.pyc b/csst_mci_sim/CTI/__pycache__/CTI.cpython-311.pyc index 36a5b0b7f16698e60430bbe20606f3c526d7948a..76e435adab1276f8d6fe19aa2180ed8972534c9f 100644 Binary files a/csst_mci_sim/CTI/__pycache__/CTI.cpython-311.pyc and b/csst_mci_sim/CTI/__pycache__/CTI.cpython-311.pyc differ diff --git a/csst_mci_sim/__pycache__/csst_mci_sim.cpython-311.pyc b/csst_mci_sim/__pycache__/csst_mci_sim.cpython-311.pyc index 1bed457ca91784f314c2f8d849248657b78b4cff..12d60db044ecf6362e20dd28e52394913b24d0ed 100644 Binary files a/csst_mci_sim/__pycache__/csst_mci_sim.cpython-311.pyc and b/csst_mci_sim/__pycache__/csst_mci_sim.cpython-311.pyc differ diff --git a/csst_mci_sim/csst_mci_sim.py b/csst_mci_sim/csst_mci_sim.py index 3024d1342c10e9e6f76e45bbc00f1cdec1519ea8..7211882f7540ca7c75e9d8042f71eff23dd2c561 100644 --- a/csst_mci_sim/csst_mci_sim.py +++ b/csst_mci_sim/csst_mci_sim.py @@ -397,44 +397,7 @@ class StrayLight(object): return max(band_earth_e1, band_earth_e2) ############################################################################### -#################################################################################### - - -def processArgs(printHelp=False): - """ - Processes command line arguments. - """ - parser = OptionParser() - - parser.add_option('-c', '--configfile', dest='configfile', - help="Name of the configuration file", metavar="string") - - parser.add_option('-s', '--section', dest='section', - help="Name of the section of the config file [SCIENCE]", metavar="string") - - parser.add_option('-q', '--quadrant', dest='quadrant', help='CCD quadrant to simulate [0, 1, 2, 3]', - metavar='int') - - parser.add_option('-x', '--xCCD', dest='xCCD', help='CCD number in X-direction within the FPA matrix', - metavar='int') - - parser.add_option('-y', '--yCCD', dest='yCCD', help='CCD number in Y-direction within the FPA matrix', - metavar='int') - - parser.add_option('-d', '--debug', dest='debug', action='store_true', - help='Debugging mode on') - - parser.add_option('-t', '--test', dest='test', action='store_true', - help='Run unittest') - - parser.add_option('-f', '--fixed', dest='fixed', help='Use a fixed seed for the random number generators', - metavar='int') - if printHelp: - parser.print_help() - else: - return parser.parse_args() - - +############################################################################### ############################################################################### def make_c_coor(fov, step): @@ -1447,7 +1410,7 @@ class MCIsimulator(): if home_path == '/home/yan': - self.result_path = '../MCI_simData/'+self.source+ss+result_day + self.result_path = '../MCI_simResult/'+self.source+"_"+result_day else: self.result_path = '/data/mcisimdata/'+result_day @@ -1713,32 +1676,33 @@ class MCIsimulator(): theta = rotTelPos - rotSkyPos ############ load star data catlog ##################### - ##starcat='selection_20230517_concat.csv' + starcat='selection_MACSJ0744.9 3927_20230517_concat.csv' - starcat='selection_20230517_concat.fits' - - ##starcat='GaiaSource_675688-675713.csv' + ##starcat='selection_20230517_concat.fits' + ################################################### self.log.info('Stat catlog file name is %s' % (starcat)) - da=fits.open(self.information['dir_path']+'MCI_inputData/star_input/'+starcat) - - ####da=fits.open(starcat) - df2=da[1].data - #### + ###################################################################### + # da=fits.open(self.information['dir_path']+'MCI_inputData/star_input/'+starcat) - #df2.index = range(len(df2)) - ## limit the filed of view to 600*600 arcsec^2 square zone; + # df2=da[1].data + # del da + ########################################## + df2=pandas.read_csv(self.information['dir_path']+'MCI_inputData/star_input/'+starcat) + df3=df2[ (abs(df2['ra_gaia']-df2['ra_gaia'].mean())<400/3600.0) & (abs(df2['dec_gaia']-df2['dec_gaia'].mean())<400/3600.0) ] df3.index = range(len(df3)) + ################################################### + # np.save('umag.npy', df3['umag'] ) self.star=df3 - del da,df2,df3 + del df2,df3 self.information['ra_obj'] = self.star['ra_gaia'].mean() self.information['dec_obj'] = self.star['dec_gaia'].mean() @@ -2218,7 +2182,7 @@ class MCIsimulator(): st_magz.append(zmag) - self.log.info('begin cal PSF') + ## self.log.info('begin cal PSF') ###################################################################### psf=dict() @@ -2252,11 +2216,11 @@ class MCIsimulator(): stamp_img.setOrigin(0,0) stamp_img.scale=0.025 - self.log.info('begining galsim.PhotonArray.makeFromImage') + # self.log.info('begining galsim.PhotonArray.makeFromImage') - self.log.info('stamp_img.array.max()= %i' % (stamp_img.array.max())) + # self.log.info('stamp_img.array.max()= %i' % (stamp_img.array.max())) - print('stamp_img.array.max(): ', stamp_img.array.max() ) + ###print('stamp_img.array.max(): ', stamp_img.array.max() ) ################################################# @@ -5438,11 +5402,11 @@ class MCIsimulator(): print('applyPRNUeffect') #################################################################### - # if self.source in sourcelist: - # if self.cosmicRays: - # # if self.debug == False: - # self.addCosmicRays() - # print('addCosmicRays finisth') + if self.source in sourcelist: + if self.cosmicRays: + # if self.debug == False: + self.addCosmicRays() + print('addCosmicRays finisth') ################################################## if self.skyback: @@ -5463,23 +5427,20 @@ class MCIsimulator(): ################################################# - # if self.bleeding: - # # 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()) - # print('apply bleeding effect finisth') + if self.bleeding: + # 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()) + print('apply bleeding effect finisth') - # ################################################ + ################################################ - # if self.nonlinearity: - # self.applyNonlinearity() - # print('applyNonlinearity') + if self.nonlinearity: + self.applyNonlinearity() + print('applyNonlinearity') # ################################################ - - - #### read CCD image to output matrix as defined diff --git a/csst_mci_sim/mci_so/__pycache__/__init__.cpython-311.pyc b/csst_mci_sim/mci_so/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46e23935a60f5b03720db0d9c6f55f9650d62955 Binary files /dev/null and b/csst_mci_sim/mci_so/__pycache__/__init__.cpython-311.pyc differ diff --git a/csst_mci_sim/support/MCIinstrumentModel.py b/csst_mci_sim/support/MCIinstrumentModel.py index 8777e9e66b1ab47151cc95baf7ef2e57ce846905..33993b653d4e3d5e280093f20bbc4f2eaa3c719a 100644 --- a/csst_mci_sim/support/MCIinstrumentModel.py +++ b/csst_mci_sim/support/MCIinstrumentModel.py @@ -64,5 +64,5 @@ def CCDnonLinearityModel(data, beta=6e-7): return out ################################################################### -if __name__ == '__main__': - print() +# if __name__ == '__main__': +# print() diff --git a/csst_mci_sim/support/__pycache__/cosmicrays.cpython-311.pyc b/csst_mci_sim/support/__pycache__/cosmicrays.cpython-311.pyc index 71d7f3c4c973d74370e9fe6231971f87a80af69c..363ea44b746a6f72300fbc41fbc30dbdbb6d62e4 100644 Binary files a/csst_mci_sim/support/__pycache__/cosmicrays.cpython-311.pyc and b/csst_mci_sim/support/__pycache__/cosmicrays.cpython-311.pyc differ diff --git a/csst_mci_sim/support/__pycache__/sed.cpython-311.pyc b/csst_mci_sim/support/__pycache__/sed.cpython-311.pyc index 7ab26dd45afb028bdb8bb8347fbbdba1bbd25a27..6be2dc0bdc1feeaa94bf3fa23a17961308b4bc91 100644 Binary files a/csst_mci_sim/support/__pycache__/sed.cpython-311.pyc and b/csst_mci_sim/support/__pycache__/sed.cpython-311.pyc differ diff --git a/csst_mci_sim/support/__pycache__/shao.cpython-311.pyc b/csst_mci_sim/support/__pycache__/shao.cpython-311.pyc index e6195600f5a5949ab8fa6657334a6e58e2ed2655..02e959d2adb78530498c102dd523d3e74130b8e8 100644 Binary files a/csst_mci_sim/support/__pycache__/shao.cpython-311.pyc and b/csst_mci_sim/support/__pycache__/shao.cpython-311.pyc differ