Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Sprint:AP S19-3
-
Team:Alert Production
Description
Looks like we have an out-of-range memory access error hiding in the catalog centroid getters, if the catalog does not have centroid slots defined:
import lsst.afw.table
|
schema = lsst.afw.table.SourceTable.makeMinimalSchema()
|
lsst.afw.table.Point2DKey.addFields(schema, "centroid", "centroid", "pixels")
|
catalog = lsst.afw.table.SourceCatalog(schema)
|
record = catalog.addNew()
|
record.set('centroid_x', 1)
|
record.set('centroid_y', 2)
|
record = catalog.addNew()
|
record.set('centroid_x', 4)
|
record.set('centroid_y', 5)
|
# no slots defined results in nonsense!
|
print(catalog.getX())
|
print(catalog.getY())
|
prints various nonsense values, like:
[1.265e-321 2.846e-321]
|
[1.265e-321 2.846e-321]
|
We should probably check the other getters for similar bugs.
Attachments
Issue Links
- relates to
-
DM-17452 slots are not propagated into MultiMatch output schema
- Done
Thank you for for the review!
I've responded to comments on the GitHub PR, and added a few more comments to the code.
A few points worth noting:
If any of the above make you scream, shout and I'll change my mind before merging; otherwise, I'll push this in as it now is sometime tomorrow.