ImageSource

class toasty.pipeline.ImageSource[source]

Bases: abc.ABC

An abstract base class representing a source of images to be processed in the image-processing pipeline. An instance of this class might fetch images from an RSS feed or an AstroPix search.

Methods Summary

deserialize(data)

Create an instance of this class by deserializing configuration data.

get_config_key()

Get the name of the section key used for this source’s configuration data.

open_input(unique_id, cachedir)

Open an input image for processing.

query_candidates()

Generate a sequence of candidate input images that the pipeline may want to process.

Methods Documentation

abstract classmethod deserialize(data)[source]

Create an instance of this class by deserializing configuration data.

Parameters
datadict-like object

A dict-like object containing configuration items deserialized from a format such as JSON or YAML. The particular contents can vary depending on the implementation.

Returns
An instance of cls
abstract classmethod get_config_key()[source]

Get the name of the section key used for this source’s configuration data.

Returns
A string giving a key name usable in a YAML file.
abstract open_input(unique_id, cachedir)[source]

Open an input image for processing.

Parameters
unique_idstr

The unique ID returned by the CandidateInput instance that created the cached data for this input image.

cachedirstr

A path pointing to a local directory inside of which the source data were cached.

Returns
An instance of InputImage corresponding to the cached data.
abstract query_candidates()[source]

Generate a sequence of candidate input images that the pipeline may want to process.

Returns
A generator that yields a sequence of CandidateInput instances.