size_function.h#

#include <sif/measure/size_function.h>
SIF_MEASURE_SIZE_FUNCTION_H#

Measuring the void size function from a catalogue, and merging several into one.

sif_size_function_t *sif_size_function_catalog(const sif_catalog_t *cat, sif_real box_length, uint32_t n_bins, sif_option opt, sif_real r_min_in, sif_real r_max_in)#

Bin a catalogue into a void size function.

Counts voids per radius bin and divides by the bin width and the box volume, giving a number density rather than a histogram, so catalogues from different volumes are comparable. The Poisson error follows from the raw counts, which are kept.

Parameters:
  • cat – Catalogue to bin.

  • box_length – Physical side length of the box, which sets the volume the density is per.

  • n_bins – Radial bins, at least 1.

  • opt – SIF_VSF_BIN_LN (default, bins uniform in ln R) or SIF_VSF_BIN_LINEAR (uniform in R). Recorded in the result.

  • r_min_in – Lower radius bound; pass 0 or less to take the catalogue’s smallest radius.

  • r_max_in – Upper radius bound; pass 0 or less to take the catalogue’s largest.

Returns:

Newly allocated size function, released with sif_size_function_free(), or NULL on invalid input or failure.

sif_size_function_t *sif_size_function_combine(const sif_size_function_t **vsfs, uint32_t n_vsfs, uint32_t master_bins, const sif_interval_t *domains, sif_option opt)#

Merge several size functions into one.

Each input is resampled onto a common radius grid and the overlapping values combined. This is how measurements from boxes of different resolution are joined: each resolves a different range of radii well, and domains says where each one should be trusted.

Parameters:
  • vsfs – The size functions to merge.

  • n_vsfs – How many.

  • master_bins – Radial bins in the merged result.

  • domains – Optional, one interval per input giving the radius range it contributes over. NULL uses each input’s own full range.

  • opt – SIF_VSF_MERGE_MEAN (default), SIF_VSF_MERGE_MEDIAN or SIF_VSF_MERGE_STITCH.

Returns:

Newly allocated size function, released with sif_size_function_free(), or NULL on invalid input or failure.

Note

The inputs must agree on their binning convention: mixing a SIF_VSF_BIN_LN measurement with a SIF_VSF_BIN_LINEAR one merges two different quantities.