hera_sim.io.chunk_sim_and_save

hera_sim.io.chunk_sim_and_save(sim_uvd, save_dir, ref_files=None, Nint_per_file=None, prefix=None, sky_cmp=None, state=None, filetype='uvh5', clobber=True)[source]

Chunk the simulation data to match the reference file and write to disk.

Chunked files have the following naming convention: save_dir/[{prefix}.]{jd_major}.{jd_minor}[.{sky_cmp}][.{state}].{filetype}. The entires in brackets are optional and may be omitted.

Parameters:
  • sim_uvd (pyuvdata.UVData) – pyuvdata.UVData object containing the simulation data to chunk and write to disk.

  • save_dir (str or path-like object) – Path to the directory where the chunked files will be saved.

  • ref_files (iterable of str) – Iterable of filepaths to use for reference when chunking. This must be specified if Nint_per_file is not specified. This determines (and overrides, if also provided) Nint_per_file if provided.

  • Nint_per_file (int, optional) – Number of integrations per chunked file. This must be specified if ref_files is not specified.

  • prefix (str, optional) – Prefix of file basename. Default is to add no prefix.

  • sky_cmp (str, optional) – String denoting which sky component has been simulated. Should be one of the following: (‘foregrounds’, ‘eor’, ‘sum’).

  • state (str, optional) – String denoting whether the file is the true sky or corrupted.

  • filetype (str, optional) – Format to use when writing files to disk. Must be a filetype supported by pyuvdata.UVData. Default is uvh5.

  • clobber (bool, optional) – Whether to overwrite any existing files that share the new filenames. Default is to overwrite files.