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

update

parent 6c6b430c
Pipeline #7613 failed with stage
in 0 seconds
......@@ -1398,29 +1398,29 @@ class MCIsimulator():
df2 = pandas.read_csv(
self.information['dir_path']+'MCI_inputData/star_input/'+starcat)
###
#
try:
df2['ra_gaia'][10]
except NameError:
self.log.error(
'Error,no ra data in the star_cat catlog file ')
raise ValueError(
'Error,no ra data in the star_cat catlog file ')
'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 ')
if df2['ra_gaia'].max()>360 or df2['ra_gaia'].min()<0 or df2['dec_gaia'].max()>90 or df2['dec_gaia'].min()<-90 :
'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:
self.log.error(
'ra or dec data beyond definition,please check!')
raise ValueError(
'ra or dec data beyond definition,please check!')
#
df3 = df2[(abs(df2['ra_gaia']-df2['ra_gaia'].mean()) < 400/3600.0)
& (abs(df2['dec_gaia']-df2['dec_gaia'].mean()) < 400/3600.0)]
......@@ -1453,17 +1453,17 @@ class MCIsimulator():
self.log.error(
'Error,no ra data in the star_cat catlog file ')
raise ValueError(
'Error,no ra data in the star_cat catlog file ')
'Error,no ra data in the star_cat catlog file ')
#
try:
self.star['dec'][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 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(
'ra or dec data beyond definition,please check!')
raise ValueError(
......@@ -2351,16 +2351,16 @@ class MCIsimulator():
if not os.path.exists(filename):
print('finish load all the input galaxy image fits files')
#
self.log.error(
'Error, when load input galaxy image fits files')
raise ValueError(
'Error, when load input galaxy image fits files')
#
break
srcs_cat = fits.open(filename)
#
# ### load galaxy SED fitsfile ###
if self.lensing:
......@@ -2383,7 +2383,7 @@ class MCIsimulator():
dec_list = []
for kkk in range(1, len(srcs_cat)):
#
# test input data
try:
srcs_cat[kkk].header['new_ra']
......@@ -2392,7 +2392,7 @@ class MCIsimulator():
'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:
......@@ -2401,12 +2401,12 @@ class MCIsimulator():
raise ValueError(
'Error,no 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(
'Gal ra or dec data beyond definition, please check!')
raise ValueError(
'Gal ra or dec data beyond definition, please check!')
#
#
t1 = srcs_cat[kkk].header['new_ra'] - \
self.information['gal_ra'] + self.information['star_ra']
ra_list.append(float(t1))
......@@ -2456,19 +2456,19 @@ class MCIsimulator():
# # SED of j-th galaxy ,# unit of 10-17 erg/s/A/cm2
# here is k1+1, not k1, k1 begins with 0
gal_flux = srcs_sed[k1+1].data
if gal_flux.min()<0 or len(gal_flux)<100:
#
if gal_flux.min() < 0 or len(gal_flux) < 100:
self.log.error(
'Galaxy SED data error, please check!')
raise ValueError(
'Galaxy SED data error, please check!')
if srcs_cat[k1+1].data.min()<0 or srcs_cat[k1+1].data.max==0 or srcs_cat[k1+1].data.ndim !=2:
#
if srcs_cat[k1+1].data.min() < 0 or srcs_cat[k1+1].data.max == 0 or srcs_cat[k1+1].data.ndim != 2:
self.log.error(
'Galaxy image data error, please check!')
raise ValueError(
'Galaxy image data error, please check!')
#
################################
# ## rotate the lensed_images_g ###
if abs(theta.deg) > 0:
......@@ -5814,7 +5814,7 @@ class MCIsimulator():
self.applyRadiationDamage()
print('applyRadiationDamage()')
#####################################################################
##### apply readoutNoise ######
# #### apply readoutNoise ######
if self.readoutNoise:
self.applyReadoutNoise()
......
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