lsst.pipe.drivers g613e996a0d+ff33dbfb3f
Functions | Variables
lsst.pipe.drivers.checksum Namespace Reference

Functions

def checksum (obj, header=None, sumType="MD5")
 Calculate a checksum of an object. More...
 

Variables

tuple exposureTypes = (afwImage.ExposureF, afwImage.ExposureD,)
 
tuple maskedImageTypes = (afwImage.MaskedImageF, afwImage.MaskedImageD,)
 
tuple decoratedImageTypes = (afwImage.DecoratedImageF, afwImage.DecoratedImageD,)
 
tuple imageTypes = (afwImage.ImageF, afwImage.ImageD, afwImage.ImageI,)
 
int PROTOCOL = 2
 
dictionary sumFunctions
 

Function Documentation

◆ checksum()

def lsst.pipe.drivers.checksum.checksum (   obj,
  header = None,
  sumType = "MD5" 
)

Calculate a checksum of an object.

We have special handling for images (e.g., breaking a MaskedImage into
its various components), but the object may be any picklable type.

@param obj  Object for which to calculate the checksum
@param header  FITS header (PropertyList) to update with checksum values, or None
@param sumType  Type of checksum to calculate
@return dict with header keyword,value pairs

Definition at line 24 of file checksum.py.

Variable Documentation

◆ decoratedImageTypes

tuple lsst.pipe.drivers.checksum.decoratedImageTypes = (afwImage.DecoratedImageF, afwImage.DecoratedImageD,)

Definition at line 12 of file checksum.py.

◆ exposureTypes

tuple lsst.pipe.drivers.checksum.exposureTypes = (afwImage.ExposureF, afwImage.ExposureD,)

Definition at line 10 of file checksum.py.

◆ imageTypes

tuple lsst.pipe.drivers.checksum.imageTypes = (afwImage.ImageF, afwImage.ImageD, afwImage.ImageI,)

Definition at line 13 of file checksum.py.

◆ maskedImageTypes

tuple lsst.pipe.drivers.checksum.maskedImageTypes = (afwImage.MaskedImageF, afwImage.MaskedImageD,)

Definition at line 11 of file checksum.py.

◆ PROTOCOL

int lsst.pipe.drivers.checksum.PROTOCOL = 2

Definition at line 15 of file checksum.py.

◆ sumFunctions

dictionary lsst.pipe.drivers.checksum.sumFunctions
Initial value:
1= {
2 "CRC32": lambda obj: zlib.crc32(pickle.dumps(obj, PROTOCOL)),
3 "MD5": lambda obj: hashlib.md5(pickle.dumps(obj, PROTOCOL)).hexdigest(),
4}

Definition at line 18 of file checksum.py.