FilterDefinitionCollection

class lsst.obs.base.FilterDefinitionCollection(*filters)

Bases: Sequence

An order-preserving collection of multiple FilterDefinition.

Parameters:
filtersSequence

The filters in this collection.

Attributes Summary

physical_to_band

A mapping from physical filter name to band name.

Methods Summary

count(value)

defineFilters()

Define all the filters to lsst.afw.image.Filter.

findAll(name)

Return the FilterDefinitions that match a particular name.

index(value, [start, [stop]])

Raises ValueError if the value is not present.

reset()

Reset the afw Filter definitions and clear the defined singleton.

Attributes Documentation

physical_to_band = {}

A mapping from physical filter name to band name. This is a convenience feature to allow file readers to create a FilterLabel when reading a raw file that only has a physical filter name, without iterating over the entire collection.

Methods Documentation

count(value) integer -- return number of occurrences of value
defineFilters()

Define all the filters to lsst.afw.image.Filter.

Filter objects are singletons, so we protect against filters being defined multiple times.

Raises:
RuntimeError

Raised if any other FilterDefinitionCollection has already called defineFilters.

findAll(name)

Return the FilterDefinitions that match a particular name.

This method makes no attempt to prioritize, e.g., band names over physical filter names; any definition that makes any reference to the name is returned.

Parameters:
namestr

The name to search for. May be any band, physical, or alias name.

Returns:
matchesset [FilterDefinition]

All FilterDefinitions containing name as one of their filter names.

index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

classmethod reset()

Reset the afw Filter definitions and clear the defined singleton. Use this in unittests that define different filters.