butler_example.py 731 Bytes
Newer Older
michitaro's avatar
michitaro committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# python module calling butler
import lsst.daf.persistence as dafPersist

# Specify rerun directory in which the data you want to use is stored
dataDir = "~/hsc/rerun/<rerun name>"

# Call butler
butler = dafPersist.Butler(dataDir)

# Specify the target data and searched by butler
#
# CORR-0902798-59.fits
# 'calexp' means CORR-*.fits
# For calexp type data, you need to specify visit and ccd in dataId
dataId = {'visit': 902798, 'ccd': 59}
exp = butler.get('calexp', dataId)

# put the settings in a dict object and call ds9.mtv()
settings = {'scale':scale, 'zoom': zoom, 'mask' : 'transparency 60'}
ds9.mtv(exp, frame=frame, title=title, settings=settings)

# get the exposure from the butler
sources = butler.get('src', dataId)