viz.larson.larson_sekanina
viz.larson.larson_sekanina(
image,
center,
*,
angle,
radial_shift=0.0,
interpolation='linear',
mask=None,
)Subtract two oppositely rotated, radially shifted coma images.
Parameters
image : array - like-
Nonempty, real 2-D image. Masked and nonfinite pixels are excluded. The input is never modified.
center : tuple of float-
Zero-based
(x, y)nucleus coordinates within the image. Fractional coordinates are supported; indexing isimage[y, x]. Angles increase from +x toward +y (counterclockwise when displayed withorigin="lower"); both rotation directions contribute. angle : float-
Angular shift in degrees. Both positive and negative rotations are sampled, so changing the sign gives the same result. Full turns are reduced modulo 360. Zero gives twice a purely radial difference.
radial_shift : float = 0.0-
Radial displacement in pixels. Positive values sample inward at
r - radial_shift; negative values sample outward. Default0selects a purely rotational difference. interpolation : (linear, nearest) = "linear"-
Default
"linear"uses bilinear interpolation."nearest"selects the nearest pixel, rounding half-integers upward. Every contributor with nonzero weight must be finite; missing neighbors with zero weight are ignored. Neither method extrapolates beyond pixel centers. mask : array - like = None-
Exclusion mask matching
image;Truemarks missing pixels. Combined with the masked-array mask and nonfinite values.
Returns
: ndarray-
Float64 residual with the input shape and intensity units. Missing original pixels or either missing shifted sample give
NaN. Shifted radii withr - radial_shift < 0are undefined. Atr = 0, a nonzero radial shift is undefined because no direction is available. Results outside float64 range are alsoNaN.
Raises
: TypeError-
If
imageorcenteris not real numeric data. : ValueError-
If shapes, coordinates, shifts, or
interpolationare invalid.
Notes
Implements Larson & Sekanina (1984), equation (1), with dr in pixels and da in degrees::
L(r, theta) = (I(r, theta) - I(r - dr, theta + da))
+ (I(r, theta) - I(r - dr, theta - da))
The two differences are summed, not averaged. Cartesian sampling avoids a polar-grid round trip. Right-angle rotations use exact sine/cosine values; no coordinate snapping or boundary tolerance is applied.
Rotational differences emphasize angular structure; radial displacement also reveals concentric structure. Choose shifts for the feature scale in your image. Interpolation smooths fine structure, and the filter can create negative lobes around stars, jets, or centering errors. Use the original calibrated image for photometry. No logarithm or background subtraction is applied.
See Also
radially_variable_filter : Filter with a radius-dependent spatial width. azimuthal_normalize : Divide by an estimated azimuthal brightness level.
References
Larson, S. M. & Sekanina, Z. (1984), AJ 89, 571–578, equation (1). https://doi.org/10.1086/113551
Examples
A constant field has no rotational structure:
>>> from astroimred.viz import larson_sekanina
>>> data = np.ones((9, 9))
>>> residual = larson_sekanina(data, (4, 4), angle=10)
>>> bool(residual[4, 4] == 0)
True