Lightcone 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 back, as a grid to reuse (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.
Angles are in degrees in every file, whatever the unit of the arrays of the call. The redshift of a centre is that of its comoving distance in the distance table of the search.
Coordinates are Cartesian, with the observer at the origin, in the distance unit of the distance table: Mpc/h when it comes from otswap’s cosmology.
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 lightcone, by:
Keyword |
Value |
|---|---|
|
the seed of the randoms bitvf drew, when it drew them: the redshifts of the resampled randoms of a second pass |
|
the bounds of the redshift cut of the search, each only when finite |
|
the randoms the search used: kept by the mask and the redshift cut, and inside the grid |
|
the NSIDE of the mask of the search |
GEOMETRY is lightcone. CELLSIZE is in units of mps(z), the mean
particle separation at the redshift of each shell; the mps(z) profile itself
is in the divergence file.
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 |
In a lightcone, the sky position of the centre follows index:
Column |
Type |
Content |
|---|---|---|
|
D |
right ascension and declination of the centre, in degrees |
|
D |
redshift of the centre |
The 2 mps of delta2Mps are 2 mps(z) at the centre’s redshift. The
boundary of edgeFlag and contamination is the masked cells and the
border 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 |
In a lightcone, the sky position and the limits of each cell follow
cellZ, and masked comes last:
Column |
Type |
Content |
|---|---|---|
|
D |
right ascension and declination of the cell centre, in degrees |
|
D |
redshift of the cell centre |
|
D |
comoving distance of the cell centre, in coordinate units |
|
D |
right-ascension limits of the cell, in degrees |
|
D |
declination limits of the cell, in degrees |
|
D |
inner and outer distance of the cell, in coordinate units |
|
J |
1 when the cell centre is on an unobserved pixel of the mask |
The limits of the cells describe them; they are rebuilt from the record of the grid when the file is written, and not read back. Right-ascension limits are continuous across 0 within a ring, so they may exceed 360; a ring of a single sector spans 360 degrees. The central sphere, when the grid has one, spans the distances from 0 and the whole sky; a polar cap reaches declination 90 (or -90) over the whole circle.
After the common keywords, the record of the grid: DISTMIN, DISTMAX,
the range of comoving distance of the tracers and randoms, in coordinate
units, and RAMIN, RAMAX, DECMIN, DECMAX, the footprint, in degrees.
With CELLSIZE, the mps(z) profile and the distance table of the search,
they define the cells: a search with the same distance table rebuilds the
same grid from them.
The mps(z) profile of the grid follows in a second table: HDU MPSPROF of
a FITS file, or, in ASCII, the twin file <stem>.mps.<ext>, the divergence
file’s name with .mps before its extension
(divergence_lightcone.mps.dat beside divergence_lightcone.dat). Its
columns, with 17 significant digits:
Column |
Type |
Content |
|---|---|---|
|
D |
centre of the redshift bin |
|
D |
mean particle separation in the bin, in coordinate units |
|
J |
tracers in the bin |
and its keywords: PRODUCT = divergence mps profile, BITVFV, ZMIN and
ZMAX (the lowest and highest redshift binned) and MPSREPR (the
count-weighted median mps, in coordinate units). It has no GEOMETRY.
A grid is written only if it reads back as a grid to reuse: it must be rebuilt from its record and the distance table of the result with the same number of cells, which costs one grid build.
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 lightcone, inMask and inCut follow distance, and outsideCut
comes last:
Column |
Type |
Content |
|---|---|---|
|
J |
0 on an unobserved pixel of the mask, skipped |
|
J |
0 outside the redshift cut, skipped; only when the cut has a finite bound |
|
J |
1 when moved outside the redshift cut by the correction, excluded; only in the real-space pass of a run with correction |
A tracer both on an unobserved pixel and outside the cut has 0 in both
flags. A tracer that starts in a masked cell keeps that cell in cellIndex
but is in no basin.
Reading¶
C++ |
Python |
Reads |
|---|---|---|
a divergence file, back into a grid |
A lightcone divergence file, with its profile, gives a lightcone grid: the
record, the mps(z) profile, the cell centres and their sky positions, the
fields, the counts, the basin indices and masked. The distances and
CELLSIZE read back bit for bit; the angles equal those of the grid
written up to the rounding of their conversion from degrees, so a tracer
within rounding of a right-ascension or declination edge can change cell.
The limits of the cells are not read. In Python, angle_unit ("deg" or
"rad") is required and sets the unit of the grid’s angles.
The grid can be reused by bitvf::findVoidsLightcone(), with the
distance table of the search that wrote it, to search other catalogues on
the same cells. There is no search of a lightcone from a divergence file.
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 lightcone executable page.