LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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 467 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 480 of file plugins.py.

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

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 477 of file plugins.py.

477 def getExecutionOrder(cls):
478 return BasePlugin.FLUX_ORDER
479

◆ 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 511 of file plugins.py.

511 def makeLocalTransformMatrix(self, wcs, center):
512 """Create a local, linear approximation of the wcs transformation
513 matrix.
514
515 The approximation is created as if the center is at RA=0, DEC=0. All
516 comparing x,y coordinate are relative to the position of center. Matrix
517 is initially calculated with units arcseconds and then converted to
518 radians. This yields higher precision results due to quirks in AST.
519
520 Parameters
521 ----------
522 wcs : `lsst.afw.geom.SkyWcs`
523 Wcs to approximate
524 center : `lsst.geom.Point2D`
525 Point at which to evaluate the LocalWcs.
526
527 Returns
528 -------
529 localMatrix : `numpy.ndarray`
530 Matrix representation the local wcs approximation with units
531 radians.
532 """
533 skyCenter = wcs.pixelToSky(center)
534 localGnomonicWcs = lsst.afw.geom.makeSkyWcs(
535 center, skyCenter, np.diag((self._scale, self._scale)))
536 measurementToLocalGnomonic = wcs.getTransform().then(
537 localGnomonicWcs.getTransform().inverted()
538 )
539 localMatrix = measurementToLocalGnomonic.getJacobian(center)
540 return np.radians(localMatrix / 3600)
541
542
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 503 of file plugins.py.

503 def measure(self, measRecord, exposure, center):
504 wcs = exposure.getWcs()
505 localMatrix = self.makeLocalTransformMatrix(wcs, center)
506 measRecord.set(self.cdMatrix11Key, localMatrix[0, 0])
507 measRecord.set(self.cdMatrix12Key, localMatrix[0, 1])
508 measRecord.set(self.cdMatrix21Key, localMatrix[1, 0])
509 measRecord.set(self.cdMatrix22Key, localMatrix[1, 1])
510

Member Data Documentation

◆ _scale [1/2]

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

Definition at line 474 of file plugins.py.

◆ _scale [2/2]

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

Definition at line 535 of file plugins.py.

◆ cdMatrix11Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix11Key

Definition at line 482 of file plugins.py.

◆ cdMatrix12Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix12Key

Definition at line 487 of file plugins.py.

◆ cdMatrix21Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix21Key

Definition at line 492 of file plugins.py.

◆ cdMatrix22Key

lsst.meas.base.plugins.EvaluateLocalWcsPlugin.cdMatrix22Key

Definition at line 497 of file plugins.py.

◆ ConfigClass

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

Definition at line 473 of file plugins.py.


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