|
LSSTApplications
1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
|
Namespaces | |
| config | |
| detail | |
Classes | |
| class | SourceAndExposure |
| struct | ClusteringControl |
| Parameters for the clustering algorithm and its internals. More... | |
| class | SourceClusterColumnViewT |
| struct | KeyTuple |
| A three-element tuple of mean, uncertainty, and count keys. More... | |
| class | SourceClusterRecord |
| Record class that contains measurement averages on clusters of single exposure sources. More... | |
| class | SourceClusterTable |
| Table class that contains measurement means on clusters of single exposure sources. More... | |
| class | SourceClusterIdFactory |
| struct | SourceProcessingControl |
| Parameters for source processing. More... | |
Typedefs | |
| typedef SourceClusterColumnViewT < SourceClusterRecord > | SourceClusterColumnView |
| typedef lsst::afw::table::SortedCatalogT < SourceClusterRecord > | SourceClusterCatalog |
| typedef lsst::afw::table::SortedCatalogT < SourceClusterRecord const > | ConstSourceClusterCatalog |
Functions | |
| boost::shared_ptr< std::vector < SourceAndExposure > > const | computeBasicAttributes (SourceClusterRecord &cluster, SourceCatalog const &sources, ExposureInfoMap const &exposures, std::string const &exposurePrefix) |
| void | computeFluxMean (SourceClusterRecord &cluster, std::vector< SourceAndExposure > const &sources, std::string const &fluxDef, std::vector< Key< Flag > > const &skipFlags, double fluxScale) |
| void | computeShapeMean (SourceClusterRecord &cluster, std::vector< SourceAndExposure > const &sources, std::string const &shapeDef, std::vector< lsst::afw::table::Key< lsst::afw::table::Flag > > const &skipFlags) |
| std::pair< boost::shared_ptr < SourceTable >, SchemaMapper > const | makeOutputSourceTable (SourceTable const &prototype, SourceProcessingControl const &control) |
| boost::shared_ptr < SourceClusterTable > const | makeSourceClusterTable (SourceTable const &prototype, boost::shared_ptr< IdFactory > const &idFactory, SourceProcessingControl const &control) |
| void | processSources (SourceCatalog const &expSources, ExposureInfo const &expInfo, lsst::ap::utils::PT1SkyTile const *skyTile, SourceProcessingControl const &control, SchemaMapper const &mapper, SourceCatalog &sources, SourceCatalog &badSources, SourceCatalog &invalidSources) |
| std::vector< SourceCatalog > const | cluster (SourceCatalog const &sources, ClusteringControl const &control) |
| void | setClusterFields (SourceCatalog &sources, SourceClusterRecord const &record, SourceProcessingControl const &control) |
| KeyTuple< lsst::afw::table::Shape > | addShapeFields (lsst::afw::table::Schema &schema, std::string const &filter, std::string const &name, std::string const &doc) |
| Convenience function to setup fields for shapes. More... | |
| KeyTuple< lsst::afw::table::Flux > | addFluxFields (lsst::afw::table::Schema &schema, std::string const &filter, std::string const &name, std::string const &doc, std::string const &unit) |
| Convenience function to setup fields for fluxes. More... | |
| boost::shared_ptr< std::vector < SourceAndExposure > > const | computeBasicAttributes (SourceClusterRecord &cluster, lsst::afw::table::SourceCatalog const &sources, lsst::ap::match::ExposureInfoMap const &exposures, std::string const &exposurePrefix) |
| void | computeFluxMean (SourceClusterRecord &cluster, std::vector< SourceAndExposure > const &sources, std::string const &fluxDef, std::vector< lsst::afw::table::Key< lsst::afw::table::Flag > > const &skipFlags, double fluxScale) |
| boost::shared_ptr < SourceClusterTable > const | makeSourceClusterTable (lsst::afw::table::SourceTable const &prototype, boost::shared_ptr< lsst::afw::table::IdFactory > const &idFactory, SourceProcessingControl const &control) |
| void | processSources (lsst::afw::table::SourceCatalog const &expSources, lsst::ap::match::ExposureInfo const &expInfo, lsst::ap::utils::PT1SkyTile const *skyTile, SourceProcessingControl const &control, lsst::afw::table::SchemaMapper const &mapper, lsst::afw::table::SourceCatalog &sources, lsst::afw::table::SourceCatalog &badSources, lsst::afw::table::SourceCatalog &invalidSources) |
| std::vector < lsst::afw::table::SourceCatalog > const | cluster (lsst::afw::table::SourceCatalog const &sources, ClusteringControl const &control) |
| void | setClusterFields (lsst::afw::table::SourceCatalog &sources, SourceClusterRecord const &record, SourceProcessingControl const &control) |
| typedef lsst::afw::table::SortedCatalogT<SourceClusterRecord const> lsst::ap::cluster::ConstSourceClusterCatalog |
Definition at line 858 of file SourceCluster.h.
| typedef lsst::afw::table::SortedCatalogT<SourceClusterRecord> lsst::ap::cluster::SourceClusterCatalog |
Definition at line 857 of file SourceCluster.h.
Definition at line 826 of file SourceCluster.h.
| KeyTuple< lsst::afw::table::Flux > lsst::ap::cluster::addFluxFields | ( | lsst::afw::table::Schema & | schema, |
| std::string const & | filter, | ||
| std::string const & | name, | ||
| std::string const & | doc, | ||
| std::string const & | unit | ||
| ) |
Convenience function to setup fields for fluxes.
Definition at line 435 of file SourceCluster.cc.
| KeyTuple< lsst::afw::table::Shape > lsst::ap::cluster::addShapeFields | ( | lsst::afw::table::Schema & | schema, |
| std::string const & | filter, | ||
| std::string const & | name, | ||
| std::string const & | doc | ||
| ) |
Convenience function to setup fields for shapes.
Definition at line 414 of file SourceCluster.cc.
| std::vector<lsst::afw::table::SourceCatalog> const lsst::ap::cluster::cluster | ( | lsst::afw::table::SourceCatalog const & | sources, |
| ClusteringControl const & | control | ||
| ) |
Spatially cluster sources using the OPTICS algorithm. For details, see the following paper:
"OPTICS: Ordering Points To Identify the Clustering Structure". Mihael Ankerst, Markus M. Breunig, Hans-Peter Kriegel, Jorg Sander (1999). ACM SIGMOD international conference on Management of data. ACM Press. pp. 49-60.
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.129.6542 http://en.wikipedia.org/wiki/OPTICS_algorithm
| [in] | sources | Sources to cluster. |
| [in] | control | Clustering parameters. |
| std::vector<SourceCatalog> const lsst::ap::cluster::cluster | ( | SourceCatalog const & | sources, |
| ClusteringControl const & | control | ||
| ) |
Definition at line 578 of file clustering.cc.
| boost::shared_ptr<std::vector<SourceAndExposure> > const lsst::ap::cluster::computeBasicAttributes | ( | SourceClusterRecord & | cluster, |
| lsst::afw::table::SourceCatalog const & | sources, | ||
| lsst::ap::match::ExposureInfoMap const & | exposures, | ||
| std::string const & | exposurePrefix | ||
| ) |
Compute basic cluster attributes.
The Coord slot of cluster is set to the unweighted mean of the coordinates of the associated sources. This fiducial cluster position is used as the center of a N,E tangent plane projection that serves as a common coordinate system for averaging other measurements. Exposure information for each input source is looked up, and used to create a vector of tuples that bundle a source with it's originating exposure and an affine transform from the pixel space coordinate system centered on the source's centroid to the common coordinate system.
This vector of tuples is sorted such that sources originating from exposures in the same filter are all consecutive.
Finally, several other cluster attributes are computed/set:
| [out] | cluster | SourceClusterRecord to store results in. |
| [in] | sources | Sources in cluster. |
| [in] | exposures | Map from exposure ID to exposure information. |
| [in] | exposurePrefix | Exposure column name prefix. |
| boost::shared_ptr<std::vector<SourceAndExposure> > const lsst::ap::cluster::computeBasicAttributes | ( | SourceClusterRecord & | cluster, |
| SourceCatalog const & | sources, | ||
| ExposureInfoMap const & | exposures, | ||
| std::string const & | exposurePrefix | ||
| ) |
Definition at line 334 of file attributes.cc.
| void lsst::ap::cluster::computeFluxMean | ( | SourceClusterRecord & | cluster, |
| std::vector< SourceAndExposure > const & | sources, | ||
| std::string const & | fluxDef, | ||
| std::vector< lsst::afw::table::Key< lsst::afw::table::Flag > > const & | skipFlags, | ||
| double | fluxScale | ||
| ) |
Compute per-filter calibrated flux means for a cluster of sources.
The input source vector is assumed to be grouped by filter. Flux measurments and errors are obtained from fields named '<fluxDef>' and '<fluxDef>.err'. Results are stored in fields named '<filter>.<fluxDef>' and '<filter>.<fluxDef>.err', with a sample count stored in '<filter>.<fluxDef>.count' field. For an input source to be included in the mean, the following must hold:
If, after applying these filtering critera, 2 or more flux samples are available, then the inverse variance weighted mean of the samples (after calibration) is computed and stored. If only one sample is available, the input flux and error are calibrated and stored directly. If no samples are available, the output flux, error, and sample count fields are set to NaN, NaN, and 0.
| [out] | cluster | Cluster to store results in. |
| [in] | sources | List of sources and their exposures. |
| [in] | fluxDef | Name of flux field to operate on. |
| [in] | skipFlags | Flags marking sources to skip. |
| [in] | fluxScale | Flux scaling factor. |
| void lsst::ap::cluster::computeFluxMean | ( | SourceClusterRecord & | cluster, |
| std::vector< SourceAndExposure > const & | sources, | ||
| std::string const & | fluxDef, | ||
| std::vector< Key< Flag > > const & | skipFlags, | ||
| double | fluxScale | ||
| ) |
Definition at line 439 of file attributes.cc.
| void lsst::ap::cluster::computeShapeMean | ( | SourceClusterRecord & | cluster, |
| std::vector< SourceAndExposure > const & | sources, | ||
| std::string const & | shapeDef, | ||
| std::vector< lsst::afw::table::Key< lsst::afw::table::Flag > > const & | skipFlags | ||
| ) |
Compute per-filter shape means for a cluster.
The input source vector is assumed to be grouped by filter. Shape measurments and errors are obtained from fields named '<shapeDef>' and '<shapeDef>.err'. Results are stored in fields named '<filter>.<shapeDef>' and '<filter>.<shapeDef>.err', with a sample count stored in '<filter>.<shapeDef>.count' field. For an input source to be included in the mean, the following must hold:
If, after applying these filtering critera, 2 or more shape samples are available, then the inverse variance weighted mean of the samples (after transformation to a coordinate system S centered on the cluster position with the standard N,E basis) is computed and stored. If only one sample is available, the input shape and error are transformed to S and stored directly. If no samples are available, the output moments and covariance matrix are set to NaNs, and the sample count is zeroed.
| [out] | cluster | Cluster to store results in. |
| [in] | sources | List of sources and their exposures. |
| [in] | shapeDef | Name of shape field to operate on. |
| [in] | skipFlags | Flags marking sources to skip. |
Definition at line 535 of file attributes.cc.
| std::pair< boost::shared_ptr< lsst::afw::table::SourceTable >, lsst::afw::table::SchemaMapper > const lsst::ap::cluster::makeOutputSourceTable | ( | lsst::afw::table::SourceTable const & | prototype, |
| SourceProcessingControl const & | control | ||
| ) |
Create an output source table based on a prototypical input source table.
The schema and slot mappings from the input table are used as is, and exposure
related fields, required for database ingestion / clustering, are added.
In particular, the following additions are performed:
- "coord.err" (CovPointD) : Source sky-coordinate error
- "<exposure>.id" (L) : ID of exposure source was measured on.
i * - "<cluster>.id" (L) : ID of cluster containing source.
If the control.multiBand config parameter is false:
If the control.coadd config parameter is false:
"<exposure>" and "<cluster>" are field name prefixes obtained from SourceProcessingControl. If either prefix is empty, the corresponding fields will not be added. Note however that the exposure related fields are necessary for attribute computation and database ingest into the LSST schema. The cluster related fields are required only for database ingest.
| [in] | prototype | Prototypical schema/slot mappings. |
| [in] | control | Source processing parameters. |
Definition at line 135 of file clustering.cc.
| boost::shared_ptr<SourceClusterTable> const lsst::ap::cluster::makeSourceClusterTable | ( | lsst::afw::table::SourceTable const & | prototype, |
| boost::shared_ptr< lsst::afw::table::IdFactory > const & | idFactory, | ||
| SourceProcessingControl const & | control | ||
| ) |
Create a source cluster table based on a prototypical input source table. The names of flux/shape fields from SourceProcessingControl which correspond to fields in the prototype are used to create flux/shape fields for every filter that has been defined via the lsst::afw::image::Filter API. Slots from the prototype are used to setup corresponding filter specific slots in the source cluster table.
Note that filters are typically defined by the data butler's mapper class (see e.g. the obs_lsstSim package). The names of flux/shape fields in the cluster schema are prefixed with filter names - for example, if the PSF flux slot in the prototype is mapped to a field named "flux.naive" and filters "u" and "g" are defined, then the cluster schema will contain fields "u.flux.naive" and "g.flux.naive", with filter specific PSF flux slots mapped accordingly.
The following additional fields will be created (names not configurable at the moment):
- "id" (L) : cluster ID (from minimal schema) - "coord" (Coord) : mean sky-coordinates (from minimal schema) - "coord.err" (CovPointD) : uncertainty of coord - "obs.count" (I) : number of sources in cluster - "flag.noise" (Flag) : was cluster created from a single noise source? - "<filter>.obs.count" (I) : numer of sources in a specific filter
If the input table has valid centroid and centroid error slot keys, then the following fields are added:
- "coord.weightedmean" (Coord) : inverse variance weighted mean sky-coordinates - "coord.weightedmean.err" (CovPointD) : covariance matrix for coord.weighted - "coord.weightedmean.count" (I) : number of samples included in "coord.weighted"
Finally, if the "<exposure>.time.mid" field exists in the input table, then:
- "obs.time.min" (D) : earliest observation time of sources in cluster - "obs.time.mean" (D) : mean observation time of sources in cluster - "obs.time.max" (D) : latest observation time of sources in cluster - "<filter>.obs.time.min" (D) : earliest observation time in a specific filter - "<filter>.obs.time.max" (D) : latest observation time in a specific filter
are added (where the "<exposure>" prefix is obtained from SourceProcessingControl).
| [in] | prototype | Prototypical schema/slot mappings. |
| [in] | idFactory | ID generator. |
| [in] | control | Source processing parameters. |
| boost::shared_ptr<SourceClusterTable> const lsst::ap::cluster::makeSourceClusterTable | ( | SourceTable const & | prototype, |
| boost::shared_ptr< IdFactory > const & | idFactory, | ||
| SourceProcessingControl const & | control | ||
| ) |
Definition at line 197 of file clustering.cc.
| void lsst::ap::cluster::processSources | ( | lsst::afw::table::SourceCatalog const & | expSources, |
| lsst::ap::match::ExposureInfo const & | expInfo, | ||
| lsst::ap::utils::PT1SkyTile const * | skyTile, | ||
| SourceProcessingControl const & | control, | ||
| lsst::afw::table::SchemaMapper const & | mapper, | ||
| lsst::afw::table::SourceCatalog & | sources, | ||
| lsst::afw::table::SourceCatalog & | badSources, | ||
| lsst::afw::table::SourceCatalog & | invalidSources | ||
| ) |
Process input sourcees, distributing them to one of 3 output catalogs.
Sources not lying in the given sky-tile are discarded. Note that one can pass in a NULL sky-tile pointer, in which case no sources are discarded.
Existing fields in the input sources are modified as follows:
The output catalogs will typically have been constructed from tables obtained via makeOutputSourceTable() - their schemas and slot mappings must all be identical. The input table slots must match output table slots, and the input schema must be fully contained in the output schema.
| [in] | expSources | Single exposure sources to process. |
| [in] | expInfo | Exposure information. |
| [in] | skyTile | Sky-tile being processed - may be NULL. |
| [in] | control | Source processing parameters. |
| [in] | mapper | Maps between input and output source records. |
| [out] | sources | Catalog for sources that will be clustered. |
| [out] | badSources | Catalog for sources with bad measurement flags. |
| [out] | invalidSources | Catalog for sources with invalid measurements. |
| void lsst::ap::cluster::processSources | ( | SourceCatalog const & | expSources, |
| ExposureInfo const & | expInfo, | ||
| lsst::ap::utils::PT1SkyTile const * | skyTile, | ||
| SourceProcessingControl const & | control, | ||
| SchemaMapper const & | mapper, | ||
| SourceCatalog & | sources, | ||
| SourceCatalog & | badSources, | ||
| SourceCatalog & | invalidSources | ||
| ) |
Definition at line 375 of file clustering.cc.
| void lsst::ap::cluster::setClusterFields | ( | lsst::afw::table::SourceCatalog & | sources, |
| SourceClusterRecord const & | record, | ||
| SourceProcessingControl const & | control | ||
| ) |
Set the "<cluster>.id" and "<cluster>.coord" fields of each source in the given catalog to the ID and sky-coordinates of the given cluster. The "<cluster>" field name prefix is obtained from SourceProcessingControl. If those fields are not setup in the given catalog, this function is a no-op.
This is intended to support database ingest via qserv, where sources are partitioned by their associated astrophysical object, and objects (for which clusters are a temporary stand-in) are partitioned by position. Denormalizing the output source schema by appending cluster position avoids a potentially very expensive join during database ingest.
| [out] | sources | Sources to update. |
| [in] | record | Cluster to obtain ID/sky-coordinates from. |
| [in] | control | Supplies cluster field name prefix. |
| void lsst::ap::cluster::setClusterFields | ( | SourceCatalog & | sources, |
| SourceClusterRecord const & | record, | ||
| SourceProcessingControl const & | control | ||
| ) |
Definition at line 615 of file clustering.cc.
1.8.5