EllipseSample¶
- class photutils.isophote.EllipseSample(image, sma, x0=None, y0=None, astep=0.1, eps=0.2, position_angle=0.0, sclip=3.0, nclip=0, linear_growth=False, integrmode='bilinear', geometry=None)[source]¶
Bases:
object
Class to sample image data along an elliptical path.
The image intensities along the elliptical path can be extracted using a selection of integration algorithms.
The
geometry
attribute describes the geometry of the elliptical path.- Parameters:
- image2D
ndarray
The input image.
- smafloat
The semimajor axis length in pixels.
- x0, y0float, optional
The (x, y) coordinate of the ellipse center.
- astepfloat, optional
The step value for growing/shrinking the semimajor axis. It can be expressed either in pixels (when
linear_growth=True
) or as a relative value (whenlinear_growth=False
). The default is 0.1.- epsfloat, optional
The ellipticity of the ellipse. The default is 0.2.
- pafloat, optional
The position angle of ellipse in relation to the positive x axis of the image array (rotating towards the positive y axis). The default is 0.
- sclipfloat, optional
The sigma-clip sigma value. The default is 3.0.
- nclipint, optional
The number of sigma-clip iterations. Set to zero to skip sigma-clipping. The default is 0.
- linear_growthbool, optional
The semimajor axis growing/shrinking mode. The default is
False
.- integrmode{‘bilinear’, ‘nearest_neighbor’, ‘mean’, ‘median’}, optional
The area integration mode. The default is ‘bilinear’.
- geometry
EllipseGeometry
instance orNone
The geometry that describes the ellipse. This can be used in lieu of the explicit specification of parameters
sma
,x0
,y0
,eps
, etc. In any case, theEllipseGeometry
instance becomes an attribute of theEllipseSample
object. The default isNone
.
- image2D
- Attributes:
- values2D
ndarray
The sampled values as a 2D array, where the rows contain the angles, radii, and extracted intensity values, respectively.
- meanfloat
The mean intensity along the elliptical path.
- geometry
EllipseGeometry
instance The geometry of the elliptical path.
- gradientfloat
The local radial intensity gradient.
- gradient_errorfloat
The error associated with the local radial intensity gradient.
- gradient_relative_errorfloat
The relative error associated with the local radial intensity gradient.
- sector_areafloat
The average area of the sectors along the elliptical path from which the sample values were integrated.
- total_pointsint
The total number of sample values that would cover the entire elliptical path.
- actual_pointsint
The actual number of sample values that were taken from the image. It can be smaller than
total_points
when the ellipse encompasses regions outside the image, or when sigma-clipping removed some of the points.
- values2D
Methods Summary
Return the (x, y) coordinates associated with each sampled point.
extract
()Extract sample data by scanning an elliptical path over the image array.
update
([fixed_parameters])Update this
EllipseSample
instance.Methods Documentation
- coordinates()[source]¶
Return the (x, y) coordinates associated with each sampled point.
- Returns:
- x, y1D
ndarray
The x and y coordinate arrays.
- x, y1D
- extract()[source]¶
Extract sample data by scanning an elliptical path over the image array.
- Returns:
- result2D
ndarray
The rows of the array contain the angles, radii, and extracted intensity values, respectively.
- result2D
- update(fixed_parameters=None)[source]¶
Update this
EllipseSample
instance.This method calls the
extract()
method to get the values that match the currentgeometry
attribute, and then computes the the mean intensity, local gradient, and other associated quantities.