30 from lsst.daf.butlerUtils import ImageMapping, ExposureMapping, CalibrationMapping, DatasetMapping, Registry
38 """This module defines the CameraMapper base class."""
42 """CameraMapper is a base class for mappers that handle images from a
43 camera and products derived from them. This provides an abstraction layer
44 between the data on disk and the code.
46 Public methods: keys, queryMetadata, getDatasetTypes, map,
47 canStandardize, standardize
49 Mappers for specific data sources (e.g., CFHT Megacam, LSST
50 simulations, etc.) should inherit this class.
52 The CameraMapper manages datasets within a "root" directory. It can also
53 be given an "outputRoot". If so, the input root is linked into the
54 outputRoot directory using a symlink named "_parent"; writes go into the
55 outputRoot while reads can come from either the root or outputRoot. As
56 outputRoots are used as inputs for further processing, the chain of
57 _parent links allows any dataset to be retrieved. Note that writing to a
58 dataset present in the input root will hide the existing dataset but not
59 overwrite it. See #2160 for design discussion.
61 A camera is assumed to consist of one or more rafts, each composed of
62 multiple CCDs. Each CCD is in turn composed of one or more amplifiers
63 (amps). A camera is also assumed to have a camera geometry description
64 (CameraGeom object) as a policy file, a filter description (Filter class
65 static configuration) as another policy file, and an optional defects
66 description directory.
68 Information from the camera geometry and defects are inserted into all
69 Exposure objects returned.
71 The mapper uses one or two registries to retrieve metadata about the
72 images. The first is a registry of all raw exposures. This must contain
73 the time of the observation. One or more tables (or the equivalent)
74 within the registry are used to look up data identifier components that
75 are not specified by the user (e.g. filter) and to return results for
76 metadata queries. The second is an optional registry of all calibration
77 data. This should contain validity start and end entries for each
78 calibration dataset in the same timescale as the observation time.
80 The following method must be provided by the subclass:
82 _extractDetectorName(self, dataId): returns the detector name for a CCD
83 (e.g., "CFHT 21", "R:1,2 S:3,4") as used in the AFW CameraGeom class given
84 a dataset identifier referring to that CCD or a subcomponent of it.
86 Other methods that the subclass may wish to override include:
88 _transformId(self, dataId): transformation of a data identifier
89 from colloquial usage (e.g., "ccdname") to proper/actual usage (e.g., "ccd"),
90 including making suitable for path expansion (e.g. removing commas).
91 The default implementation does nothing. Note that this
92 method should not modify its input parameter.
94 getShortCcdName(self, ccdName): a static method that returns a shortened name
95 suitable for use as a filename. The default version converts spaces to underscores.
97 _getCcdKeyVal(self, dataId): return a CCD key and value
98 by which to look up defects in the defects registry.
99 The default value returns ("ccd", detector name)
101 _mapActualToPath(self, template, actualId): convert a template path to an
102 actual path, using the actual dataset identifier.
104 The mapper's behaviors are largely specified by the policy file.
105 See the MapperDictionary.paf for descriptions of the available items.
107 The 'exposures', 'calibrations', and 'datasets' subpolicies configure
108 mappings (see Mappings class).
110 Functions to map (provide a path to the data given a dataset
111 identifier dictionary) and standardize (convert data into some standard
112 format or type) may be provided in the subclass as "map_{dataset type}"
113 and "std_{dataset type}", respectively.
115 If non-Exposure datasets cannot be retrieved using standard
116 daf_persistence methods alone, a "bypass_{dataset type}" function may be
117 provided in the subclass to return the dataset instead of using the
118 "datasets" subpolicy.
120 Implementations of map_camera and bypass_camera that should typically be
121 sufficient are provided in this base class.
124 * Handle defects the same was as all other calibration products, using the calibration registry
125 * Instead of auto-loading the camera at construction time, load it from the calibration registry
126 * Rewrite defects as AFW tables so we don't need pyfits to unpersist them; then remove all mention
127 of pyfits from this package.
131 def __init__(self, policy, repositoryDir,
132 root=
None, registry=
None, calibRoot=
None, calibRegistry=
None,
133 provided=
None, outputRoot=
None):
134 """Initialize the CameraMapper.
135 @param policy (pexPolicy.Policy) Policy with per-camera defaults
137 @param repositoryDir (string) Policy repository for the subclassing
138 module (obtained with getRepositoryPath() on the
139 per-camera default dictionary)
140 @param root (string) Root directory for data
141 @param registry (string) Path to registry with data's metadata
142 @param calibRoot (string) Root directory for calibrations
143 @param calibRegistry (string) Path to registry with calibrations'
145 @param provided (list of strings) Keys provided by the mapper
146 @param outputRoot (string) Root directory for output data
149 dafPersist.Mapper.__init__(self)
155 "MapperDictionary.paf",
"policy")
156 dictPolicy = pexPolicy.Policy.createPolicy(dictFile,
157 dictFile.getRepositoryPath())
158 policy.mergeDefaults(dictPolicy)
162 if policy.exists(
"levels"):
163 levelsPolicy = policy.getPolicy(
"levels")
164 for key
in levelsPolicy.names(
True):
165 self.
levels[key] = set(levelsPolicy.getStringArray(key))
168 if policy.exists(
"defaultSubLevels"):
169 defaultSubLevelsPolicy = policy.getPolicy(
"defaultSubLevels")
170 for key
in defaultSubLevelsPolicy.names(
True):
178 if outputRoot
is not None and os.path.abspath(outputRoot) != os.path.abspath(root):
180 if not os.path.exists(outputRoot):
182 os.makedirs(outputRoot)
184 if not e.errno == errno.EEXIST:
186 if not os.path.exists(outputRoot):
187 raise RuntimeError,
"Unable to create output " \
188 "repository '%s'" % (outputRoot,)
189 if os.path.exists(root):
191 src = os.path.abspath(root)
192 dst = os.path.join(outputRoot,
"_parent")
193 if not os.path.exists(dst):
198 if os.path.exists(dst):
199 if os.path.realpath(dst) != os.path.realpath(src):
200 raise RuntimeError,
"Output repository path " \
201 "'%s' already exists and differs from " \
202 "input repository path '%s'" % (dst, src)
204 raise RuntimeError,
"Unable to symlink from input " \
205 "repository path '%s' to output repository " \
206 "path '%s'" % (src, dst)
211 if calibRoot
is None:
212 if policy.exists(
'calibRoot'):
213 calibRoot = policy.getString(
'calibRoot')
218 if not os.path.exists(root):
219 self.log.log(pexLog.Log.WARN,
220 "Root directory not found: %s" % (root,))
221 if not os.path.exists(calibRoot):
222 self.log.log(pexLog.Log.WARN,
223 "Calibration root directory not found: %s" % (calibRoot,))
228 "registry", registry, policy,
"registryPath", root)
229 if policy.exists(
'needCalibRegistry')
and \
230 policy.getBool(
'needCalibRegistry'):
232 "calibRegistry", calibRegistry,
233 policy,
"calibRegistryPath", calibRoot)
239 "ImageMappingDictionary.paf",
"policy")
240 imgMappingPolicy = pexPolicy.Policy.createPolicy(imgMappingFile,
241 imgMappingFile.getRepositoryPath())
243 "ExposureMappingDictionary.paf",
"policy")
244 expMappingPolicy = pexPolicy.Policy.createPolicy(expMappingFile,
245 expMappingFile.getRepositoryPath())
247 "CalibrationMappingDictionary.paf",
"policy")
248 calMappingPolicy = pexPolicy.Policy.createPolicy(calMappingFile,
249 calMappingFile.getRepositoryPath())
251 "DatasetMappingDictionary.paf",
"policy")
252 dsMappingPolicy = pexPolicy.Policy.createPolicy(dsMappingFile,
253 dsMappingFile.getRepositoryPath())
260 (
"images", imgMappingPolicy, ImageMapping),
261 (
"exposures", expMappingPolicy, ExposureMapping),
262 (
"calibrations", calMappingPolicy, CalibrationMapping),
263 (
"datasets", dsMappingPolicy, DatasetMapping)
266 for name, defPolicy, cls
in mappingList:
267 if policy.exists(name):
268 datasets = policy.getPolicy(name)
270 setattr(self, name, mappings)
271 for datasetType
in datasets.names(
True):
272 subPolicy = datasets.getPolicy(datasetType)
273 subPolicy.mergeDefaults(defPolicy)
274 if name ==
"calibrations":
275 mapping = cls(datasetType, subPolicy,
276 self.
registry, calibRegistry, calibRoot, provided=provided)
278 mapping = cls(datasetType, subPolicy,
279 self.
registry, root, provided=provided)
280 self.keyDict.update(mapping.keys())
281 mappings[datasetType] = mapping
282 self.
mappings[datasetType] = mapping
283 if not hasattr(self,
"map_" + datasetType):
284 def mapClosure(dataId, write=False,
285 mapper=self, mapping=mapping):
286 return mapping.map(mapper, dataId, write)
287 setattr(self,
"map_" + datasetType, mapClosure)
288 if not hasattr(self,
"query_" + datasetType):
289 def queryClosure(key, format, dataId, mapping=mapping):
290 return mapping.lookup(format, dataId)
291 setattr(self,
"query_" + datasetType, queryClosure)
292 if hasattr(mapping,
"standardize")
and \
293 not hasattr(self,
"std_" + datasetType):
294 def stdClosure(item, dataId,
295 mapper=self, mapping=mapping):
296 return mapping.standardize(mapper, item, dataId)
297 setattr(self,
"std_" + datasetType, stdClosure)
299 mapFunc =
"map_" + datasetType +
"_filename"
300 bypassFunc =
"bypass_" + datasetType +
"_filename"
301 if not hasattr(self, mapFunc):
302 setattr(self, mapFunc, getattr(self,
"map_" + datasetType))
303 if not hasattr(self, bypassFunc):
304 setattr(self, bypassFunc,
305 lambda datasetType, pythonType, location, dataId: location.getLocations())
308 if name ==
"exposures" or name ==
"images":
309 expFunc =
"map_" + datasetType
310 mdFunc = expFunc +
"_md"
311 bypassFunc =
"bypass_" + datasetType +
"_md"
312 if not hasattr(self, mdFunc):
313 setattr(self, mdFunc, getattr(self, expFunc))
314 if not hasattr(self, bypassFunc):
315 setattr(self, bypassFunc,
316 lambda datasetType, pythonType, location, dataId:
318 if not hasattr(self,
"query_" + datasetType +
"_md"):
319 setattr(self,
"query_" + datasetType +
"_md",
320 getattr(self,
"query_" + datasetType))
322 subFunc = expFunc +
"_sub"
323 if not hasattr(self, subFunc):
324 def mapSubClosure(dataId, write=False, mapper=self, mapping=mapping):
325 subId = dataId.copy()
327 loc = mapping.map(mapper, subId, write)
328 bbox = dataId[
'bbox']
329 llcX = bbox.getMinX()
330 llcY = bbox.getMinY()
331 width = bbox.getWidth()
332 height = bbox.getHeight()
333 loc.additionalData.set(
'llcX', llcX)
334 loc.additionalData.set(
'llcY', llcY)
335 loc.additionalData.set(
'width', width)
336 loc.additionalData.set(
'height', height)
337 if 'imageOrigin' in dataId:
338 loc.additionalData.set(
'imageOrigin',
339 dataId[
'imageOrigin'])
341 setattr(self, subFunc, mapSubClosure)
342 if not hasattr(self,
"query_" + datasetType +
"_sub"):
343 def querySubClosure(key, format, dataId, mapping=mapping):
344 subId = dataId.copy()
346 return mapping.lookup(format, subId)
347 setattr(self,
"query_" + datasetType +
"_sub", querySubClosure)
355 if policy.exists(
'defects'):
357 repositoryDir, policy.getString(
'defects'))
358 defectRegistryLocation = os.path.join(
361 Registry.create(defectRegistryLocation)
372 raise ValueError(
'class variable packageName must not be None')
375 """Look for the given path in the current root or any of its parents
376 by following "_parent" symlinks; return None if it can't be found. A
377 little tricky because the path may be in an alias of the root (e.g.
378 ".") and because the "_parent" links go between the root and the rest
387 while len(rootDir) > 1
and rootDir[-1] ==
'/':
388 rootDir = rootDir[:-1]
390 if path.startswith(rootDir +
"/"):
392 path = path[len(rootDir)+1:]
394 elif rootDir ==
"/" and path.startswith(
"/"):
399 pathPrefix = os.path.dirname(path)
400 while pathPrefix !=
"" and pathPrefix !=
"/":
401 if os.path.realpath(pathPrefix) == os.path.realpath(self.
root):
403 pathPrefix = os.path.dirname(pathPrefix)
404 if os.path.realpath(pathPrefix) != os.path.realpath(self.
root):
406 if os.path.exists(path):
409 if pathPrefix ==
"/":
411 elif pathPrefix !=
"":
412 path = path[len(pathPrefix)+1:]
419 firstBracket = path.find(
"[")
420 if firstBracket != -1:
421 strippedPath = path[:firstBracket]
422 while not os.path.exists(os.path.join(dir, strippedPath)):
423 dir = os.path.join(dir,
"_parent")
424 if not os.path.exists(dir):
426 return os.path.join(dir, path)
429 """Rename any existing object with the given type and dataId.
431 The CameraMapper implementation saves objects in a sequence of e.g.:
435 All of the backups will be placed in the output repo, however, and will
436 not be removed if they are found elsewhere in the _parent chain. This
437 means that the same file will be stored twice if the previous version was
438 found in an input repo.
441 newLocation = self.
map(datasetType, dataId, write=
True)
442 newPath = newLocation.getLocations()[0]
445 while path
is not None:
447 oldPaths.append((n, path))
449 for n, oldPath
in reversed(oldPaths):
450 newDir, newFile = os.path.split(newPath)
451 if not os.path.exists(newDir):
453 shutil.copy(oldPath,
"%s~%d" % (newPath, n))
456 """Return supported keys.
457 @return (iterable) List of keys usable in a dataset identifier"""
458 return self.keyDict.iterkeys()
461 """Return supported keys and their value types for a given dataset
462 type at a given level of the key hierarchy.
464 @param datasetType (str) dataset type or None for all keys
465 @param level (str) level or None for all levels
466 @return (iterable) Set of keys usable in a dataset identifier"""
467 if datasetType
is None:
471 if level
is not None and level
in self.
levels:
472 keyDict = dict(keyDict)
473 for l
in self.
levels[level]:
482 if self.defaultSubLevels.has_key(level):
488 """Return the name of the camera that this CameraMapper is for."""
490 m = re.search(
r'(\w+)Mapper', className)
492 m = re.search(
r"class '[\w.]*?(\w+)'", className)
494 return name[:1].lower() + name[1:]
if name
else ''
498 """Return the name of the package containing this CameraMapper."""
499 if cls.packageName
is None:
500 raise ValueError(
'class variable packageName must not be None')
501 return cls.packageName
504 """Map a camera dataset."""
506 raise RuntimeError(
"No camera dataset available.")
509 pythonType =
"lsst.afw.cameraGeom.CameraConfig",
511 storageName =
"ConfigStorage",
517 """Return the (preloaded) camera object.
520 raise RuntimeError(
"No camera dataset available.")
524 """Map defects dataset.
526 @return a very minimal ButlerLocation containing just the locationList field
527 (just enough information that bypass_defects can use it).
530 if defectFitsPath
is None:
531 raise RuntimeError(
"No defects available for dataId=%s" % (dataId,))
536 """Return a defect based on the butler location returned by map_defects
538 @param[in] butlerLocation: a ButlerLocation with locationList = path to defects FITS file
539 @param[in] dataId: the usual data ID; "ccd" must be set
541 Note: the name "bypass_XXX" means the butler makes no attempt to convert the ButlerLocation
542 into an object, which is what we want for now, since that conversion is a bit tricky.
545 defectsFitsPath = butlerLocation.locationList[0]
546 with pyfits.open(defectsFitsPath)
as hduList:
547 for hdu
in hduList[1:]:
548 if hdu.header[
"name"] != detectorName:
552 for data
in hdu.data:
560 raise RuntimeError(
"No defects for ccd %s in %s" % (detectorName, defectsFitsPath))
563 """Standardize a raw dataset by converting it to an Exposure instead of an Image"""
569 """Map a sky policy."""
571 "Internal",
None,
None)
574 """Standardize a sky policy by returning the one we use."""
584 """Return CCD key and value used to look a defect in the defect registry
586 The default implementation simply returns ("ccd", full detector name)
591 """Set up a registry (usually SQLite3), trying a number of possible
593 @param name (string) Name of registry
594 @param path (string) Path for registry
595 @param policyKey (string) Key in policy for registry path
596 @param root (string) Root directory to look in
597 @return (lsst.daf.butlerUtils.Registry) Registry object"""
599 if path
is None and policy.exists(policyKey):
601 policy.getString(policyKey)).locString()
602 if not os.path.exists(path):
603 if not os.path.isabs(path)
and root
is not None:
606 self.log.log(pexLog.Log.WARN,
607 "Unable to locate registry at policy path (also looked in root): %s" % path)
610 self.log.log(pexLog.Log.WARN,
611 "Unable to locate registry at policy path: %s" % path)
613 if path
is None and root
is not None:
614 path = os.path.join(root,
"%s.sqlite3" % name)
617 self.log.log(pexLog.Log.WARN,
618 "Unable to locate %s registry in root: %s" % (name, path))
621 path = os.path.join(
".",
"%s.sqlite3" % name)
624 self.log.log(pexLog.Log.WARN,
625 "Unable to locate %s registry in current dir: %s" % (name, path))
628 if not os.path.exists(path):
630 if newPath
is not None:
632 self.log.log(pexLog.Log.INFO,
633 "Loading %s registry from %s" % (name, path))
634 registry = Registry.create(path)
636 raise RuntimeError,
"Unable to load %s registry from %s" % (name, path)
640 self.log.log(pexLog.Log.WARN,
641 "No registry loaded; proceeding without one")
645 """Generate a standard ID dict from a camera-specific ID dict.
647 Canonical keys include:
648 - amp: amplifier name
649 - ccd: CCD name (in LSST this is a combination of raft and sensor)
650 The default implementation returns a copy of its input.
652 @param dataId[in] (dict) Dataset identifier; this must not be modified
653 @return (dict) Transformed dataset identifier"""
658 """Convert a template path to an actual path, using the actual data
659 identifier. This implementation is usually sufficient but can be
660 overridden by the subclass.
661 @param template (string) Template path
662 @param actualId (dict) Dataset identifier
663 @return (string) Pathname"""
669 """Convert a CCD name to a form useful as a filename
671 The default implementation converts spaces to underscores.
673 return ccdName.replace(
" ",
"_")
676 """Extract the detector (CCD) name from the dataset identifier.
678 The name in question is the detector name used by lsst.afw.cameraGeom.
680 @param dataId (dict) Dataset identifier
681 @return (string) Detector name
683 raise NotImplementedError(
"No _extractDetectorName() function specified")
686 """Extract the amplifier identifer from a dataset identifier.
688 @warning this is deprecated; DO NOT USE IT
690 amplifier identifier has two parts: the detector name for the CCD
691 containing the amplifier and index of the amplifier in the detector.
692 @param dataId (dict) Dataset identifer
693 @return (tuple) Amplifier identifier"""
696 return (trDataId[
"ccd"], int(trDataId[
'amp']))
699 """Set the detector object in an Exposure for an amplifier.
700 Defects are also added to the Exposure based on the detector object.
701 @param[in,out] item (lsst.afw.image.Exposure)
702 @param dataId (dict) Dataset identifier
703 @param trimmed (bool) Should detector be marked as trimmed? (ignored)"""
708 """Set the detector object in an Exposure for a CCD.
709 @param[in,out] item (lsst.afw.image.Exposure)
710 @param dataId (dict) Dataset identifier
711 @param trimmed (bool) Should detector be marked as trimmed? (ignored)"""
714 detector = self.
camera[detectorName]
715 item.setDetector(detector)
718 """Set the filter object in an Exposure. If the Exposure had a FILTER
719 keyword, this was already processed during load. But if it didn't,
720 use the filter from the registry.
721 @param mapping (lsst.daf.butlerUtils.Mapping)
722 @param[in,out] item (lsst.afw.image.Exposure)
723 @param dataId (dict) Dataset identifier"""
725 if not (isinstance(item, afwImage.ExposureU)
or isinstance(item, afwImage.ExposureI)
or
726 isinstance(item, afwImage.ExposureF)
or isinstance(item, afwImage.ExposureD)):
729 actualId = mapping.need([
'filter'], dataId)
730 filterName = actualId[
'filter']
731 if self.
filters is not None and self.filters.has_key(filterName):
732 filterName = self.
filters[filterName]
736 """Set the exposure time and exposure midpoint in the calib object in
737 an Exposure. Use the EXPTIME and MJD-OBS keywords (and strip out
739 @param mapping (lsst.daf.butlerUtils.Mapping)
740 @param[in,out] item (lsst.afw.image.Exposure)
741 @param dataId (dict) Dataset identifier"""
743 md = item.getMetadata()
744 calib = item.getCalib()
745 if md.exists(
"EXPTIME"):
746 expTime = md.get(
"EXPTIME")
747 calib.setExptime(expTime)
750 expTime = calib.getExptime()
751 if md.exists(
"MJD-OBS"):
753 dafBase.DateTime.MJD, dafBase.DateTime.UTC)
754 obsMidpoint = obsStart.nsecs() + long(expTime * 1000000000L / 2)
761 """Default standardization function for images.
762 @param mapping (lsst.daf.butlerUtils.Mapping)
763 @param[in,out] item (lsst.afw.image.Exposure)
764 @param dataId (dict) Dataset identifier
765 @param filter (bool) Set filter?
766 @param trimmed (bool) Should detector be marked as trimmed?
767 @return (lsst.afw.image.Exposure) the standardized Exposure"""
769 if (re.search(
r'Exposure', mapping.python)
and re.search(
r'Image',mapping.persistable)):
772 if mapping.level.lower() ==
"amp":
774 elif mapping.level.lower() ==
"ccd":
779 if not isinstance(mapping, CalibrationMapping):
785 """Find the defects for a given CCD.
786 @param dataId (dict) Dataset identifier
787 @return (string) path to the defects file or None if not available"""
791 raise RuntimeError,
"No registry for defect lookup"
795 rows = self.registry.executeQuery((
"taiObs",), (
"raw_visit",),
796 [(
"visit",
"?")],
None, (dataId[
'visit'],))
799 assert len(rows) == 1
804 rows = self.defectRegistry.executeQuery((
"path",), (
"defect",),
806 (
"DATETIME(?)",
"DATETIME(validStart)",
"DATETIME(validEnd)"),
808 if not rows
or len(rows) == 0:
811 return os.path.join(self.
defectPath, rows[0][0])
813 raise RuntimeError(
"Querying for defects (%s, %s) returns %d files: %s" %
814 (ccdVal, taiObs, len(rows),
", ".join([_[0]
for _
in rows])))
817 """Make a camera (instance of lsst.afw.cameraGeom.Camera) describing the camera geometry
819 Also set self.cameraDataLocation, if relevant (else it can be left None).
821 This implementation assumes that policy contains an entry "camera" that points to the
822 subdirectory in this package of camera data; specifically, that subdirectory must contain:
823 - a file named `camera.py` that contains persisted camera config
824 - ampInfo table FITS files, as required by lsst.afw.cameraGeom.makeCameraFromPath
826 @param policy (pexPolicy.Policy) Policy with per-camera defaults
828 @param repositoryDir (string) Policy repository for the subclassing
829 module (obtained with getRepositoryPath() on the
830 per-camera default dictionary)
832 if not policy.exists(
'camera'):
833 raise RuntimeError(
"Cannot find 'camera' in policy; cannot construct a camera")
835 cameraDataSubdir = policy.getString(
'camera')
837 os.path.join(repositoryDir, cameraDataSubdir,
"camera.py"))
838 cameraConfig = afwCameraGeom.CameraConfig()
841 return afwCameraGeom.makeCameraFromPath(
842 cameraConfig = cameraConfig,
843 ampInfoPath = ampInfoPath,
849 """Generate an exposure from a DecoratedImage or similar
850 @param[in] image Image of interest
851 @return (lsst.afw.image.Exposure) Exposure containing input image
853 if isinstance(image, afwImage.DecoratedImageU)
or isinstance(image, afwImage.DecoratedImageI)
or \
854 isinstance(image, afwImage.DecoratedImageF)
or isinstance(image, afwImage.DecoratedImageD):
858 md = image.getMetadata()
859 exposure.setMetadata(md)
862 wcsMetadata = wcs.getFitsMetadata()
863 for kw
in wcsMetadata.paramNames():
Class for handling dates/times, including MJD, UTC, and TAI.
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename Image< ImagePixelT >::Ptr image, typename Mask< MaskPixelT >::Ptr mask=typename Mask< MaskPixelT >::Ptr(), typename Image< VariancePixelT >::Ptr variance=typename Image< VariancePixelT >::Ptr())
Encapsulate information about a bad portion of a detector.
Class for logical location of a persisted Persistable instance.
a representation of a default Policy file that is stored as a file in the installation directory of a...
def _getCcdKeyVal
Utility functions.
a place to record messages and descriptions of the state of processing.
An integer coordinate rectangle.
Wcs::Ptr makeWcs(coord::Coord const &crval, geom::Point2D const &crpix, double CD11, double CD12, double CD21, double CD22)
Create a Wcs object from crval, crpix, CD, using CD elements (useful from python) ...
Holds an integer identifier for an LSST filter.
boost::shared_ptr< daf::base::PropertySet > readMetadata(std::string const &fileName, int hdu=0, bool strip=false)
Return the metadata (header entries) from a FITS file.
Exposure< ImagePixelT, MaskPixelT, VariancePixelT >::Ptr makeExposure(MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, boost::shared_ptr< Wcs const > wcs=boost::shared_ptr< Wcs const >())