;Get bootstrap errors on w(theta) for nbootstrap samples pro get_wtheta_bootstrap_errors, nbootstrap, seed, dist, r_arr, $ xi_random, infile, radec_cent, mask_file, mask, mask_hdr, rmin, rmax, $ nbin, img, $ ra_min, dec_min, ra_max, dec_max, spix, $ non_masked_img, wtheta_err, xstart = xstart,$ ystart = ystart ;print, 'in get_wtheta_bootstrap_errors' ;help, mask_hdr wtheta_boot = dblarr(nbootstrap, nbin) for iboot = 0, nbootstrap-1 do begin ;get xi_img for current bootstrap sample 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 num = dblarr(nbin) den = dblarr(nbin) ;Loop over bins in r and integrate 'xi(r)' for ibin = 0, nbin-1 do begin search = where(dist GT r_arr[ibin] and dist LE r_arr[ibin +1]) dr = r_arr[ibin +1] - r_arr[ibin] dr2 = dist[search]*dr*2.*!dpi num[ibin] = total(xi_img_bootstrap[search]*dr2) den[ibin] = total(xi_random[search]*dr2) endfor wtheta_boot[iboot, *] = num/den ;; window, 3, xs = 500, ys = 500, retain = 2, title = 'boot' ;; plot, [0.],[0.], xrange = [rmin, rmax], xs = 1, yrange = [10^(-5.), 1.], $ ;; ys = 1,/nodata, /xlog, /ylog,charsize = 1.25, xtitle = '!7h!3',$ ;; ytitle = '!3w(!7h)!3' ;; vsym, 24, /fill ;; oplot, r_arr, wtheta_boot[iboot, *], psym = 8, symsize= 1. endfor ;get errors wtheta_err = dblarr(nbin) for ibin = 0, nbin -1 do begin wtheta_err[ibin] = stddev(wtheta_boot[*, ibin]) endfor end