measure_object_size.py 442 Bytes
Newer Older
michitaro's avatar
michitaro committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Using Butler
import lsst.daf.persistence as dafPersist

dataDir = "$home/hsc/rerun/[rerun]"
butler = dafPersist.Butler(dataDir)
dataId = {'tract':xxxx, 'patch':xxxx}
catalog = butler.get('psf', dataId, immediate=True)
Ixx = catalog.getIxx()
Iyy = catalog.getIyy()
Ixy = catalog.getIxy()
size = (Ixx*Iyy - Ixy**2)**(1./4)

# In case of using pyfits, the data is stored as array[Ixx, Iyy, Ixy]. 
# You can use this array for size calculation.