The executable

otswap runs a reconstruction, and optionally the correction of its redshift-space distortions, from a parameter file, with no code to write. It is built and installed with the C++ library (bin/otswap under the install prefix); it is not in the Python package.

otswap <parameter-file>
otswap --help
otswap --version

--help prints the usage, the two options and the address of this page, --version prints otswap <version>; both go to stdout. Any other argument that starts with -- is refused with the usage line; a parameter file whose name starts with -- is given as ./--name. Without an argument, or with more than one, it prints the usage line to stderr and exits with 1.

The parameter file has the syntax of otswap::io::ParameterFile, described on the file formats page: one key = value per line, # for comments, double quotes around a value that holds spaces. key =, with no value, means “none” for the keys whose default is none (id_column, random_file in a box, z_min, z_max, d_min, d_max, box_min, box_max, mps), the same as leaving the key out; any other key needs a value. Four commented files, for a box, a periodic box, a lightcone on the sky and a lightcone in Cartesian coordinates, are in examples/executable, at the end of this page.

What it does

One run is one reconstruction, of a box or of a lightcone, on the tracers and randoms read from the files given. A lightcone is given on the sky, as right ascension, declination and redshift, or, with lightcone_input = cartesian, as comoving Cartesian coordinates with the observer at the origin. It writes the files asked for: the mean displacement of each tracer, every realization, and in a lightcone the mean particle separation profile. With perform_recons = true it then moves the tracers to real space, as otswap::realSpaceBox() or otswap::realSpaceLightcone() do, and writes the corrected catalogue.

There is one reconstruction only, on the observed tracers, in redshift space: no second reconstruction on the corrected catalogue, and no void search. The key perform_recons switches on the redshift-space correction, not the reconstruction, which always runs; its product is the corrected catalogue. For the mean displacements alone, set perform_recons = false and printDisplMean = true, and leave out the correction keys and, in a box, the cosmology. With perform_recons the reconstruction’s files therefore have zspace_ in their names, and the corrected catalogue is the only real-space product.

The corrected catalogue has one row per tracer, in the order of the input, with NaN coordinates for the tracers that were not moved. It cannot be given back to otswap as tracer_file, since a reconstruction refuses non-finite coordinates.

The Back-in-time Void Finder (BitVF), a package in preparation built on otswap, finds voids from the displacement field. Given otswap’s complete displacement file (displacement_complete_zspace_<name>) in a one-pass run, it finds voids in redshift space only: voids in the corrected catalogue need BitVF’s own two-pass run.

Paths in the parameter file are used as written: relative ones resolve against the current directory, not the parameter file’s.

Exit status and messages

The exit status is 0 when every file asked for is written, and 1 on any error. Nothing is written to stdout, except by --help and --version.

Every error is one line on stderr, otswap: error: <message>. The run stops at the first error, except for keys that are unknown or do not apply to the run: those are all reported at once. Everything that can be checked without the data is checked before any file is read, so a broken parameter file fails at once rather than after a long run. The messages name the parameter file, the line and the key:

otswap: error: run.ini:14: key 'Nrec': 0 is out of range; it must be at least 1
otswap: error: run.ini:9: key 'bins': does not apply to a box
otswap: error: run.ini: key 'units' is missing

Errors found by the library, in reading the data, the mask or the bias table, or during the reconstruction or the correction, are printed with the library’s own message. The library’s report, set by verbosity, also goes to stderr, in lines that start with otswap: and not with otswap: error: ; at normal and detailed the executable adds a line otswap: wrote <path> for each file it writes.

The keys

A key that is not listed here is an error (unknown key), and so is a key that does not apply to the run (does not apply to a box, to a lightcone, or to a run without <switch>, and, for a key of the other kind of lightcone input, does not apply to a lightcone with lightcone_input = sky or = cartesian): an applies-to column below marks with B the keys of a box, with L those of a lightcone, and with a switch those that apply only when it is on: perform_recons = true, random_file set, reject_mask_crossings = true, or, for a lightcone, lightcone_input = sky or cartesian. A key that is not required and not set takes its default, which is the library’s where there is one; a key with no library default is required in the runs it applies to.

Run

Key

Type

Default

Applies to

Meaning

geometry

string

required

B, L

box or lightcone

lightcone_input

string

sky

L

sky or cartesian: the coordinates of the tracers and randoms of a lightcone

verbosity

string

normal

B, L

silent, normal or detailed: what the reconstruction and the correction report

Input

Key

Type

Default

Applies to

Meaning

tracer_file

string

required

B, L

the tracers, ASCII or FITS by the extension

column_tracer

3 strings

required

B, L

box, or lightcone with lightcone_input = cartesian: x, y, z, in the coordinate units of the file; lightcone on the sky: right ascension, declination, redshift. Each an index from 0, or a column name

id_column

string

none, no IDs

B, L

an integer column of the tracer file, read exactly as the tracers’ IDs; it must not be one of column_tracer, and no ID may appear twice

random_file

string

box: none, the randoms are drawn uniformly in the box of box_min and box_max, or without it in the bounding box of the tracers; lightcone: required

B, L

the randoms, as tracer_file

column_random

3 strings

required

B with random_file, L

as column_tracer

units

string

required

L with lightcone_input = sky

degrees or radians: the angles of tracers and randoms

delimiter

character

" "

B, L

the column separator of every ASCII input, the bias file included; " " for a space, \t for a tab

comment

character

#

B, L

the character that starts a comment line in the same files

delimiter and comment apply even when every input is FITS, where they change nothing, so a parameter file stays valid when an input changes format.

Lightcone selection

Key

Type

Default

Applies to

Meaning

veto_mask_filename

string

required

L

the HEALPix FITS map of the observed sky; it also gives the sky area, for which the executable has no key of its own

z_min

double

none

L with lightcone_input = sky

the lower bound of the redshift cut, applied to tracers and randoms

z_max

double

none

L with lightcone_input = sky

the upper bound; not below z_min

d_min

double

none

L with lightcone_input = cartesian

the lower bound of the cut on the comoving distance from the origin, in coordinate units, applied to tracers and randoms

d_max

double

none

L with lightcone_input = cartesian

the upper bound; not below d_min

Cosmology

Key

Type

Default

Applies to

Meaning

Omega_matter

double

required

L, B with perform_recons; optional with lightcone_input = cartesian unless perform_recons

Ω_m of a flat w0-wa cosmology, in (0, 1]

little_h

double

required

L, B with perform_recons; optional as Omega_matter

H0 / (100 km/s/Mpc), positive

w0

double

-1

L, B with perform_recons; only with Omega_matter and little_h

w(a) = w0 + wa (1 - a)

wa

double

0

L, B with perform_recons; as w0

The cosmology gives a otswap::DistanceTable over redshifts 0 to 10, with distances in Mpc/h. In a lightcone on the sky it turns redshifts into distances; in a box it is used only for the growth rate at redshift, so a box without perform_recons takes none of these keys. A lightcone on the sky beyond redshift 10, or a correction that needs a position or a box redshift beyond it, fails with the library’s message; a Cartesian reconstruction gives such tracers a NaN redshift.

A lightcone with lightcone_input = cartesian needs no cosmology to be reconstructed: the reconstruction uses distances only. Giving Omega_matter and little_h, both or neither, builds the table, which then fills the redshift of each tracer, written in the displacement files with the table itself; without it the redshifts are NaN. The cosmology is required with perform_recons, whose correction needs the growth rate f(z) and the bias b(z) at the tracers’ redshifts. A Cartesian lightcone given a cosmology must have its coordinates in Mpc/h, the unit of the table’s distances.

Reconstruction

The guide gives advice on the keys of this section.

Key

Type

Default

Applies to

Meaning

Nrec

unsigned

30

B, L

the number of realizations, at least 1

threshold

double

1e-3

B, L

the convergence threshold of the swap loop, strictly between 0 and 1

seed

unsigned

0

B, L

the seed of the random streams; 0 draws one, written in the displacement files

mesh_cellsize

double

3

B, L

the grid cell size, in mean particle separations, positive; it changes the speed only

Box only:

Key

Type

Default

Applies to

Meaning

box_min

3 doubles

none

B

the lower x, y, z of the box, in coordinate units; with box_max or not at all

box_max

3 doubles

none

B

the upper x, y, z, each above box_min’s

mps

double

none: (V/N)^(1/3)

B

the mean particle separation, in coordinate units, positive

periodic

bool

false

B

the box is periodic, as described in the guide’s periodic box; requires box_min and box_max

Without box_min and box_max the box is the bounding box of the tracers and the randoms of random_file, or of the tracers alone without it.

Lightcone only:

Key

Type

Default

Applies to

Meaning

bins

unsigned

required

L

the bins of the mean particle separation profile, at least 1: redshift bins on the sky, distance bins with lightcone_input = cartesian

reject_mask_crossings

bool

true

L

reject a displacement whose path crosses unobserved pixels

max_unobserved_pixels_crossed

unsigned

0

L with reject_mask_crossings

the unobserved pixels in a row a path may cross; 0 rejects at the first

RSD correction

The guide gives advice on σ and on the weighting.

Key

Type

Default

Applies to

Meaning

perform_recons

bool

false

B, L

switch on the redshift-space correction: move the tracers to real space after the reconstruction

rsd_smoothing_scale

double

required

B, L with perform_recons

the width σ of the Gaussian average of the displacements, in coordinate units: Mpc/h in a lightcone on the sky, the unit of the input coordinates otherwise; non-negative, 0 for no average

rsd_weight_by_realizations

bool

false

B, L with perform_recons

weight each neighbour by its number of valid realizations

redshift

double

required

B with perform_recons

the box’s redshift, in [0, 10]

bias

double

required

B with perform_recons

the tracers’ linear bias, positive

los_axis

unsigned

required

B with perform_recons

the line of sight: 0, 1 or 2 for x, y or z

bias_file

string

required

L with perform_recons

the bias b(z): ASCII columns 0 and 1, redshift and bias, or a FITS table with REDSHIFT and BIAS

Output

Key

Type

Default

Applies to

Meaning

output_dir

string

required

B, L

the folder of the output files, created with its parents if missing

output_file

string

required

B, L

the <name> in the file names below: not empty, no /

output_format

string

dat

B, L

dat (ASCII) or fits

printDisplMean

bool

false

B, L

write the mean displacements

printDisplComplete

bool

false

B, L

write the complete displacements

printMps

bool

false

L

write the mean particle separation profile; a displacement file holds it, so a file of its own is written only when no displacement file is

printRecCat

bool

false

B, L with perform_recons

write the corrected catalogue; it must be true with perform_recons

A run must write something: without perform_recons, one of the print keys must be true. With perform_recons, printRecCat = true is required, the corrected catalogue being the correction’s only output.

Output files

<dir> is output_dir, <name> output_file, and <ext> dat or fits as output_format says. zspace_ is in the names exactly when perform_recons is true.

Key

File

Written by

printDisplMean

<dir>/displacement_mean_[zspace_]<name>.<ext>

otswap::io::writeDisplacementMean()

printDisplComplete

<dir>/displacement_complete_[zspace_]<name>.<ext>

otswap::io::writeDisplacementComplete()

printMps

<dir>/MPS_[zspace_]<name>.<ext>, only when neither displacement file is written

otswap::io::writeMpsProfile()

printRecCat

<dir>/reconstructed_catalogue_<name>.<ext>

otswap::io::writeRealSpaceCatalog()

In ASCII, each displacement file of a lightcone comes with two more files, the profile and the distance table a reader needs: displacement_mean_[zspace_]<name>.mps.dat and displacement_mean_[zspace_]<name>.distances.dat, and likewise for displacement_complete_; a Cartesian lightcone run without a cosmology has no distance table, and so no .distances file. In FITS they are extensions of the same file. With either displacement file the profile is written there, and printMps writes no MPS_ file of its own.

The file formats page gives the two layouts, ASCII (dat) and FITS (fits), and the columns and keywords of each file. The reconstruction’s files are written as soon as it ends, before the correction. Existing files of the same names are written over; no other file in <dir> is touched.

The example parameter files

The first two are run from the repository root, and write to examples/executable/output/ the corrected catalogue of the corresponding example, full_recons_box or full_recons_lightcone (see examples), byte for byte. The third, also run from the repository root, reconstructs and corrects the lightcone example given in Cartesian coordinates: its tracers and randoms converted with the example’s cosmology, in examples/data/, with its cut on the distance; it writes the mean displacement, its twin files and the corrected catalogue of the lightcone_cartesian example, byte for byte, under the executable’s file names. The fourth reconstructs and corrects the halos of the periodic_box example in their periodic box, and writes its mean displacement and its corrected catalogue, byte for byte, under the executable’s file names. Every key that applies to the run is set, those at their default included, and those without a default as key =.

# The otswap executable on the full_recons_box example: a reconstruction of
# halos in a box, in redshift space, then the correction to real space. It
# writes examples/executable/output/reconstructed_catalogue_box.dat, byte for
# byte the corrected catalogue of the full_recons_box example.
#
#   otswap examples/executable/box.ini
#
# run from the repository root: relative paths resolve against the current
# directory. Every key that applies to this run is set, those at their
# default included. "key =", with no value, means "none" for the keys that
# accept it, the same as leaving the key out. The keys are described in
# docs/executable.md.

# ---------------------------------------------------------------- Run

# box or lightcone; required
geometry = box

# what the run reports on stderr: silent, normal or detailed; default normal
verbosity = normal

# ---------------------------------------------------------------- Input

# the tracers, ASCII or FITS by extension; required
tracer_file = examples/data/box_halos_redshift_space.dat

# their x, y, z columns, in any unit, which every length below shares:
# indices from 0, or names; required
column_tracer = 0 1 2

# an integer column of the tracer file read as the tracers' IDs; this file
# has none; default none
id_column =

# the randoms; default none: drawn uniformly in the box given by box_min and
# box_max, or without it in the bounding box of the tracers
random_file = examples/data/box_randoms.dat

# their x, y, z columns; required with random_file
column_random = 0 1 2

# the column separator of every ASCII input, " " for a space, \t for a tab;
# default " "
delimiter = " "

# the character that starts a comment line in every ASCII input; default #
comment = "#"

# ---------------------------------------------------------------- Cosmology
# only for the growth rate at the box's redshift, so only with perform_recons

# Omega_m of a flat w0-wa cosmology; required with perform_recons
Omega_matter = 0.3186

# H0 / (100 km/s/Mpc); required with perform_recons
little_h = 0.67

# the dark energy equation of state, w(a) = w0 + wa (1 - a); default -1 and 0
w0 = -1
wa = 0

# ---------------------------------------------------------------- Reconstruction

# number of realizations, each on its own subset of the randoms; default 30;
# the example randoms hold 8 per tracer, and 8 keeps the example fast. For an
# analysis, start from the defaults of Nrec and threshold: the guide's section
# "Choosing the parameters" advises on both
Nrec = 8

# convergence threshold of the swap loop, in (0, 1); default 1e-3; 1e-2
# keeps the example fast
threshold = 1e-2

# seed of the random streams; default 0: one is drawn, and written in the
# displacement files
seed = 12345

# grid cell size, in mean particle separations; changes the speed only;
# default 3
mesh_cellsize = 3

# the box, lower and upper x, y, z in coordinate units, such as 269 269 269
# and 669 669 669, both or neither; default none: the bounding box of the
# tracers and the randoms. When the volume is known, give it: the mean
# particle separation then comes from its volume, not from the bounding box
box_min =
box_max =

