Skip to content

Commit

Permalink
Update method to merge configs that allows registries.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Nov 5, 2021
1 parent 4927fbd commit 34d4f2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion python/lsst/pipe/tasks/makeDiscreteSkyMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ def run(self, wcs_bbox_tuple_list, oldSkyMap=None):
skyMapConfig.raList.extend(oldSkyMap.config.raList)
skyMapConfig.decList.extend(oldSkyMap.config.decList)
skyMapConfig.radiusList.extend(oldSkyMap.config.radiusList)
skyMapConfig.update(**self.config.skyMap.toDict())
configIntersection = {k: getattr(self.config.skyMap, k)
for k in self.config.skyMap.toDict()
if k in skyMapConfig}
skyMapConfig.update(**configIntersection)
circleCenter = lsst.sphgeom.LonLat(circle.getCenter())
skyMapConfig.raList.append(circleCenter[0].asDegrees())
skyMapConfig.decList.append(circleCenter[1].asDegrees())
Expand Down
5 changes: 3 additions & 2 deletions tests/test_makeDiscreteSkyMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

from lsst.utils import getPackageDir
import lsst.utils.tests
from lsst.geom import Extent2I, Box2D
from lsst.geom import Box2D
from lsst.skymap import Index2D
from lsst.daf.persistence import Butler
from lsst.pipe.tasks.makeDiscreteSkyMap import MakeDiscreteSkyMapTask, DiscreteSkyMap

Expand Down Expand Up @@ -75,7 +76,7 @@ def testBasics(self):
self.assertEqual(len(skyMap), 1)
tractInfo = skyMap[0]
self.assertEqual(tractInfo.getId(), 0)
self.assertEqual(tractInfo.getNumPatches(), Extent2I(3, 3))
self.assertEqual(tractInfo.getNumPatches(), Index2D(x=3, y=3))
tractWcs = tractInfo.getWcs()
tractBoxD = Box2D(tractInfo.getBBox())
for skyPoint in coordList:
Expand Down

0 comments on commit 34d4f2c

Please sign in to comment.