mangadap.util.modeling module

Module with generic functions used when modeling data.


License

Copyright © 2019, SDSS-IV/MaNGA Pipeline Group


class mangadap.util.modeling.FitChiSquare(y, e, model, gpm=None)[source]

Bases: object

class mangadap.util.modeling.FitResiduals(y, model, gpm=None)[source]

Bases: object

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:

numpy.ndarray

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 to x (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:

numpy.ndarray