# the mean particle separation, in coordinate units; default none: computed
# from the box, or from the bounding box of the tracers and the randoms
mps =

# the box is periodic: tracers and randoms outside it are wrapped into it and
# distances are minimum-image; needs box_min and box_max, each side an integer
# multiple of the shortest; default false
periodic = false

# ---------------------------------------------------------------- RSD correction

# move the tracers to real space after the reconstruction; default false
perform_recons = true

# width of the Gaussian average of the displacements, in coordinate units,
# 0 for none; required with perform_recons. 10 Mpc/h is a starting value, to
# be calibrated on the sample
rsd_smoothing_scale = 10

# weight each neighbour by its number of valid realizations; default false
rsd_weight_by_realizations = false

# the box's redshift, in [0, 10]; required with perform_recons
redshift = 1

# the tracers' linear bias; required with perform_recons
bias = 1.91255

# the line of sight: 0, 1 or 2 for x, y or z; required with perform_recons
los_axis = 1

# ---------------------------------------------------------------- Output

# the folder of the output files, created if missing; required
output_dir = examples/executable/output

# the name in every output file, not a path; required
output_file = box

# dat (ASCII) or fits; default dat
output_format = dat

# the mean displacement of each tracer, displacement_mean_[zspace_]<name>;
# default false
printDisplMean = false

# every realization, displacement_complete_[zspace_]<name>; default false
printDisplComplete = false

# the corrected catalogue, reconstructed_catalogue_<name>; must be true with
# perform_recons
printRecCat = true
# The otswap executable on the full_recons_lightcone example: a
# reconstruction of a lightcone, in redshift space, then the correction to
# real space. It writes
# examples/executable/output/reconstructed_catalogue_lightcone.dat, byte for
# byte the corrected catalogue of the full_recons_lightcone example.
#
#   otswap examples/executable/lightcone.ini
#
# run from the repository root: relative paths resolve against the current
# directory. Every key that applies to this run is set, those at their
# default included. "key =", with no value, means "none" for the keys that
# accept it, the same as leaving the key out. The keys are described in
# docs/executable.md.

# ---------------------------------------------------------------- Run

# box or lightcone; required
geometry = lightcone

# the lightcone's input: sky (right ascension, declination, redshift) or
# cartesian (x, y, z); default sky
lightcone_input = sky

# what the run reports on stderr: silent, normal or detailed; default normal
verbosity = normal

# ---------------------------------------------------------------- Input

# the tracers, ASCII or FITS by extension; required
tracer_file = examples/data/lightcone_tracers.dat

# their right ascension, declination and redshift columns: indices from 0,
# or names; required
column_tracer = 0 1 2

# an integer column of the tracer file read as the tracers' IDs; this file
# has none; default none
id_column =

# the randoms; required
random_file = examples/data/lightcone_randoms.dat

# their right ascension, declination and redshift columns; required
column_random = 0 1 2

# the unit of the angles of tracers and randoms: degrees or radians; required
units = degrees

# the column separator of every ASCII input, bias file included, " " for a
# space, \t for a tab; default " "
delimiter = " "

# the character that starts a comment line in every ASCII input; default #
comment = "#"

# ---------------------------------------------------------------- Selection

# the HEALPix FITS map of the observed sky; also gives the sky area; required
veto_mask_filename = examples/data/lightcone_mask.fits

# the redshift cut, applied to tracers and randoms, such as 0.885 and 1.10;
# default none
z_min =
z_max =

# ---------------------------------------------------------------- Cosmology
# a flat w0-wa cosmology: redshifts to distances, and the growth rate

# Omega_m; required
Omega_matter = 0.286

# H0 / (100 km/s/Mpc); required
little_h = 0.7

# the dark energy equation of state, w(a) = w0 + wa (1 - a); default -1 and 0
w0 = -1
wa = 0

# ---------------------------------------------------------------- Reconstruction

# number of realizations, each on its own subset of the randoms; default 30;
# the example randoms are enough for 8, and 8 keeps the example fast. For an
# analysis, start from the defaults of Nrec and threshold: the guide's section
# "Choosing the parameters" advises on both
Nrec = 8

# convergence threshold of the swap loop, in (0, 1); default 1e-3; 1e-2
# keeps the example fast
threshold = 1e-2

# seed of the random streams; default 0: one is drawn, and written in the
# displacement files
seed = 12345

# grid cell size, in mean particle separations; changes the speed only;
# default 3
mesh_cellsize = 3

# number of redshift bins of the mean particle separation profile; required
bins = 30

# reject a displacement whose path crosses unobserved pixels; default true
reject_mask_crossings = true

# the unobserved pixels in a row a path may cross before it is rejected; 0
# rejects at the first; only with reject_mask_crossings; default 0
max_unobserved_pixels_crossed = 0

# ---------------------------------------------------------------- RSD correction

# move the tracers to real space after the reconstruction; default false
perform_recons = true

# width of the Gaussian average of the displacements, in coordinate units
# (Mpc/h here), 0 for none; required with perform_recons. 10 Mpc/h is a
# starting value, to be calibrated on the sample
rsd_smoothing_scale = 10

# weight each neighbour by its number of valid realizations; default false
rsd_weight_by_realizations = false

# the tracers' linear bias b(z), ASCII columns redshift and bias, or a FITS
# table with REDSHIFT and BIAS; required with perform_recons
bias_file = examples/data/lightcone_bias.dat

# ---------------------------------------------------------------- Output

# the folder of the output files, created if missing; required
output_dir = examples/executable/output

# the name in every output file, not a path; required
output_file = lightcone

# dat (ASCII) or fits; default dat
output_format = dat

# the mean displacement of each tracer, displacement_mean_[zspace_]<name>;
# default false
printDisplMean = false

# every realization, displacement_complete_[zspace_]<name>; default false
printDisplComplete = false

# the mean particle separation profile, MPS_[zspace_]<name>, written only
# when no displacement file is (they hold the profile); default false
printMps = false

# the corrected catalogue, reconstructed_catalogue_<name>; must be true with
# perform_recons
printRecCat = true
# The otswap executable on the lightcone example given in Cartesian
# coordinates (x, y, z in Mpc/h, the observer at the origin): a reconstruction
# in redshift space, then the correction to real space. It writes, in
# examples/executable/output/, displacement_mean_zspace_lightcone_cartesian.dat
# with its twins .mps and .distances, and
# reconstructed_catalogue_lightcone_cartesian.dat: byte for byte the files
# displacement_lightcone_cartesian.dat (with its twins) and
# reconstructed_catalogue_lightcone_cartesian.dat of the lightcone_cartesian
# example, under the executable's file names.
#
#   otswap examples/executable/lightcone_cartesian.ini
#
# run from the repository root: relative paths resolve against the current
# directory. Every key that applies to this run is set, those at their
# default included. "key =", with no value, means "none" for the keys that
# accept it, the same as leaving the key out. The keys are described in
# docs/executable.md.

# ---------------------------------------------------------------- Run

# box or lightcone; required
geometry = lightcone

# the lightcone's input: sky (right ascension, declination, redshift) or
# cartesian (x, y, z); default sky
lightcone_input = cartesian

# what the run reports on stderr: silent, normal or detailed; default normal
verbosity = normal

# ---------------------------------------------------------------- Input

# the tracers, ASCII or FITS by extension; required
tracer_file = examples/data/lightcone_tracers_cartesian.dat

# their x, y and z columns, in coordinate units: indices from 0, or names;
# required
column_tracer = 0 1 2

# an integer column of the tracer file read as the tracers' IDs; this file
# has none; default none
id_column =

# the randoms; required
random_file = examples/data/lightcone_randoms_cartesian.dat

# their x, y and z columns; required
column_random = 0 1 2

# the column separator of every ASCII input, bias file included, " " for a
# space, \t for a tab; default " "
delimiter = " "

# the character that starts a comment line in every ASCII input; default #
comment = "#"

# ---------------------------------------------------------------- Selection

# the HEALPix FITS map of the observed sky; also gives the sky area; required
veto_mask_filename = examples/data/lightcone_mask.fits

# the cut on the comoving distance from the origin, applied to tracers and
# randoms, in coordinate units; the catalogue spans 2126 to 2500; default none
d_min = 2200
d_max = 2450

# ---------------------------------------------------------------- Cosmology
# a flat w0-wa cosmology: its table gives the tracers' redshifts, and the
# growth rate of the correction. Optional for the reconstruction, Omega_m
# and h both or neither, w0 and wa only with both; required with
# perform_recons. Its distances are in Mpc/h, so the coordinates must then
# be in Mpc/h too

# Omega_m
Omega_matter = 0.286

# H0 / (100 km/s/Mpc)
little_h = 0.7

# the dark energy equation of state, w(a) = w0 + wa (1 - a); default -1 and 0
w0 = -1
wa = 0

# ---------------------------------------------------------------- Reconstruction

# number of realizations, each on its own subset of the randoms; default 30;
# the example randoms are enough for 8, and 8 keeps the example fast. For an
# analysis, start from the defaults of Nrec and threshold: the guide's section
# "Choosing the parameters" advises on both
Nrec = 8

# convergence threshold of the swap loop, in (0, 1); default 1e-3; 1e-2
# keeps the example fast
threshold = 1e-2

# seed of the random streams; default 0: one is drawn, and written in the
# displacement files
seed = 12345

# grid cell size, in mean particle separations; changes the speed only;
# default 3
mesh_cellsize = 3

# number of distance bins of the mean particle separation profile; required
bins = 30

# reject a displacement whose path crosses unobserved pixels; default true
reject_mask_crossings = true

# the unobserved pixels in a row a path may cross before it is rejected; 0
# rejects at the first; only with reject_mask_crossings; default 0
max_unobserved_pixels_crossed = 0

# ---------------------------------------------------------------- RSD correction

# move the tracers to real space after the reconstruction; default false
perform_recons = true

# width of the Gaussian average of the displacements, in coordinate units,
# 0 for none; required with perform_recons. 10 Mpc/h is a starting value, to
# be calibrated on the sample
rsd_smoothing_scale = 10

# weight each neighbour by its number of valid realizations; default false
rsd_weight_by_realizations = false

# the tracers' linear bias b(z), ASCII columns redshift and bias, or a FITS
# table with REDSHIFT and BIAS; required with perform_recons
bias_file = examples/data/lightcone_bias.dat

# ---------------------------------------------------------------- Output

# the folder of the output files, created if missing; required
output_dir = examples/executable/output

# the name in every output file, not a path; required
output_file = lightcone_cartesian

# dat (ASCII) or fits; default dat
output_format = dat

# the mean displacement of each tracer, displacement_mean_[zspace_]<name>;
# default false
printDisplMean = true

# every realization, displacement_complete_[zspace_]<name>; default false
printDisplComplete = false

# the mean particle separation profile, MPS_[zspace_]<name>, written only
# when no displacement file is (they hold the profile); default false
printMps = false

# the corrected catalogue, reconstructed_catalogue_<name>; must be true with
# perform_recons
printRecCat = true
# The otswap executable on the periodic_box example: a reconstruction of
# halos in redshift space in a periodic box, with randoms drawn by otswap,
# then the correction to real space. It writes, in
# examples/executable/output/, displacement_mean_zspace_periodic_box.dat and
# reconstructed_catalogue_periodic_box.dat: byte for byte the files
# displacement_periodic_box.dat and reconstructed_catalogue_periodic_box.dat
# of the periodic_box example, under the executable's file names.
#
#   otswap examples/executable/periodic_box.ini
#
# run from the repository root: relative paths resolve against the current
# directory. Every key that applies to this run is set, those at their
# default included. "key =", with no value, means "none" for the keys that
# accept it, the same as leaving the key out. The keys are described in
# docs/executable.md.

