sample_based_tod_generation_gridint

Main pipeline entry point. Loads sky maps and beam data, calibrates performance, spawns a multiprocessing pool, and generates one TOD file per observation day.

sample_based_tod_generation_gridint.tod_exact_gen_batched(beam_data, day_index, nside, batch_size, process_name=None, z_skip_threshold=-1.0, fsamp=None)[source]

Generate TOD for a single observation day using batched processing.

Opens the scan files as persistent memory-maps (avoiding repeated open/mmap syscalls per batch), then processes the day in ceil(n_samples / batch_size) batches. Each batch computes Rodrigues rotation vectors, calls beam_tod_batch() for every beam entry, and accumulates the results.

Parameters:
  • beam_data (dict) – Pre-loaded beam data from prepare_beam_data(). Must include 'mp_stacked' for the Numba gather path.

  • day_index (int) – Zero-based index of the observation day.

  • nside (int) – HEALPix nside of the input sky map.

  • batch_size (int) – Number of detector samples per processing batch. Use the value returned by _calibrate_n_processes().

  • process_name (str | None) – Label for log messages (e.g. the multiprocessing.Process name). Defaults to None.

Returns:

TOD array of shape (3, n_samples), dtype matching

tod_config.precision_dtype. Axis 0 is the Stokes component index [I, Q, U].

Return type:

numpy.ndarray

sample_based_tod_generation_gridint.main(n_cpu_ceiling)[source]