### Get Current OMP Threads Source: https://rmjarvis.github.io/TreeCorr Get the current number of OpenMP threads being used by TreeCorr. ```python import treecorr print(treecorr.get_omp_threads()) ``` -------------------------------- ### Run Corr3 with Python API Source: https://rmjarvis.github.io/TreeCorr Execute the `corr3` function using the Python API. This allows for the calculation of three-point correlation functions. ```python import treecorr # Example usage with dummy data cat1 = treecorr.Catalog(x=[1,2,3], y=[4,5,6], g1=[0.1,0.2,0.3], g2=[0.3,0.2,0.1]) cat2 = treecorr.Catalog(x=[7,8,9], y=[1,2,3], g1=[0.1,0.2,0.3], g2=[0.3,0.2,0.1]) cat3 = treecorr.Catalog(x=[4,5,6], y=[7,8,9], g1=[0.1,0.2,0.3], g2=[0.3,0.2,0.1]) # NNN correlation nn = treecorr.NNNCorrelation(nbins=10, min=0.1, max=10.0) nn.process(cat1, cat2, cat3) print(f"NNN correlation: {nn.mean:.3f} +/- {nn.sigma:.3f}") # GGG correlation ggg = treecorr.GGGCorrelation(nbins=10, min=0.1, max=10.0) ggg.process(cat1, cat2, cat3) print(f"GGG correlation: {ggg.mean:.3f} +/- {ggg.sigma:.3f}") ``` -------------------------------- ### Run Corr2 with Python API Source: https://rmjarvis.github.io/TreeCorr Execute the `corr2` function using the Python API. This is an alternative to using the command-line executable. ```python import treecorr # Example usage with dummy data cat1 = treecorr.Catalog(x=[1,2,3], y=[4,5,6], g1=[0.1,0.2,0.3], g2=[0.3,0.2,0.1]) cat2 = treecorr.Catalog(x=[7,8,9], y=[1,2,3], g1=[0.1,0.2,0.3], g2=[0.3,0.2,0.1]) # NN correlation nn = treecorr.NNCorrelation(nbins=10, min=0.1, max=10.0) nn.process(cat1, cat2) print(f"NN correlation: {nn.mean:.3f} +/- {nn.sigma:.3f}") # GG correlation gg = treecorr.GGCorrelation(nbins=10, min=0.1, max=10.0) gg.process(cat1, cat2) print(f"GG correlation: {gg.mean:.3f} +/- {gg.sigma:.3f}") ``` -------------------------------- ### Build Multi-Covariance Design Matrix Source: https://rmjarvis.github.io/TreeCorr Build the design matrix for estimating the covariance of multiple correlation functions. This is a prerequisite for using `estimate_multi_cov`. ```python import treecorr # Assuming 'corr' is a pre-defined Corr2 object design_matrix = corr.build_multi_cov_design_matrix() ``` -------------------------------- ### Estimate Multi-Covariance Matrix Source: https://rmjarvis.github.io/TreeCorr Estimate the covariance matrix for multiple correlation functions. This function is useful for understanding the statistical uncertainties in correlation measurements. ```python import treecorr # Assuming 'corr' is a pre-defined Corr2 object cov = corr.estimate_multi_cov() ``` -------------------------------- ### Set Maximum OMP Threads Source: https://rmjarvis.github.io/TreeCorr Set the maximum number of OpenMP threads that can be used by TreeCorr. This should be called before any other TreeCorr functions. ```python import treecorr treecorr.set_max_omp_threads(4) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.