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

update

parent 6c6b430c
Loading
Loading
Loading
Loading
Loading
+24 −24
Original line number Diff line number Diff line
@@ -1398,7 +1398,7 @@ class MCIsimulator():
            df2 = pandas.read_csv(
                self.information['dir_path']+'MCI_inputData/star_input/'+starcat)
            ###
          
            #
            try:
                df2['ra_gaia'][10]
            except NameError:
@@ -1406,7 +1406,7 @@ class MCIsimulator():
                    'Error,no ra 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:
@@ -1414,13 +1414,13 @@ class MCIsimulator():
                    '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:
                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)]

@@ -1454,7 +1454,7 @@ class MCIsimulator():
                    'Error,no ra data in the star_cat catlog file ')
                raise ValueError(
                   'Error,no ra data in the star_cat catlog file ')
                
            #
            try:
                self.star['dec'][10]
            except NameError:
@@ -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:
@@ -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:
                    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:
                    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: