BiweightScaleBackgroundRMS#
- class photutils.background.BiweightScaleBackgroundRMS(c=9.0, M=None, sigma_clip=<default: SigmaClip(sigma=3.0, maxiters=10)>)[source]#
Bases:
BackgroundRMSBaseClass to calculate the background RMS in an array as the (sigma- clipped) biweight scale.
- Parameters:
- cfloat, optional
Tuning constant for the biweight estimator. Default value is 9.0.
- Mfloat, optional
Initial guess for the biweight location. Default value is
None.- sigma_clip
astropy.stats.SigmaCliporNone, optional A
SigmaClipobject that defines the sigma clipping parameters. IfNonethen no sigma clipping will be performed.
Examples
>>> from astropy.stats import SigmaClip >>> from photutils.background import BiweightScaleBackgroundRMS >>> data = np.arange(100) >>> sigma_clip = SigmaClip(sigma=3.0) >>> bkgrms = BiweightScaleBackgroundRMS(sigma_clip=sigma_clip)
The background RMS value can be calculated by using the
calc_background_rmsmethod, e.g.:>>> bkgrms_value = bkgrms.calc_background_rms(data) >>> print(bkgrms_value) 30.09433848589339
Alternatively, the background RMS value can be calculated by calling the class instance as a function, e.g.:
>>> bkgrms_value = bkgrms(data) >>> print(bkgrms_value) 30.09433848589339
Methods Summary
__call__(data[, axis, masked])Call self as a function.
calc_background_rms(data[, axis, masked])Calculate the background RMS value.
Methods Documentation
- __call__(data, axis=None, masked=False)#
Call self as a function.
- calc_background_rms(data, axis=None, masked=False)[source]#
Calculate the background RMS value.
- Parameters:
- dataarray_like or
MaskedArray The array for which to calculate the background RMS value.
- axisint or
None, optional The array axis along which the background RMS is calculated. If
None, then the entire array is used.- maskedbool, optional
If
True, then aMaskedArrayis returned. IfFalse, then andarrayis returned, where masked values have a value of NaN. The default isFalse.
- dataarray_like or
- Returns:
- resultfloat,
ndarray, orMaskedArray The calculated background RMS value. If
maskedisFalse, then andarrayis returned, otherwise aMaskedArrayis returned. A scalar result is always returned as a float.
- resultfloat,