Created
August 24, 2016 00:58
-
-
Save manodeep/43cb51159b379e182a430b6f833c1224 to your computer and use it in GitHub Desktop.
Testing gridlink bug for issue #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import Corrfunc | |
from Corrfunc._countpairs_mocks import countpairs_rp_pi_mocks as DDrppi_mocks | |
import numpy as np | |
def main(): | |
version = Corrfunc.__version__ | |
print("Using Corrfunc from file: {0} with version = {1}" | |
.format(Corrfunc.__file__, version)) | |
cosmology = 1 | |
pimax = 80.0 | |
nthreads = 1 | |
autocorr = 1 | |
binfile = './rp_bins.txt' | |
filename = './corrfunc_example.txt' | |
dtype = np.float | |
ra, dec, cz = np.genfromtxt(filename, dtype=dtype, unpack=True) | |
print("old version = {0}".format(version < '1.9.0')) | |
if version < '1.9.0': | |
# Older version of Corrfunc | |
results = DDrppi_mocks(autocorr, cosmology, nthreads, pimax, | |
binfile, ra, dec, cz, | |
ra, dec, cz) | |
else: | |
# New version of Corrfunc (no longer have to specify the | |
# second set of arrays for autocorr=1. Additional verbosity | |
# controls + requesting rpavg at runtime. | |
results = DDrppi_mocks(autocorr, cosmology, nthreads, pimax, | |
binfile, ra, dec, cz, | |
output_rpavg=True, verbose=True) | |
num_bins_to_print = 10 | |
print("results [0:{0}] = {1}".format(num_bins_to_print, | |
results[0:num_bins_to_print])) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment