Commit 46920c5e authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent 64a01d88
Pipeline #7879 failed with stage
in 0 seconds
...@@ -166,11 +166,11 @@ class CDM03bidir(): ...@@ -166,11 +166,11 @@ class CDM03bidir():
self.nt_p = trapdata[:, 0] self.nt_p = trapdata[:, 0]
self.sigma_p = trapdata[:, 1] self.sigma_p = trapdata[:, 1]
self.taur_p = trapdata[:, 2] self.taur_p = trapdata[:, 2]
else: # else:
# only one trap species # # only one trap species
self.nt_p = [trapdata[0],] # self.nt_p = [trapdata[0],]
self.sigma_p = [trapdata[1],] # self.sigma_p = [trapdata[1],]
self.taur_p = [trapdata[2],] # self.taur_p = [trapdata[2],]
trapdata = np.loadtxt( trapdata = np.loadtxt(
self.values['dir_path']+self.values['serialtrapfile']) self.values['dir_path']+self.values['serialtrapfile'])
...@@ -178,19 +178,19 @@ class CDM03bidir(): ...@@ -178,19 +178,19 @@ class CDM03bidir():
self.nt_s = trapdata[:, 0] self.nt_s = trapdata[:, 0]
self.sigma_s = trapdata[:, 1] self.sigma_s = trapdata[:, 1]
self.taur_s = trapdata[:, 2] self.taur_s = trapdata[:, 2]
else: # else:
# only one trap species # # only one trap species
self.nt_s = [trapdata[0],] # self.nt_s = [trapdata[0],]
self.sigma_s = [trapdata[1],] # self.sigma_s = [trapdata[1],]
self.taur_s = [trapdata[2],] # self.taur_s = [trapdata[2],]
# scale thibaut's values # # scale thibaut's values
if 'thibaut' in self.values['parallelTrapfile']: # if 'thibaut' in self.values['parallelTrapfile']:
self.nt_p /= 0.576 # thibaut's values traps / pixel # self.nt_p /= 0.576 # thibaut's values traps / pixel
self.sigma_p *= 1.e4 # thibaut's values in m**2 # self.sigma_p *= 1.e4 # thibaut's values in m**2
if 'thibaut' in self.values['serialTrapfile']: # if 'thibaut' in self.values['serialTrapfile']:
self.nt_s *= 0.576 # thibaut's values traps / pixel #should be division? # self.nt_s *= 0.576 # thibaut's values traps / pixel #should be division?
self.sigma_s *= 1.e4 # thibaut's values in m**2 # self.sigma_s *= 1.e4 # thibaut's values in m**2
def _setupLogger(self): def _setupLogger(self):
""" """
...@@ -963,7 +963,13 @@ class MCIsimulator(): ...@@ -963,7 +963,13 @@ class MCIsimulator():
################################################################################################### ###################################################################################################
################################################################################################## ##################################################################################################
# booleans to control the flow # booleans to control the flow # scale thibaut's values
if 'thibaut' in self.values['parallelTrapfile']:
self.nt_p /= 0.576 # thibaut's values traps / pixel
self.sigma_p *= 1.e4 # thibaut's values in m**2
if 'thibaut' in self.values['serialTrapfile']:
self.nt_s *= 0.576 # thibaut's values traps / pixel #should be division?
self.sigma_s *= 1.e4 # thibaut's values in m**2
self.cosmicRays = self.config.getboolean(self.section, 'cosmicRays') self.cosmicRays = self.config.getboolean(self.section, 'cosmicRays')
self.darknoise = self.config.getboolean(self.section, 'darknoise') self.darknoise = self.config.getboolean(self.section, 'darknoise')
...@@ -1117,12 +1123,6 @@ class MCIsimulator(): ...@@ -1117,12 +1123,6 @@ class MCIsimulator():
# home_path = os.environ['HOME'] # home_path = os.environ['HOME']
# if home_path == '/home/yan':
# self.result_path = '../MCI_simResult/'+self.source+"_"+result_day
# else:
# self.result_path = '/data/mcisimdata/'+result_day
print(self.information['result_path']) print(self.information['result_path'])
self.result_path = self.information['result_path'] + \ self.result_path = self.information['result_path'] + \
...@@ -1400,20 +1400,12 @@ class MCIsimulator(): ...@@ -1400,20 +1400,12 @@ class MCIsimulator():
### ###
# #
try: try:
df2['ra_gaia'][10] df2['ra_gaia'][10]+df2['dec_gaia'][10]
except NameError: except NameError:
self.log.error( self.log.error(
'Error,no ra data in the star_cat catlog file ') 'Error,no ra or dec data in the star_cat catlog file ')
raise ValueError( raise ValueError(
'Error,no ra data in the star_cat catlog file ') 'Error,no ra or dec data in the star_cat catlog file ')
#
try:
df2['dec_gaia'][10]
except NameError:
self.log.error(
'Error,no dec data in the star_cat catlog file ')
raise ValueError(
'Error,no dec data in the star_cat catlog file ')
# #
if df2['ra_gaia'].max() > 360 or df2['ra_gaia'].min() < 0 or df2['dec_gaia'].max() > 90 or df2['dec_gaia'].min() < -90: if df2['ra_gaia'].max() > 360 or df2['ra_gaia'].min() < 0 or df2['dec_gaia'].max() > 90 or df2['dec_gaia'].min() < -90:
self.log.error( self.log.error(
...@@ -1447,19 +1439,12 @@ class MCIsimulator(): ...@@ -1447,19 +1439,12 @@ class MCIsimulator():
self.star = df0[1].data self.star = df0[1].data
### ###
if 'ra' not in self.star.names: if 'ra' not in self.star.names or 'dec' not in self.star.names:
print('no ra') print('no ra')
self.log.error( self.log.error(
'Error,no ra data in the star_cat catlog file ') 'Error,no ra or dec data in the star_cat catlog file ')
raise ValueError( raise ValueError(
'Error,no ra data in the star_cat catlog file ') 'Error,no ra or dec data in the star_cat catlog file ')
#
if 'dec' not in self.star.names:
print('no ra')
self.log.error(
'Error,no dec data in the star_cat catlog file ')
raise ValueError(
'Error,no dec data in the star_cat catlog file ')
if self.star['ra'].max() > 360 or self.star['ra'].min() < 0 or self.star['dec'].max() > 90 or self.star['dec'].min() < -90: if self.star['ra'].max() > 360 or self.star['ra'].min() < 0 or self.star['dec'].max() > 90 or self.star['dec'].min() < -90:
self.log.error( self.log.error(
...@@ -2398,20 +2383,12 @@ class MCIsimulator(): ...@@ -2398,20 +2383,12 @@ class MCIsimulator():
# #
# test input data # test input data
try: try:
srcs_cat[kkk].header['new_ra'] srcs_cat[kkk].header['new_ra']+srcs_cat[kkk].header['new_dec']
except NameError:
self.log.error(
'Error,no ra data in the input galaxy data file ')
raise ValueError(
'Error,no ra data in the input galaxy data file ')
#
try:
srcs_cat[kkk].header['new_dec']
except NameError: except NameError:
self.log.error( self.log.error(
'Error,no dec data in the input galaxy data file ') 'Error,no ra or dec data in the input galaxy data file ')
raise ValueError( raise ValueError(
'Error,no dec data in the input galaxy data file ') 'Error,no ra or dec data in the input galaxy data file ')
if srcs_cat[kkk].header['new_ra'] > 360 or srcs_cat[kkk].header['new_ra'] < 0 or srcs_cat[kkk].header['new_dec'] > 90 or srcs_cat[kkk].header['new_dec'] < -90: if srcs_cat[kkk].header['new_ra'] > 360 or srcs_cat[kkk].header['new_ra'] < 0 or srcs_cat[kkk].header['new_dec'] > 90 or srcs_cat[kkk].header['new_dec'] < -90:
self.log.error( self.log.error(
......
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