LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+ffe7eabc7e,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g36da64cc00+ea84795170,g3ddfee87b4+955a963fd8,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+955a963fd8,g591dd9f2cf+bac198a2cb,g5ec818987f+420292cfeb,g858d7b2824+d6c9a0a3b8,g876c692160+aabc49a3c3,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+e6cd765486,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+acd47f83f4,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+12c8382528,gba4ed39666+1ac82b564f,gbb8dafda3b+0574160a1f,gbeb006f7da+dea2fbb49f,gc28159a63d+c6dfa2ddaf,gc86a011abf+d6c9a0a3b8,gcf0d15dbbd+955a963fd8,gdaeeff99f8+1cafcb7cd4,gdc0c513512+d6c9a0a3b8,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,gee10cc3b42+90ebb246c7,gf1cff7945b+d6c9a0a3b8,w.2024.13
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
lsst.meas.base.plugins.EvaluateLocalWcsPlugin Class Reference
Inheritance diagram for lsst.meas.base.plugins.EvaluateLocalWcsPlugin:
lsst.meas.base.wrappers.GenericPlugin lsst.meas.base.pluginsBase.BasePlugin

Public Member Functions

 getExecutionOrder (cls)
 
 __init__ (self, config, name, schema, metadata)
 
 measure (self, measRecord, exposure, center)
 
 makeLocalTransformMatrix (self, wcs, center)
 

Public Attributes

 cdMatrix11Key
 
 cdMatrix12Key
 
 cdMatrix21Key
 
 cdMatrix22Key
 

Static Public Attributes

 ConfigClass = EvaluateLocalWcsPluginConfig
 

Protected Attributes

 _scale
 

Static Protected Attributes

tuple _scale = (1.0 * lsst.geom.arcseconds).asDegrees()
 

Detailed Description

Evaluate the local, linear approximation of the Wcs.

The aim is to store the local calib value within the catalog for later
use in the Science Data Model functors.

Definition at line 462 of file plugins.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.__init__ ( self,
config,
name,
schema,
metadata )

Reimplemented from lsst.meas.base.wrappers.GenericPlugin.

Definition at line 475 of file plugins.py.

475 def __init__(self, config, name, schema, metadata):
476 GenericPlugin.__init__(self, config, name, schema, metadata)
477 self.cdMatrix11Key = schema.addField(
478 f"{name}_CDMatrix_1_1",
479 type="D",
480 doc="(1, 1) element of the CDMatrix for the linear approximation "
481 "of the WCS at the src location. Gives units in radians.")
482 self.cdMatrix12Key = schema.addField(
483 f"{name}_CDMatrix_1_2",
484 type="D",
485 doc="(1, 2) element of the CDMatrix for the linear approximation "
486 "of the WCS at the src location. Gives units in radians.")
487 self.cdMatrix21Key = schema.addField(
488 f"{name}_CDMatrix_2_1",
489 type="D",
490 doc="(2, 1) element of the CDMatrix for the linear approximation "
491 "of the WCS at the src location. Gives units in radians.")
492 self.cdMatrix22Key = schema.addField(
493 f"{name}_CDMatrix_2_2",
494 type="D",
495 doc="(2, 2) element of the CDMatrix for the linear approximation "
496 "of the WCS at the src location. Gives units in radians.")
497

Member Function Documentation

◆ getExecutionOrder()

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.getExecutionOrder ( cls)
Get the relative execution order of this plugin.

Must be reimplemented as a class method by concrete derived classes.

Reimplemented from lsst.meas.base.wrappers.GenericPlugin.

Definition at line 472 of file plugins.py.

472 def getExecutionOrder(cls):
473 return BasePlugin.FLUX_ORDER
474

◆ makeLocalTransformMatrix()

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.makeLocalTransformMatrix ( self,
wcs,
center )
Create a local, linear approximation of the wcs transformation
matrix.

The approximation is created as if the center is at RA=0, DEC=0. All
comparing x,y coordinate are relative to the position of center. Matrix
is initially calculated with units arcseconds and then converted to
radians. This yields higher precision results due to quirks in AST.

Parameters
----------
wcs : `lsst.afw.geom.SkyWcs`
    Wcs to approximate
center : `lsst.geom.Point2D`
    Point at which to evaluate the LocalWcs.

Returns
-------
localMatrix : `numpy.ndarray`
    Matrix representation the local wcs approximation with units
    radians.

Definition at line 506 of file plugins.py.

506 def makeLocalTransformMatrix(self, wcs, center):
507 """Create a local, linear approximation of the wcs transformation
508 matrix.
509
510 The approximation is created as if the center is at RA=0, DEC=0. All
511 comparing x,y coordinate are relative to the position of center. Matrix
512 is initially calculated with units arcseconds and then converted to
513 radians. This yields higher precision results due to quirks in AST.
514
515 Parameters
516 ----------
517 wcs : `lsst.afw.geom.SkyWcs`
518 Wcs to approximate
519 center : `lsst.geom.Point2D`
520 Point at which to evaluate the LocalWcs.
521
522 Returns
523 -------
524 localMatrix : `numpy.ndarray`
525 Matrix representation the local wcs approximation with units
526 radians.
527 """
528 skyCenter = wcs.pixelToSky(center)
529 localGnomonicWcs = lsst.afw.geom.makeSkyWcs(
530 center, skyCenter, np.diag((self._scale, self._scale)))
531 measurementToLocalGnomonic = wcs.getTransform().then(
532 localGnomonicWcs.getTransform().inverted()
533 )
534 localMatrix = measurementToLocalGnomonic.getJacobian(center)
535 return np.radians(localMatrix / 3600)
536
537
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
Definition SkyWcs.cc:521

◆ measure()

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.measure ( self,
measRecord,
exposure,
center )
Measure a single source.

It is the responsibility of this method to perform the desired
measurement and record the result in the `measRecord`.

Parameters
----------
measRecord : `lsst.afw.table.SourceRecord`
    Catalog record for the source being measured.
exposure : `lsst.afw.image.Exposure`
    Exposure on which the source is being measured.
center : `lsst.geom.Point2D`
    Pixel coordinates of the object.

Raises
------
MeasurementError
    Raised if the measurement fails for a known/justifiable reason.

Reimplemented from lsst.meas.base.wrappers.GenericPlugin.

Definition at line 498 of file plugins.py.

498 def measure(self, measRecord, exposure, center):
499 wcs = exposure.getWcs()
500 localMatrix = self.makeLocalTransformMatrix(wcs, center)
501 measRecord.set(self.cdMatrix11Key, localMatrix[0, 0])
502 measRecord.set(self.cdMatrix12Key, localMatrix[0, 1])
503 measRecord.set(self.cdMatrix21Key, localMatrix[1, 0])
504 measRecord.set(self.cdMatrix22Key, localMatrix[1, 1])
505

Member Data Documentation

◆ _scale [1/2]

tuple lsst.meas.base.plugins.EvaluateLocalWcsPlugin._scale = (1.0 * lsst.geom.arcseconds).asDegrees()
staticprotected

Definition at line 469 of file plugins.py.

◆ _scale [2/2]

lsst.meas.base.plugins.EvaluateLocalWcsPlugin._scale
protected

Definition at line 530 of file plugins.py.

◆ cdMatrix11Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix11Key

Definition at line 477 of file plugins.py.

◆ cdMatrix12Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix12Key

Definition at line 482 of file plugins.py.

◆ cdMatrix21Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix21Key

Definition at line 487 of file plugins.py.

◆ cdMatrix22Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix22Key

Definition at line 492 of file plugins.py.

◆ ConfigClass

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.ConfigClass = EvaluateLocalWcsPluginConfig
static

Definition at line 468 of file plugins.py.


The documentation for this class was generated from the following file: