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_spectrum
Spectrum1D The observed spectrum.
- template_spectrum
Spectrum1D The template spectrum, which will have it’s redshift calculated.
- redshift
float,int,list,tuple, ‘numpy.array` A scalar or iterable with the redshift values to test.
- observed_spectrum
- Returns
- final_redshift
float 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_list
list A list with the chi2 values corresponding to each input redshift value.
- final_redshift