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():
self.nt_p = trapdata[:, 0]
self.sigma_p = trapdata[:, 1]
self.taur_p = trapdata[:, 2]
else:
# only one trap species
self.nt_p = [trapdata[0],]
self.sigma_p = [trapdata[1],]
self.taur_p = [trapdata[2],]
# else:
# # only one trap species
# self.nt_p = [trapdata[0],]
# self.sigma_p = [trapdata[1],]
# self.taur_p = [trapdata[2],]
trapdata = np.loadtxt(
self.values['dir_path']+self.values['serialtrapfile'])
......@@ -178,19 +178,19 @@ class CDM03bidir():
self.nt_s = trapdata[:, 0]
self.sigma_s = trapdata[:, 1]
self.taur_s = trapdata[:, 2]
else:
# only one trap species
self.nt_s = [trapdata[0],]
self.sigma_s = [trapdata[1],]
self.taur_s = [trapdata[2],]
# 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
# else:
# # only one trap species
# self.nt_s = [trapdata[0],]
# self.sigma_s = [trapdata[1],]
# self.taur_s = [trapdata[2],]
# # 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
def _setupLogger(self):
"""
......@@ -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.darknoise = self.config.getboolean(self.section, 'darknoise')
......@@ -1117,12 +1123,6 @@ class MCIsimulator():
# 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'])
self.result_path = self.information['result_path'] + \
......@@ -1400,20 +1400,12 @@ class MCIsimulator():
###
#
try:
df2['ra_gaia'][10]
df2['ra_gaia'][10]+df2['dec_gaia'][10]
except NameError:
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(
'Error,no ra 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 ')
'Error,no ra or 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:
self.log.error(
......@@ -1447,19 +1439,12 @@ class MCIsimulator():
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')
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(
'Error,no ra 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 ')
'Error,no ra or 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:
self.log.error(
......@@ -2398,20 +2383,12 @@ class MCIsimulator():
#
# test input data
try:
srcs_cat[kkk].header['new_ra']
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']
srcs_cat[kkk].header['new_ra']+srcs_cat[kkk].header['new_dec']
except NameError:
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(
'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:
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