;get xi_img (to be normalized by xi_random) for a bootstrap sample ;basically buid a bootstrap sample from the data and then apply the ;same steps than the ones used or the full catalog pro get_xi_bootstrap, infile, radec_cent, mask_file, mask, mask_hdr, rmin, rmax, nbin, $ img, ra_min, dec_min, ra_max, dec_max, spix, $ non_masked_img, seed, xi_img_bootstrap, $ xstart = xstart, ystart = ystart ;print, 'in get_xi_bootstrap' ;help, mask_hdr ;read cat file cat = read_file(infile) nobj = n_elements(cat[0,*]) ;get random sample random_ind = fix(nobj*(randomu(seed, nobj))) cat_boot = cat[*, random_ind] bootstrap_file = 'bootstrap.cat' openw, 44, bootstrap_file printf, 44, cat_boot close, 44 ;get image fill_grid, bootstrap_file, radec_cent, mask_file, rmin, rmax, nbin, img, $ ra_min, dec_min, ra_max, dec_max, spix, non_masked_img, mask, $ mask_hdr, xstart = xstart, ystart = ystart nxpix = n_elements(img[*,0]) nypix = n_elements(img[0,*]) ;Get mean mean_img = mean(img[non_masked_img]) ;remove mean and normalize by mean (= compute the overdensity) img[non_masked_img] -= mean_img img[non_masked_img] /= mean_img ;Add zero values around img_zero = zero_around(img) ;compute ffts ... ft_img = fft(img_zero, /double) img_zero = 0 square_mod_img = (abs(ft_img))^2 ft_img = 0 xi_img_bootstrap = real_part(fft(square_mod_img, /inverse, /double)) square_mod_img = 0 ;shift subscripts nxpix = n_elements(xi_img_bootstrap[*,0]) nypix = n_elements(xi_img_bootstrap[0,*]) xi_img_bootstrap = shift(xi_img_bootstrap,nxpix/2 -1L, nypix/2 -1L) end