Skip to content

Instantly share code, notes, and snippets.

@rbiswas4
Created November 13, 2016 17:48
Show Gist options
  • Save rbiswas4/ec61ba7bbc20ad4543bd2199eb8371ea to your computer and use it in GitHub Desktop.
Save rbiswas4/ec61ba7bbc20ad4543bd2199eb8371ea to your computer and use it in GitHub Desktop.
"""
Short script for displaying difference Image, from Simon's instructions
The basic philosophy is to *NOT* just look at the files using ds9, but rather
data products created by the DM stack in a repository which knows how to fetch
these data products.
"""
import lsst.afw.display
import lsst.daf.persistence as dp
# Display the differences produced by the difference imaging algorithm
# The argument is a data repository (which has a `_parent`)
butler = dp.Butler('Run3')
diff_exp = butler.get('deepDiff_differenceExp', dataId=dict(visit=250), immediate=True)
display.mtv(diff_exp)
# Find the difference image sources that are above a threshold and show their positions.
srcs = butler.get('deepDiff_diaSrc', dataId=dict(visit=250), immediate=True)
for src in srcs:
display.dot('X', src.getX(), src.getY())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment