Skip to content

funcs

Dataset functions for NIKA2 TODs.

Only file discovery and loading are NIKA2 specific. Everything downstream (noise, mapmaking, metadata) reuses the minkasi dataset functions.

get_info(dset_name, cfg, todvec)

Same as the minkasi get_info but the prefactor can reference beam_omega (solid angle in arcsec^2 of the configured beam, normalized to a peak of 1) and colour_corr (the dataset's colour_corr, default 1).

Source code in witch/external/nika2/funcs.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def get_info(dset_name: str, cfg: dict, todvec: TODVec) -> dict:
    """
    Same as the minkasi `get_info` but the prefactor can reference
    `beam_omega` (solid angle in arcsec^2 of the configured beam, normalized to a peak of 1)
    and `colour_corr` (the dataset's `colour_corr`, default 1).
    """
    dset_cfg = cfg["datasets"][dset_name]
    fwhms, amps, _ = _beam_pars(dset_name, cfg)
    beam_omega = wu.gauss_solid_angle(fwhms, amps)
    colour_corr = float(eval(str(dset_cfg.get("colour_corr", 1.0))))
    prefactor = float(
        eval(
            str(dset_cfg["prefactor"]),
            {"wu": wu, "np": np},
            {"cfg": cfg, "beam_omega": beam_omega, "colour_corr": colour_corr},
        )
    )
    cfg_local = deepcopy(cfg)
    cfg_local["datasets"][dset_name]["prefactor"] = repr(prefactor)
    info = _minkasi_get_info(dset_name, cfg_local, todvec)
    info["beam_omega"] = beam_omega
    info["colour_corr"] = colour_corr
    return info