kinextract.choose_norm_wavelength_frame

kinextract.choose_norm_wavelength_frame(wave_raw: ndarray, cfg: FitConfig) tuple[ndarray, str][source]

Determine whether a .norm file’s wavelength column is rest- or observed-frame, and return it converted to the frame the fit expects.

Legacy .norm files do not consistently record which frame their wavelength column is in. This resolves cfg.norm_wave_frame:

  • "rest": assume the wavelengths are already rest-frame (as-given).

  • "observed": assume observed-frame and divide by 1 + cfg.zgal.

  • "auto": try both and pick whichever places more samples inside the fit window [cfg.wavefitmin, cfg.wavefitmax], on the assumption that the correct frame will have the fit window well covered by data.

Parameters:
  • wave_raw (ndarray) – Raw wavelength column read from the .norm file (Å).

  • cfg (FitConfig) – Fit configuration; supplies norm_wave_frame, zgal, wavefitmin, and wavefitmax.

Returns:

The wavelength array (Å) in the resolved frame, and a short human-readable description of which frame/branch was chosen (e.g. "auto: /1+z"), used only for logging.

Return type:

tuple of (ndarray, str)