Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-11356: Confusion of refObjLoader.pixelMargin and matcher.maxOffsetPix #74

Merged
merged 2 commits into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion python/lsst/meas/astrom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from .setMatchDistance import *
from .display import *
from .approximateWcs import *
from .createMatchMetadata import *
from .catalogStarSelector import *
from .directMatch import *
from .fitTanSipWcs import *
Expand Down
14 changes: 8 additions & 6 deletions python/lsst/meas/astrom/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from .ref_match import RefMatchTask, RefMatchConfig
from .fitTanSipWcs import FitTanSipWcsTask
from .display import displayAstrometry
from .createMatchMetadata import createMatchMetadata


class AstrometryConfig(RefMatchConfig):
Expand Down Expand Up @@ -207,18 +206,21 @@ def solve(self, exposure, sourceCat):
import lsstDebug
debug = lsstDebug.Info(__name__)

matchMeta = createMatchMetadata(exposure, border=self.refObjLoader.config.pixelMargin)
expMd = self._getExposureMetadata(exposure)
exp_bbox = expMd.bbox
exp_bbox.grow(afwGeom.Extent2I(self.config.matcher.maxOffsetPix,
self.config.matcher.maxOffsetPix))

loadRes = self.refObjLoader.loadPixelBox(
bbox=exp_bbox,
bbox=expMd.bbox,
wcs=expMd.wcs,
filterName=expMd.filterName,
calib=expMd.calib,
)
matchMeta = self.refObjLoader.getMetadataBox(
bbox=expMd.bbox,
wcs=expMd.wcs,
filterName=expMd.filterName,
calib=expMd.calib,
)

if debug.display:
frame = int(debug.frame)
displayAstrometry(
Expand Down
43 changes: 0 additions & 43 deletions python/lsst/meas/astrom/createMatchMetadata.py

This file was deleted.

3 changes: 1 addition & 2 deletions python/lsst/meas/astrom/directMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from lsst.pex.config import Config, Field, ConfigurableField
from lsst.pipe.base import Task, Struct
from .createMatchMetadata import MatchMetadata
from lsst.meas.algorithms import LoadIndexedReferenceObjectsTask
import lsst.afw.table as afwTable
import lsst.afw.coord as afwCoord
Expand Down Expand Up @@ -88,7 +87,7 @@ def run(self, catalog, filterName=None):
matchMeta (lsst.meas.astrom.MatchMetadata)
"""
circle = self.calculateCircle(catalog)
matchMeta = MatchMetadata(circle.center, circle.radius, filterName)
matchMeta = self.refObjLoader.getMetadataCircle(circle.center, circle.radius, filterName)
refData = self.refObjLoader.loadSkyCircle(circle.center, circle.radius, filterName)
matches = afwTable.matchRaDec(refData.refCat, catalog, self.config.matchRadius*arcseconds)
self.log.info("Matched %d from %d input and %d reference sources" %
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class MatchOptimisticBConfig(pexConfig.Config):
max=1,
)
maxOffsetPix = pexConfig.RangeField(
doc="Maximum allowed shift of WCS, due to matching (pixel)",
doc="Maximum allowed shift of WCS, due to matching (pixel). "
"When changing this value, the LoadReferenceObjectsConfig.pixelMargin should also be updated.",
dtype=int,
default=300,
max=4000,
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/meas/astrom/matchPessimisticB.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class MatchPessimisticBConfig(pexConfig.Config):
min=1,
)
maxOffsetPix = pexConfig.RangeField(
doc="Maximum allowed shift of WCS, due to matching (pixel).",
doc="Maximum allowed shift of WCS, due to matching (pixel). "
"When changing this value, the LoadReferenceObjectsConfig.pixelMargin should also be updated.",
dtype=int,
default=300,
max=4000,
Expand Down
8 changes: 6 additions & 2 deletions python/lsst/meas/astrom/ref_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from .matchOptimisticB import MatchOptimisticBTask
from .display import displayAstrometry
from . import makeMatchStatistics
from .createMatchMetadata import createMatchMetadata


class RefMatchConfig(pexConfig.Config):
Expand Down Expand Up @@ -94,7 +93,6 @@ def loadAndMatch(self, exposure, sourceCat):
import lsstDebug
debug = lsstDebug.Info(__name__)

matchMeta = createMatchMetadata(exposure, border=self.refObjLoader.config.pixelMargin)
expMd = self._getExposureMetadata(exposure)

loadRes = self.refObjLoader.loadPixelBox(
Expand All @@ -103,6 +101,12 @@ def loadAndMatch(self, exposure, sourceCat):
filterName=expMd.filterName,
calib=expMd.calib,
)
matchMeta = self.refObjLoader.getMetadataBox(
bbox=expMd.bbox,
wcs=expMd.wcs,
filterName=expMd.filterName,
calib=expMd.calib,
)

matchRes = self.matcher.matchObjectsToSources(
refCat=loadRes.refCat,
Expand Down