guess_source_velocity

sitelle.fit.guess_source_velocity(spectrum, cube, v_min=-800.0, v_max=50.0, debug=False, lines=None, force=False, return_line=False)

Estimation of the velocity shift of a spectrum. The position of the max of emission in the spectrum is found, and compared to different lines rest position until a compatible velocity (i.e. included in a given velocity range) is found. The obtained guess is discrete in the sense it corresponds to the frame in which the max was found. For better accuracy see refine_velocity_guess().

Parameters:
  • spectrum (1D ndarray) – Spectrum to analyze
  • cube (SpectralCube) – Spectral cube instance from which the spectrum has been extracted.
  • v_min (float) – Constraint on the lower bound of the velocity range.
  • v_max (float) – Constraint on the upper bound of the velocity range.
  • debug (bool) – (Optional) If True, a debug id displayed (default = False)
  • lines (list of str) – (Optional) Names of the rest line candidates for the observed line. If None, the lines in the filter of the cube are used (see SN2_LINES and SN3_LINES in constants)
  • force (bool) – (Optional) If True, a velocity guess is outputed no matter it’s compatibility with the velocity range input. Should be used only when lines is restricted to one element.
  • return_line (bool) – (Optional) If True, the name of the line that produced the estimation is output.
Returns:

  • v_guess (float) – The guess on the velocity (NaN if not included in the velocity range)
  • line_name (str) – (Only if return_line = True) the name of the line.