Box file formats¶
bitvf writes four products of a search, each a table. The format follows the
extension of the file name: .fits, .fit and .fits.gz are FITS,
anything else is ASCII, with the layouts of otswap’s
tables: in ASCII, the
keywords as comment lines, then a ### line naming the columns, then one
row per line; in FITS, a binary table in HDU 2. The C++ functions are in the
namespace bitvf::io, the Python ones in the module bitvf.io; both run
the same code, so a file written from Python is the same, byte for byte, as
the one the C++ library writes.
An existing file is overwritten. Every check runs before the file is opened, so a call that raises leaves no file.
bitvf also reads its own divergence files and fields at cell centres (Reading).
The products¶
C++ |
Python |
Writes |
Rows |
|---|---|---|---|
the voids |
one per void |
||
the overdense basins |
one per basin |
||
the divergence grid ( |
one per cell |
||
where each tracer ended up ( |
one per input tracer, in input order |
The conventional file name of a product is <directory>/<stem>_<name>, with
the stems voids, overdense_basins, divergence and galaxies, and
<stem>_zspace_<name> for the redshift-space pass of a run with correction:
bitvf::io::fileName(), bitvf.io.file_name(). The
executable names its files this way.
Values¶
Lengths are in coordinate units, which bitvf cannot know: their columns carry no unit, and their descriptions say “in coordinate units”.
Counts and indices are 64-bit integers (FITS
K); flags are 32-bit integers (FITSJ) holding 0 or 1, and so isedgeFlag, holding 0, 1 or 2; every other column is a double (FITSD).ASCII writes doubles with 9 significant digits, or 17 in the divergence file, which then reads back as the same double. FITS stores the doubles themselves. NaN is written as NaN.
indexis the row of the file itself;voidIndex,overdenseIndexandcellIndexare rows of the voids, overdense basins and divergence files of the same result, -1 for none.
Keywords¶
Every file starts with these keywords, in this order:
Keyword |
Value |
|---|---|
|
what the file holds: |
|
the bitvf version that wrote it |
|
the geometry of the search, |
|
the rows: basins, cells, or input tracers |
|
the realizations of the search |
|
the realizations averaged into each displacement given: 1, or the NREC of a mean displacement file searched |
|
the smoothing sigma, and its unit, |
|
the divergence cell size used, in units of the mps |
followed, in a box, by:
Keyword |
Value |
|---|---|
|
the mean particle separation, in coordinate units |
|
the seed of the randoms bitvf drew, when it drew them |
|
the box limits of the search, in coordinate units, when it had limits |
GEOMETRY is box.
A number is written as the shortest decimal of at most 17 significant digits
that reads back as the same double, an integer as an integer; otswap’s
io::readKeywords (Python otswap.io.read_keywords) returns them as
written, in both formats.
Voids and overdense basins¶
Column |
Type |
Content |
|---|---|---|
|
K |
row of the basin |
|
D |
the centre, in coordinate units |
|
D |
equal-volume radius of the core, in coordinate units |
|
D |
equal-volume radius of the extended basin, in coordinate units |
|
D |
mean density contrast of the tracers in the core |
|
D |
density contrast within 2 mps of the centre |
|
J |
contact with the boundary: 0 none, 1 extended basin only, 2 core |
|
D |
fraction of the surface on the boundary |
|
K |
tracers starting in the core |
The boundary of edgeFlag and contamination is the faces of the grid;
the method defines each quantity.
Divergence¶
Column |
Type |
Content |
|---|---|---|
|
K |
row of the cell |
|
D |
the cell centre, in coordinate units |
|
D |
the divergence of the displacement field, before smoothing |
|
D |
after smoothing; only with sigma > 0 |
|
D |
volume of the cell, in coordinate units cubed |
|
D |
tracer weight of the cell |
|
D |
tracer weight of the cell, after smoothing; only with sigma > 0 |
|
K |
displacement ends counted in the cell |
|
K |
tracers starting in the cell |
|
K |
row of the void of the cell, -1 none |
|
K |
row of the overdense basin of the cell, -1 none |
After the common keywords, the record of the grid: LOWERX, LOWERY,
LOWERZ, UPPERX, UPPERY, UPPERZ and CELLSIDE, in coordinate units,
and NCELLX, NCELLY, NCELLZ. With MPS and CELLSIZE they hold every
value that defines the cells, so the grid read back is the same, bit for bit,
and can be reused by another search.
Galaxies¶
Column |
Type |
Content |
|---|---|---|
|
K |
the tracer’s ID, or its input row from 0 when none were given |
|
K |
row of the cell the tracer starts in, -1 none |
|
K |
row of the void of the tracer, -1 none |
|
K |
row of the overdense basin of the tracer, -1 none |
|
D |
distance from the centre of its basin, in coordinate units; NaN when in none |
|
J |
1 when a displacement of the tracer entered the divergence |
|
J |
1 when left unmoved by the redshift-space correction, excluded; only in the real-space pass of a run with correction |
|
J |
1 when outside the reused grid, excluded; only when a grid was reused, as in the real-space pass of a run with correction |
In a box, inBox follows distance:
Column |
Type |
Content |
|---|---|---|
|
J |
0 outside the box limits, skipped; only when the search had limits |
used is left out after a search from a divergence, which reads no
displacement.
A field result¶
The result of a search on a field (bitvf::findVoidsBoxFromField())
has no tracer: its files carry no NREC and NRECMEAN, MPS and
CELLSIZE only when an mps was given, and none of the columns that count
tracers or displacements (deltaAv, delta2Mps, nTracers, nDispl). Its
voids and overdense basins files add fieldCentre, the field at the centre,
after contamination. In its divergence file, divergence and, with
sigma > 0, divergenceSmoothed hold the field before and after smoothing,
weight the weight of the cell in the smoothing and, with sigma > 0,
weightSmoothed its smoothed mean. It has no galaxies file.
Reading¶
C++ |
Python |
Reads |
|---|---|---|
a divergence file, back into a grid, bit for bit |
||
a field at cell centres, from any table |
Divergence file. Read back with every value the writer wrote, in both formats. The grid can be reused by
bitvf::findVoidsBox(), and searched again with another smoothing bybitvf::findVoidsBoxFromDivergence(). The divergence file of a field result is read withreadField.Mean displacement file. bitvf has no reader for it: read it with
otswap::io::readDisplacementMean(Pythonotswap.io.read_displacement_mean) and pass theotswap::Resultto theResultoverload ofbitvf::findVoidsBox(). The box is the file’s box keywords, with or withoutBOXLIM; a mean file without box keywords holds no box limits and is refused. The divergence is not linear in the displacement, so the search on the mean of R realizations does not give the search on the R realizations; setConfig::nRealizationsMeanto theResult’snRealizationsMeanso that bitvf’s files record it. ASCII holds the positions with 9 significant digits: prefer FITS.Field. Columns are named in FITS; in ASCII, named from the last
###line before the data, or given as 0-based indices in digits. Every value read must be finite. A divergence file is valid input, withcellX,cellY,cellZ,divergenceandweight.
Parameter files¶
The executable reads a parameter file with otswap’s syntax, described on
otswap’s file formats page:
one key = value per line, # for comments, double quotes around a value
that holds spaces.
Its keys are on the box executables page.