djs_reject¶
-
pydl.pydlutils.math.djs_reject(data, model, outmask=None, inmask=None, sigma=None, invvar=None, lower=None, upper=None, maxdev=None, maxrej=None, groupdim=None, groupsize=None, groupbadpix=False, grow=0, sticky=False)[source]¶ Routine to reject points when doing an iterative fit to data.
Parameters: data :
numpy.ndarrayThe data
model :
numpy.ndarrayThe model, must have the same number of dimensions as
data.outmask :
numpy.ndarray, optionalOutput mask, generated by a previous call to
djs_reject. If not supplied, this mask will be initialized to a mask that masks nothing. Although this parameter is technically optional, it will almost always be set.inmask :
numpy.ndarray, optionalInput mask. Bad points are marked with a value that evaluates to
False. Must have the same number of dimensions asdata.sigma :
numpy.ndarray, optionalStandard deviation of the data, used to reject points based on the values of
upperandlower.invvar :
numpy.ndarray, optionalInverse variance of the data, used to reject points based on the values of
upperandlower. If bothsigmaandinvvarare set,invvarwill be ignored.lower :
intorfloat, optionalIf set, reject points with data < model - lower * sigma.
upper :
intorfloat, optionalIf set, reject points with data > model + upper * sigma.
maxdev :
intorfloat, optionalIf set, reject points with abs(data-model) > maxdev. It is permitted to set all three of
lower,upperandmaxdev.maxrej :
intornumpy.ndarray, optionalMaximum number of points to reject in this iteration. If
groupsizeorgroupdimare set to arrays, this should be an array as well.groupdim
To be documented.
groupsize
To be documented.
groupbadpix :
bool, optionalIf set to
True, consecutive sets of bad pixels are considered groups, overriding the values ofgroupsize.grow :
int, optionalIf set to a non-zero integer, N, the N nearest neighbors of rejected pixels will also be rejected.
sticky :
bool, optionalIf set to
True, pixels rejected in one iteration remain rejected in subsequent iterations, even if the model changes.Returns: tuple()A tuple containing a mask where rejected data values are
Falseand a boolean value set toTrueifdjs_rejectbelieves there is no further rejection to be done.Raises: :exc:`ValueError`
If dimensions of various inputs do not match.