template_redshift

specutils.analysis.template_redshift(observed_spectrum, template_spectrum, redshift)[source]

Find the best-fit redshift for template_spectrum to match observed_spectrum using chi2.

Parameters
observed_spectrumSpectrum1D

The observed spectrum.

template_spectrumSpectrum1D

The template spectrum, which will have it’s redshift calculated.

redshiftfloat, int, list, tuple, ‘numpy.array`

A scalar or iterable with the redshift values to test.

Returns
final_redshiftfloat

The best-fit redshift for template_spectrum to match the observed_spectrum.

redshifted_spectrum: Spectrum1D

A new Spectrum1D object which incorporates the template_spectrum with a spectral_axis that has been redshifted using the final_redshift.

chi2_listlist

A list with the chi2 values corresponding to each input redshift value.