1 from __future__
import print_function
30 """Get a dataset from a repository with an optional exception or warning if not found 32 @param[in] butler: data butler 33 @param[in] dataset: name of desired dataset 34 @param[in] dataId: data ID dict 35 @param[in] strict: if True then raise RuntimeError if dataset not found 36 @param[in] warn: if True and strict False then print a warning to stderr if dataset not found 38 @raise RuntimeError if dataset not found and strict true 41 ds = butler.get(dataset, dataId=dataId, immediate=
True)
45 msg =
'{} : Failed to retrieve {} dataset'.
format(dataId, dataset)
47 raise RuntimeError(msg)
49 print(
'*** Skipping ' + msg, file=sys.stderr)
53 def getPsf(butler, dataset, dataId, strict, warn):
54 """Get the PSF from a repository without reading (very much of) the exposure 56 @param[in] butler: data butler 57 @param[in] dataset: name of desired dataset 58 @param[in] dataId: data ID dict of exposure containing desired PSF 59 @param[in] strict: if True then raise RuntimeError if psf not found 60 @param[in] warn: if True and strict False then print a warning to stderr if psf not found 62 @raise RuntimeError if exposure not found (regardless of strict) 63 @raise RuntimeError if exposure has no PSF and strict true 67 tinyExposure = butler.get(dataset +
"_sub", dataId=dataId, bbox=tinyBBox,
68 imageOrigin=
"LOCAL", immediate=
True)
69 psf = tinyExposure.getPsf()
71 msg =
'%s : %s exposure had no PSF' % (dataId, dataset)
74 raise RuntimeError(msg)
76 print(
'*** Skipping ' + msg, file=sys.stderr)
def getDataset(butler, dataset, dataId, strict, warn)
An integer coordinate rectangle.
def getPsf(butler, dataset, dataId, strict, warn)
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)