def getTotalPosition(self): allTotalSources = \ ce.component_extractor( self.TotalImage, smoothing=0., \ redshift=self.redshift,\ filtername='gauss_5.0_9x9.conv') self.xTotalPositions = allTotalSources['X_IMAGE'] self.yTotalPositions = allTotalSources['Y_IMAGE']
def getStellarPosition( self ): allStellarSources = \ ce.component_extractor( self.StellarImage, smoothing=0., \ redshift=self.redshift,\ filtername='gauss_5.0_9x9.conv') if 'X_IMAGE' in allStellarSources.dtype.names: self.xStellarPositions = allStellarSources['X_IMAGE'] self.yStellarPositions = allStellarSources['Y_IMAGE']
def getDarkMatterPositions( self ): stellarMass = fits.open( self.StellarImage )[0].data totalMass = fits.open( self.TotalImage )[0].data gasMass = fits.open( self.GasImage )[0].data dmMass = totalMass - stellarMass - gasMass randomStr = str(np.random.random_integers(0,10000)) DMfile = 'DMmass_'+str(randomStr)+'.fits' fits.writeto( DMfile, dmMass ) allDMSources = \ ce.component_extractor( DMfile, smoothing=0., \ redshift=self.redshift,\ filtername='gauss_5.0_9x9.conv') self.xDarkMatterPositions = allDMSources['X_IMAGE'] self.yDarkMatterPositions = allDMSources['Y_IMAGE'] os.system('rm -fr '+DMfile)