correlator.c -- A program for calculating values of several different correlation function estimators using given data and random samples.
# Hamilton estimator ./correlator correlation.dat data.dat random_sample.dat 4
# Landy-Szalay estimator by default ./correlator correlation.dat data.dat random_sample.dat
The following arguments must be given, in this order: OUT
DATA
CMP
.
In addition, METHOD
can be given.
OUT
-- Filename where the calculated data should be stored.
DATA
-- Filename where to search for the data for which the correlation
function estimator should be calculated for.
CMP
-- Filename where to search for the binomial random field to use in
the Monte Carlo calculation.
METHOD
-- Optional. Which correlation estimator to use. Valid choices
are:
All the files are to be in ASCII format, with numerical fields separated by whitespaces and newlines for human readability.
The random sample file should have the following format:
number of points (N) data low bound (3 components, separated by whitespace) data high bound (3 components, separated by whitespace) point 1 (3 components, separated by whitespace) . . . point N (3 components, separated by whitespace)
The data file should have a format otherwise identical to the random sample file, except that the following rows should be added to the very beginning of the file:
number of scale bins (N_s) bin 1 (2 components, low and high bounds, whitespace separated) . . bin N_s
Result in OUTFILE will have one row for each bin, with the following columns in this order: bin low bound, high bound, value of ksi, Poisson error
Written in 2006 for the benefit of Tuorla Observatory Cosmological Simulations research group by Pauli Pihajoki.
Copyright (c) 2006, Pauli Pihajoki All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.