Pre-Processing

We provide a suite of Python scripts to create input files for the RascalC code. These are found in the python/ directory.

Coordinate Conversion

This converts a set of input particles (either random particle or galaxy positions) in the form {RA,Dec,redshift,weight} to the Cartesian form {x,y,z,weight}, given some cosmological parameters (using a WCDM coordinate converter by Daniel Eisenstein). The output coordinates are in comoving Mpc/h units, and are saved as an ASCII file for later use.

Usage:

python python/convert_to_xyz.py {INFILE} {OUTFILE} [{OMEGA_M} {OMEGA_K} {W_DARK_ENERGY}]

Parameters:

  • {INFILE}: Input data file containing {RA,Dec,redshift,weight} coordinates for each particle. This should be in the form of an input ASCII datafile, with each particle on a separate row.

  • {OUTFILE}: Output .txt, .dat or .csv filename.

  • Optional {OMEGA_M}: Current matter density, \(\Omega_m\) (default 0.31)

  • Optional {OMEGA_K}: Current curvature density. \(\Omega_k\) (default 0)

  • Optional {W_DARK_ENERGY}: Dark energy equation of state parameter, \(w_\Lambda\) (default -1)

Adding Jackknives

This function assigns each particle (either random particles or galxy positions) to a jackknife region, j, by assigning a HEALPix pixel number to each datapoint, with a given value of NSIDE. Data is saved as an ASCII file with {x,y,z,w,j} columns. NB: This is only required for the JACKKNIFE mode, and the code will simply ignore the jackknife numbers (if present) if run in other modes.

Usage:

python python/create_jackknives.py {INFILE} {OUTFILE} {HEALPIX_NSIDE}

Parameters:

  • {INFILE}: Input data ASCII file of (random/galaxy) Cartesian particle positions with space-separated columns {x,y,z,w}, such as that created by the Coordinate Conversion script. This can be in .txt, .dat or .csv format.

  • {OUTFILE}: Output .txt, .dat or .csv filename.

  • {HEALPIX_NSIDE}: HealPix NSIDE parameter which controls the number of pixels used to divide up the sky. For NSIDE = \(n\), a total of \(12n^2\) pixels are used.

Take Subset of Particles

A utility function to reduce the number of particles in an input ASCII file to a given number. This is primarily used to select a random subsample of the random particle file to speed computation.

Usage:

python pythom/take_subset_of_particles.py {INFILE} {OUTFILE} {N_PARTICLES}

Parameters:

  • {INFILE}: Input data ASCII file with particle positions, in {x,y,z,w}, {x,y,z,w,j} or {RA,Dec,redshift,w} format.

  • {OUTFILE}: Outfile .txt, .dat or .csv filename.

  • {N_PARTICLES}: Desired number of particles in output file. A random sample of length N_PARTICLES is selected from the input file.

Create Binning Files

A utility function to create radial binning files used by RascalC. We provide three scripts for different binning regimes. This file may be alternatively specified by the user, in the format described in File Inputs.

  • Linear: Bins are linearly spaced bins in \((r_\mathrm{min},r_\mathrm{max})\).

  • Logarithmic: Bins are evenly spaced in logarithmic space (base \(e\)) in \((r_\mathrm{min},r_\mathrm{max})\).

  • Hybrid: Bins are logarithmically spaced in \((r_\mathrm{min},r_\mathrm{cutoff})\), then linearly spaced in \((r_\mathrm{cutoff},r_\mathrm{max})\).

Usage:

python python/write_binning_file_linear.py {N_BINS} {MIN_R} {MAX_R} {OUTPUT_FILE}
python python/write_binning_file_logarithmic.py {N_BINS} {MIN_R} {MAX_R} {OUTPUT_FILE}
python python/wrtie_binning_file_hybrid.py {N_LOG_BINS} {N_LIN_BINS} {MIN_R} {CUTOFF_R} {MAX_R} {OUTPUT_FILE}

Parameters:

  • {N_BINS}: Total number of linear or logarithmic bins.

  • {MIN_R}: Minimum bin radius, \(r_\mathrm{min}\).

  • {MAX_R}: Maximm bin radius, \(r_\mathrm{max}\).

  • {N_LOG_BINS}: Number of logarithmic bins for hybrid binning.

  • {N_LIN_BINS}: Numer of linear bins for hybrid binning.

  • {CUTOFF_R}: Radius at which to switch from logarithmic to linear binning, \(r_\mathrm{cutoff}\) (for hybrid binning).

  • {OUTPUT_FILE}: Output .txt, .csv or .dat filename.