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

io::writeVoids

io.write_voids

the voids

one per void

io::writeOverdense

io.write_overdense

the overdense basins

one per basin

io::writeDivergence

io.write_divergence

the divergence grid (keepDivergence)

one per cell

io::writeGalaxies

io.write_galaxies

where each tracer ended up (keepAssignment)

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 (FITS J) holding 0 or 1, and so is edgeFlag, holding 0, 1 or 2; every other column is a double (FITS D).

  • 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.

  • index is the row of the file itself; voidIndex, overdenseIndex and cellIndex are 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

PRODUCT

what the file holds: voids, overdense_basins, divergence or galaxies

BITVFV

the bitvf version that wrote it

GEOMETRY

the geometry of the search, box or lightcone

NBASINS, NCELLS or NOBJECTS

the rows: basins, cells, or input tracers

NREC

the realizations of the search

NRECMEAN

the realizations averaged into each displacement given: 1, or the NREC of a mean displacement file searched

SIGMA, SIGUNIT

the smoothing sigma, and its unit, mps or coordinate

CELLSIZE

the divergence cell size used, in units of the mps

followed, in a lightcone, by:

Keyword

Value

RANDSEED

the seed of the randoms bitvf drew, when it drew them: the redshifts of the resampled randoms of a second pass

ZCUTMIN, ZCUTMAX

the bounds of the redshift cut of the search, each only when finite

NRANDUSE

the randoms the search used: kept by the mask and the redshift cut, and inside the grid

MASKNSID

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

index

K

row of the basin

centreX, centreY, centreZ

D

the centre, in coordinate units

radius

D

equal-volume radius of the core, in coordinate units

radiusExt

D

equal-volume radius of the extended basin, in coordinate units

deltaAv

D

mean density contrast of the tracers in the core

delta2Mps

D

density contrast within 2 mps of the centre

edgeFlag

J

contact with the boundary: 0 none, 1 extended basin only, 2 core

contamination

D

fraction of the surface on the boundary

nTracers

K

tracers starting in the core

In a lightcone, the sky position of the centre follows index:

Column

Type

Content

centreRA, centreDec

D

right ascension and declination of the centre, in degrees

centreRed

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

index

K

row of the cell

cellX, cellY, cellZ

D

the cell centre, in coordinate units

divergence

D

the divergence of the displacement field, before smoothing

divergenceSmoothed

D

after smoothing; only with sigma > 0

volume

D

volume of the cell, in coordinate units cubed

weight

D

tracer weight of the cell

weightSmoothed

D

tracer weight of the cell, after smoothing; only with sigma > 0

nDispl

K

displacement ends counted in the cell

nTracers

K

tracers starting in the cell

voidIndex

K

row of the void of the cell, -1 none

overdenseIndex

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

cellRA, cellDec

D

right ascension and declination of the cell centre, in degrees

cellRed

D

redshift of the cell centre

cellDist

D

comoving distance of the cell centre, in coordinate units

cellRAMin, cellRAMax

D

right-ascension limits of the cell, in degrees

cellDecMin, cellDecMax

D

declination limits of the cell, in degrees

cellDistMin, cellDistMax

D

inner and outer distance of the cell, in coordinate units

masked

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

redshift

D

centre of the redshift bin

MPS

D

mean particle separation in the bin, in coordinate units

nTracers

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

id

K

the tracer’s ID, or its input row from 0 when none were given

cellIndex

K

row of the cell the tracer starts in, -1 none

voidIndex

K

row of the void of the tracer, -1 none

overdenseIndex

K

row of the overdense basin of the tracer, -1 none

distance

D

distance from the centre of its basin, in coordinate units; NaN when in none

used

J

1 when a displacement of the tracer entered the divergence

uncorrected

J

1 when left unmoved by the redshift-space correction, excluded; only in the real-space pass of a run with correction

outsideGrid

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

inMask

J

0 on an unobserved pixel of the mask, skipped

inCut

J

0 outside the redshift cut, skipped; only when the cut has a finite bound

outsideCut

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

io::readDivergence

io.read_divergence

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.