normalize_orders¶
- tayph.normalize_orders(list_of_orders, list_of_sigmas, deg=0, nsigma=4, sinusoid=False)[source] [edit on github]¶
If deg is set to 1, this function will normalise based on the mean flux in each order. If set higher, it will remove the average spectrum in each order and fit a polynomial to the residual. This means that in the presence of spectral lines, the fluxes will be slightly lower than if def=1 is used. nsigma is only used if deg > 1, and is used to throw away outliers from the polynomial fit. The program also computes the total mean flux of each exposure in the time series - totalled over all orders. These are important to correctly weigh the cross-correlation functions later. The inter-order colour correction is assumed to be an insignificant modification to these weights.
- Parameters
- list_of_orderslist
The list of 2D orders that need to be normalised.
- list_of_sigmaslist
The list of 2D error matrices corresponding to the 2D orders that need to be normalised.
- degint
The polynomial degree to remove. If set to 0, only the average flux is removed. If higher, polynomial fits are made to the residuals after removal of the average spectrum.
- nsigmaint, float
The number of sigmas beyond which outliers are rejected from the polynomial fit. Only used when deg > 1.
- Returns
- out_list_of_orderslist
The normalised 2D orders.
- out_list_of_sigmaslist
The corresponding errors.
- t_weightsnp.array
Weight based on the mean flux of each exposure in the time series, averaged over all orders.