# ---------------------------------------------------------------- Run

# box or lightcone; required
geometry = box

# what the run reports on stderr: silent, normal or detailed; default normal
verbosity = normal

# ---------------------------------------------------------------- Input

# the tracers, ASCII or FITS by extension; required
tracer_file = examples/data/periodic_halos.dat

# their x, y, z columns, in any unit, which every length below shares:
# indices from 0, or names; required. The file holds x, y, z in real space
# and then z in redshift space: the positions observed are columns 0, 1, 3
column_tracer = 0 1 3

# an integer column of the tracer file read as the tracers' IDs; this file
# has none; default none
id_column =

# the randoms; default none: drawn uniformly in the box given by box_min and
# box_max, or without it in the bounding box of the tracers
random_file =

# the column separator of every ASCII input, " " for a space, \t for a tab;
# default " "
delimiter = " "

# the character that starts a comment line in every ASCII input; default #
comment = "#"

# ---------------------------------------------------------------- Cosmology
# only for the growth rate at the box's redshift, so only with perform_recons

# Omega_m of a flat w0-wa cosmology; required with perform_recons. Here
# (omega_b + omega_c) / h^2 with omega_b = 0.02244 and omega_c = 0.1206
Omega_matter = 0.31864557807975047

# H0 / (100 km/s/Mpc); required with perform_recons
little_h = 0.67

# the dark energy equation of state, w(a) = w0 + wa (1 - a); default -1 and 0
w0 = -1
wa = 0

# ---------------------------------------------------------------- Reconstruction

# number of realizations, each on its own subset of the randoms; default 30; 8
# keeps the example fast. For an analysis, start from the defaults of Nrec and
# threshold: the guide's section "Choosing the parameters" advises on both
Nrec = 8

# convergence threshold of the swap loop, in (0, 1); default 1e-3; 1e-2
# keeps the example fast
threshold = 1e-2

# seed of the random streams; default 0: one is drawn, and written in the
# displacement files
seed = 12345

# grid cell size, in mean particle separations; changes the speed only;
# default 3
mesh_cellsize = 3

# the box, lower and upper x, y, z in coordinate units: required with
# periodic = true. The mean particle separation comes from its volume
box_min = 0 0 0
box_max = 1000 1000 1000

# the mean particle separation, in coordinate units; default none: computed
# from the box, or from the bounding box of the tracers and the randoms
mps =

# the box is periodic: tracers and randoms outside it are wrapped into it and
# distances are minimum-image; needs box_min and box_max, each side an integer
# multiple of the shortest; default false
periodic = true

# ---------------------------------------------------------------- RSD correction

# move the tracers to real space after the reconstruction; default false.
# The box is periodic, so the correction is too: neighbours are found across
# the faces, and each corrected coordinate is wrapped into the box
perform_recons = true

# width of the Gaussian average of the displacements, in coordinate units,
# 0 for none; required with perform_recons. 10 Mpc/h is a starting value, to
# be calibrated on the sample
rsd_smoothing_scale = 10

# weight each neighbour by its number of valid realizations; default false
rsd_weight_by_realizations = false

# the box's redshift, in [0, 10]; required with perform_recons
redshift = 0

# the tracers' linear bias; required with perform_recons
bias = 1.14

# the line of sight: 0, 1 or 2 for x, y or z; required with perform_recons
los_axis = 2

# ---------------------------------------------------------------- Output

# the folder of the output files, created if missing; required
output_dir = examples/executable/output

# the name in every output file, not a path; required
output_file = periodic_box

# dat (ASCII) or fits; default dat
output_format = dat

# the mean displacement of each tracer, displacement_mean_[zspace_]<name>;
# default false
printDisplMean = true

# every realization, displacement_complete_[zspace_]<name>; default false
printDisplComplete = false

# the corrected catalogue, reconstructed_catalogue_<name>; must be true with
# perform_recons
printRecCat = true