This is a short example that takes you from galaxy catalog file and FITS weight file to a correlation function. We'll use a single CANDELS tile as the mask (the tile weight file with the name "hlsp_candels_hst_wfc3_gs-tot-sect33_f160w_v1.0_wht.fits" can be found here. It is too large to be included in the github repository so it must be downloaded and placed in the examples folder). We'll read in a randomly generated catalog that has been saved and included.
In [3]:
import AngularCatalog_class as ac
import astropy.io.fits as fits
from astropy.io import ascii
from numpy import ma
In [4]:
#Read in the galaxy catalog
data = ascii.read('example_data.dat')
#Generate an AngularCatalog with the ImageMask from the appropriate weight file
weight_file = 'hlsp_candels_hst_wfc3_gs-tot-sect33_f160w_v1.0_wht.fits'
cat = ac.AngularCatalog(data['ra'], data['dec'], weight_file = weight_file)
In [7]:
#Generate the random sample
cat.generate_random_sample(number_to_make=1e4)
#Set the theta binning
cat.set_theta_bins(10, 350, 7)
In [9]:
#Do the correlation function
cat.cf_bootstrap(n_boots=20, clobber=True, name="single_gal_cf")
In [ ]:
#Plot correlation function
cat.plot_cfs(which_cfs=['single_gal_cf'], labels=["Single gal bootstrap"], fmt='o-')
In [ ]: