CalcMomentSize¶
- class lsst.analysis.tools.actions.vector.CalcMomentSize(*args, **kw)¶
Bases:
VectorAction
Calculate a size based on 2D moments.
Given a 2x2 matrix of moments (i.e. moment of inertia), two sizes can be defined as follows:
Determinant radius: \((I_{xx}I_{yy}-I_{xy}^2)^{\frac{1}{4}}\) Trace radius: \(\sqrt{(I_{xx}+I_{yy})/2}\)
The square of size measure is typically expressed either as the arithmetic mean of the eigenvalues of the moment matrix (trace radius) or as the geometric mean of the eigenvalues (determinant radius), which can be specified using the
sizeType
parameter. Both of these measures correspond to the \(\sigma^2\) parameter for a 2D Gaussian.Notes
Since lensing preserves surface brightness, the determinant radius relates the magnification cleanly as it is derived from the area of isophotes, but have a slightly higher chance of being NaNs for noisy moment estimates.
Attributes Summary
The column name to get the xx shape component from.
The column name to get the xy shape component from.
The column name to get the yy shape component from.
Whether the fields are for a covariance matrix.
The type of size to calculate (
str
, default'determinant'
)Methods Summary
__call__
(data, **kwargs)Call self as a function.
Return the schema an
AnalysisAction
expects to be present in the arguments supplied to the __call__ method.validate
()Validate the Config, raising an exception if invalid.
Attributes Documentation
- is_covariance¶
Whether the fields are for a covariance matrix. If False, the XX/YY/XY terms are instead assumed to map to sigma_x/sigma_y/rho. (
bool
, defaultTrue
)
- sizeType¶
The type of size to calculate (
str
, default'determinant'
)Allowed values:
'trace'
Trace radius \(\sqrt{(I_{xx}+I_{yy})/2}\)
'determinant'
Determinant radius \((I_{xx}I_{yy}-I_{xy}^2)^{\frac{1}{4}}\)
Methods Documentation
- __call__(data: MutableMapping[str, ndarray[Any, dtype[ScalarType]] | Scalar | HealSparseMap | Tensor], **kwargs) ndarray[Any, dtype[ScalarType]] ¶
Call self as a function.
- getInputSchema() Tensor]]] ¶
Return the schema an
AnalysisAction
expects to be present in the arguments supplied to the __call__ method.- Returns:
- result
KeyedDataSchema
The schema this action requires to be present when calling this action, keys are unformatted.
- result
- validate()¶
Validate the Config, raising an exception if invalid.
- Raises:
- lsst.pex.config.FieldValidationError
Raised if verification fails.
Notes
The base class implementation performs type checks on all fields by calling their
validate
methods.Complex single-field validation can be defined by deriving new Field types. For convenience, some derived
lsst.pex.config.Field
-types (ConfigField
andConfigChoiceField
) are defined inlsst.pex.config
that handle recursing into subconfigs.Inter-field relationships should only be checked in derived
Config
classes after calling this method, and base validation is complete.