Box executables¶
Two programs search a box from a parameter file: bitvf, on a tracer
catalogue, and bitvf-field, on a field given at the centres of the cells
of a box lattice, with no tracers (below).
bitvf runs a void search from a parameter file, with no code to write:
from the tracers on (a pipeline run), or from a file written earlier. It is
built and installed with the C++ library (bin/bitvf under the install
prefix); it is not in the Python package.
bitvf <parameter-file>
--help prints the usage, the two options and the address of the
documentation of the keys, --version prints bitvf <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, the program prints the usage
line to stderr and exits with 1.
The parameter file has otswap’s syntax: one key = value per line, # for
comments, double quotes around a value that holds spaces. A key left out
takes the library’s default; a key with no default must be set. key =,
with no value, means “none” for the keys that accept it, the same as leaving
the key out. A key that is unknown, or that does not apply to the run, is an
error: a key of the other geometry is reported as “does not apply to a box”
or “does not apply to a lightcone”, a key of another kind of run or whose
switch is off as “does not apply to a run …”, naming the key that decides.
The commented file at the end of this page lists every key that applies to its run.
What bitvf runs¶
The input keys choose the kind of run; at most one of them is given.
Run |
Input key |
What it does |
|---|---|---|
pipeline |
none |
reads the tracers (and the randoms, when given) and runs |
from a reconstruction |
|
reads otswap’s complete displacement file and searches it with |
from mean displacements |
|
reads otswap’s mean displacement file and searches it as one realization with |
from a divergence |
|
reads a divergence file written with |
The box of a run from a file is the one the file records; only a pipeline
run takes box_min, box_max and mps.
The keys of bitvf¶
In the tables below, “Default” is the library’s, as the commented file lists
it; “none” means that the library computes or skips the value, and
“required” that the key must be set in every run it applies to. “Runs” lists
the runs the key applies to: “all”, “pipeline”, or the input key of the run;
“with <key>” names the switch the key needs. In any other run the key is
an error.
Run and input¶
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
|
required |
all |
|
the tracers |
required |
pipeline, |
|
3 columns, x y z in coordinate units: names, or 0-based indices in ASCII |
required |
pipeline, |
|
an integer column, not one of |
none: the row |
pipeline, |
|
the randoms of the reconstruction |
none: drawn uniformly in the box, |
pipeline |
|
3 columns, x y z |
required |
pipeline, with |
|
one character, for the ASCII tracer and random files |
|
pipeline, |
|
a divergence file written with |
— |
its run |
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
|
|
all |
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
otswap’s complete displacement file, as |
— |
its run |
|
otswap’s mean displacement file, as |
— |
its run |
|
a divergence file, as |
none: the search builds its own grid |
|
Reconstruction¶
Read by otswap; otswap’s executable page explains them.
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
realizations of the reconstruction, at least 1 |
|
pipeline |
|
convergence, strictly between 0 and 1 |
|
pipeline |
|
unsigned; 0 draws one, recorded in the files |
|
pipeline |
|
cell of the neighbour search, in mps, positive; changes the speed only |
|
pipeline |
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
the box, three values each, finite, max above min; both or neither |
none: the bounding box of the tracers, and of the randoms when given |
pipeline |
|
mean particle separation, in coordinate units, positive |
none: otswap’s |
pipeline |
Void finder¶
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
width of the Gaussian smoothing, non-negative; 0 for none |
|
all |
|
|
|
all |
|
side of the divergence cell, in mps, positive |
none: min(1, (20 / R)^(1/3)), R the realizations searched, 1 from a mean displacement file |
pipeline, |
Correction of redshift-space distortions¶
With perform_recons = true the tracers are taken as redshift-space
positions: they are corrected along the line of sight, reconstructed again
and searched in real space. The other keys of this section apply only then.
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
|
|
pipeline |
|
in (0, 1] |
required |
pipeline, with |
|
positive |
required |
pipeline, with |
|
the dark energy equation of state |
|
pipeline, with |
|
of the box, in [0, 10] |
required |
pipeline, with |
|
linear bias of the tracers, positive |
required |
pipeline, with |
|
the line of sight, 0, 1 or 2 for x, y or z |
required |
pipeline, with |
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
width of the neighbour average of the displacements, in coordinate units, non-negative; 0 for none. For coordinates in Mpc/h, 10 is a reasonable start |
required |
pipeline, with |
|
|
|
pipeline, with |
|
|
|
pipeline, with |
|
|
|
pipeline, with |
Output¶
Key |
Value |
Default |
Runs |
|---|---|---|---|
|
a directory, created if missing |
required |
all |
|
the name in every file name, with no |
required |
all |
|
|
|
all |
|
otswap’s mean and complete displacement files of each reconstruction |
|
pipeline |
|
the divergence file: the divergence and the weight of each cell, also smoothed with sigma > 0 |
|
all |
|
the galaxies file: where each tracer ended up |
|
all |
|
the overdense basins file |
|
all |
Output files¶
Written after the run, in this order, each into output_dir with the name
<stem>_<output_file>.<output_format>:
otswap’s files, pipeline only: with
perform_recons,displacement_mean_zspace_anddisplacement_complete_zspace_of the first reconstruction; thendisplacement_mean_anddisplacement_complete_of the reconstruction the voids come from; thenreconstructed_catalogue_; each as itsprintkey asks.With
save_zspace_voids, the redshift-space pass:voids_zspace_,overdense_basins_zspace_,divergence_zspace_,galaxies_zspace_.The voids:
voids_always, thenoverdense_basins_,divergence_,galaxies_, as asked.
Their columns and keywords are on the box file formats page. An existing file is overwritten.
bitvf-field¶
bitvf-field searches the voids of a field given at the centres of the
cells of a box lattice, with no tracers, with
bitvf::findVoidsBoxFromField(). It is built and installed with
bitvf (bin/bitvf-field), and takes the same options and the same
parameter-file syntax:
bitvf-field <parameter-file>
Key |
Value |
Default |
|---|---|---|
|
|
|
|
the table of the field, one row per cell, any row order |
required |
|
3 columns, x y z of the cell centres |
required |
|
the column of the field |
required |
|
the column of the smoothing weights |
none: uniform |
|
one character |
|
|
mean particle separation, positive, the unit of a sigma in mps |
none |
|
width of the Gaussian smoothing, non-negative; 0 for none |
|
|
|
|
|
as |
|
|
the overdense basins file |
|
|
the divergence file: the field and the weight, also smoothed with sigma > 0 |
|
The defaults together are an error: sigma is in mps and mps has no value. A
run sets mps, or sigma_unit = coordinate, or sigma = 0. The field is
split at 0, voids below it: a density, or a contrast with voids above 0, must
be shifted or flipped first. A divergence file of bitvf is valid input,
with cellX cellY cellZ, divergence and weight: the field before
smoothing, since the run smooths it, and divergenceSmoothed would be
smoothed twice.
It writes voids_ always, then overdense_basins_ and divergence_ as
asked, with the names of bitvf, and no galaxies file.
Exit status and messages¶
A run that succeeds exits with 0. The library’s report lines start with
bitvf: ; at normal and detailed, each file written is reported as
bitvf: wrote <path>.
Every error is one line on stderr, bitvf: error: <message>, and exit
status 1. Errors in the parameter file name the file, and the line of the
key when it is given: run.ini:7: key 'Nrec': '8.0' is not an integer. A
missing key has no line: run.ini: key 'output_dir' is missing. Unknown
keys and keys that do not apply are reported all at once, one line each,
before anything is read. Apart from those of the parameter file, an error
raised by otswap starts otswap: . When a writer fails, the files already
written stay.
bitvf-field reports in the same way, with bitvf-field in place of
bitvf in its own lines.
The commented parameter files¶
examples/executable/box.ini runs bitvf on the halos of the
examples, as the full reconstruction example does, and writes
the same voids file; examples/executable/field.ini runs
bitvf-field on the field of the field example. From the repository root:
bitvf examples/executable/box.ini
bitvf-field examples/executable/field.ini
# A box run of bitvf: optimal-transport reconstruction of halos observed in
# redshift space, correction of the redshift-space distortions, a second
# reconstruction in real space, and the void search on both passes. The run of
# the full_recons_box example, which writes the same voids_box.dat. Run from
# the repository root:
#
# bitvf examples/executable/box.ini
#
# Syntax: one "key = value" per line, "#" starts a comment. Every key that
# applies to this run is listed below; where the run needs another value than
# the library's default, the default is in the comment. A key left out of a
# file takes the default. "key =" (no value) means "none", as leaving the key
# out. Keys without a default (the paths, the columns, the output name, and
# the correction's cosmology, redshift, bias, axis and width) must be set. A
# key that does not apply to the run is an error, so the commented-out lines
# must stay so unless their switch is set. Every key is described at
# https://simosartori.github.io/bitvf/box/executable.html
geometry = box
verbosity = detailed # silent, normal or detailed; default normal
# ---------------------------------------------------------------------------
# Input: the tracers, in coordinate units (here Mpc/h)
# ---------------------------------------------------------------------------
tracer_file = examples/data/box_halos_redshift_space.dat
column_tracer = 0 1 2 # x, y, z: 0-based indices in ASCII, names in FITS
id_column = # integer identity of each tracer; none: the row
delimiter = " "
comment = "#"
# Randoms for the reconstruction. None: bitvf draws Nrec times as many as there
# are tracers, uniformly in the box, from a seed derived from seed.
random_file =
# column_random = 0 1 2 # required when random_file is set
# ---------------------------------------------------------------------------
# Reconstruction (otswap), for both passes
# ---------------------------------------------------------------------------
Nrec = 8 # realizations; default 30
threshold = 1e-2 # convergence; default 1e-3
seed = 12345 # 0, the default: drawn, and recorded in the files
mesh_cellsize = 4 # neighbour-search cell, in mps: speed only
box_min = 269 269 269 # the box, three values each; none, the default:
box_max = 669 669 669 # the bounding box of the tracers (and randoms)
mps = # mean particle separation; none: otswap's
# ---------------------------------------------------------------------------
# Void finder, on both passes
# ---------------------------------------------------------------------------
sigma = 1 # Gaussian smoothing width; 0 for none
sigma_unit = mps # mps or coordinate
cell_size = # divergence cell, in mps; none: min(1, cbrt(20 / Nrec))
# ---------------------------------------------------------------------------
# Correction of redshift-space distortions: with perform_recons = true the
# tracers are taken as redshift-space positions, corrected, reconstructed again
# and searched in real space. The keys below apply only then; those marked
# "no default" must be chosen.
# ---------------------------------------------------------------------------
perform_recons = true # default false
Omega_matter = 0.3186 # no default
little_h = 0.67 # no default
w0 = -1
wa = 0
redshift = 1 # of the box; no default
bias = 1.91255 # linear bias of the tracers; no default
los_axis = 1 # line of sight: 0, 1 or 2 for x, y or z; no default
rsd_smoothing_scale = 10 # in coordinate units, 0 for none; no default
rsd_weight_by_realizations = false
save_zspace_voids = true # also search the redshift-space pass; default false
printRecCat = false # the corrected catalogue
# ---------------------------------------------------------------------------
# Starting from files instead of the tracers (at most one of the three; each
# makes the reconstruction, randoms and correction keys errors).
# With displacement_file or displacement_mean_file, tracer_file, column_tracer,
# id_column, delimiter and comment are errors too, and cell_size is an error
# when divergence_file is set; sigma, sigma_unit, divergence_file, cell_size
# and the output keys stay. With divergence_input_file, cell_size and
# divergence_file are errors, and tracer_file, column_tracer, id_column,
# delimiter and comment stay.
# ---------------------------------------------------------------------------
# displacement_file = displacement_complete_box.fits # otswap's printDisplComplete
# displacement_mean_file = displacement_mean_box.fits # otswap's printDisplMean
# divergence_input_file = divergence_box.fits # bitvf's printDiv; needs
# # tracer_file
# divergence_file = # with the first two: a divergence file whose grid is reused
# ---------------------------------------------------------------------------
# Output: voids_<output_file> is always written; with save_zspace_voids, the
# redshift-space pass writes the same files with zspace_ in their names
# ---------------------------------------------------------------------------
output_dir = examples/executable/output
output_file = box
output_format = dat # dat (ASCII) or fits
printDisplMean = false # otswap's mean displacements
printDisplComplete = false # otswap's complete displacements
printDiv = true # divergence_<output_file>; default false
printGal = false # galaxies_<output_file>: where each tracer ended up
printOverdense = false # overdense_basins_<output_file>
# A run of bitvf-field: voids of a field given at the centres of the cells of a
# box lattice, with no tracers. The field is smoothed (sigma > 0), split into
# basins at 0 (voids where it is below 0) and catalogued. The run of the field
# example, which writes the same voids_field.dat, on the divergence file that
# examples/executable/box.ini writes. Run from the repository root, after
# box.ini:
#
# bitvf-field examples/executable/field.ini
#
# Syntax as bitvf's parameter files. Every key that applies is listed below
# with the library's default as its value, except where the comment gives the
# default; a key left out of a file takes the default. "key =" (no value)
# means "none", as leaving the key out. Every key is described at
# https://simosartori.github.io/bitvf/box/executable.html
verbosity = normal # silent, normal or detailed
# ---------------------------------------------------------------------------
# Input: one row per cell, centres in coordinate units, any row order. The
# centres must form a lattice of cubic cells, one centre per node. A divergence
# file of bitvf is valid input (cellX cellY cellZ, divergence, weight).
# ---------------------------------------------------------------------------
field_file = examples/executable/output/divergence_box.dat
column_centre = cellX cellY cellZ # names, or 0-based indices in ASCII
# The field before smoothing, not divergenceSmoothed: the run smooths the
# field it reads, so the smoothed divergence would be smoothed twice
column_value = divergence
column_weight = weight # smoothing weight per cell; none, the default: uniform
delimiter = " "
comment = "#"
# ---------------------------------------------------------------------------
# Smoothing
#
# IMPORTANT: sigma is in mps by default (sigma = 1, sigma_unit = mps), and mps
# has no default. Without a value of mps the run stops with an error, so set
# one of:
# - mps = <mean particle separation>, to keep sigma in mps;
# - sigma_unit = coordinate, sigma in coordinate units (as below);
# - sigma = 0, no smoothing.
# ---------------------------------------------------------------------------
mps = # mean particle separation, in coordinate units; none
sigma = 15 # Gaussian width; 0 for none; default 1
sigma_unit = coordinate # default mps, which needs a value of mps
# ---------------------------------------------------------------------------
# Output: voids_<output_file> is always written
# ---------------------------------------------------------------------------
output_dir = examples/executable/output
output_file = field
output_format = dat # dat (ASCII) or fits
printOverdense = true # overdense_basins_<output_file>; default false
printDiv = false # divergence_<output_file>: the field, also smoothed with sigma > 0