tweak_redshift¶
- threadcount.fit.tweak_redshift(cube, z_gal, center_wavelength=5006.843, wavelength_range=(-15, 15), pixel_mask=None)[source]¶
Interactively choose a new redshift.
This procedure has several steps.
Select which spaxels to use for calculating the redshift via one of these options:
use the input parameter pixel_mask
Select pixels with a high integrated flux value in the selected wavelength range. These are likely to be the galaxy. The user will interact with the terminal and view a plot to interactively change the lower threshold for the desired pixels. To accept the value plotted, leave the entry blank and press enter.
Fit a
Const_1GaussModelto the selected spaxels.Extract the parameter value for ‘g1_center’ to get the center wavelength of the fitted gaussian and compute the median center.
Calculate the redshift required for the median center to be equal to center_wavelength using the formula:
new_z = (median_center / `center_wavelength`) * (1 + `z_gal`) - 1
Display a plot showing the spaxels used and a histogram displaying all the center wavelengths (with center_wavelength subtracted, so it displays the change from ideal)
- Parameters:
cube (
mpdaf.obj.Cube) – A datacube containing the wavelength range set in these parametersz_gal (float) – The redshift of the object which has already been applied to the cube
center_wavelength (float, optional) – The center wavelength of the emission line to fit, by default
threadcount.lines.OIII5007wavelength_range (array-like [float, float], optional) – The wavelength range to fit, in Angstroms. These are defined as a change from the center_wavelength, by default (-15, 15)
- Returns:
The redshift selected by the user.
- Return type: