mangadap.util.modeling module¶
Module with generic functions used when modeling data.
Copyright © 2019, SDSS-IV/MaNGA Pipeline Group
- mangadap.util.modeling.reject_residuals_1d(resid, lo=3.0, hi=3.0, boxcar=None)[source]¶
Reject fit residuals.
- Parameters
resid (numpy.ndarray, numpy.ma.MaskedArray`_) – Weighted fit residuals. If input as a numpy.ndarray, all data is included in the calculation of the local or global standard deviation. To exclude values from this calculation, the input must be a masked array. Shape must be either \((N_x,)\) or \((N_{\rm vec},N_x})\). If 2D, the rejection is performed separately for each row.
lo (
float
, optional) – Sigma rejection for low values.hi (
float
, optional) – Sigma rejection for high values.boxcar (
int
, optional) – Size of a boxcar to use if using local sigma rejection. If None, rejection is based on the global standard deviation.
- Returns
Boolean array flagging values to reject.
- Return type
- mangadap.util.modeling.scaled_coordinates(x, rng=None)[source]¶
Scale the provided coordinates.
The coordinates are scaled such that over the provided range the coordinates are rescaled to the range \([-1, 1]\).
Warning
If
rng
is None, the returned object is identical tox
(i.e., it’s not a copy of it).- Parameters
x (numpy.ndarray) – Coordinate array
rng (array-like, optional) – The range over which to rescale to [-1,1]. If None, the input coordinates are simply returned.
- Returns
The rescaled coordinates.
- Return type