autowisp.database.provenance_resolver module

Class Inheritance Diagram

Inheritance diagram of Camera, EarthLocation, Mount, Observatory, Observer, ObservingSession, PipelineError, SkyCoord, Target, Telescope, Time, timedelta

Resolve FITS-header provenance to ORM rows shared by the survey database.

Both the DB-backed pipeline (via autowisp.processing_steps.add_images_to_db) and the manual / individual-step CLI need to match FITS headers against the survey provenance tables (Camera, Telescope, Mount, Observatory, Observer, Target) and resolve the corresponding ObservingSession row. This module centralises that logic so both processing paths use the same header-expression flag set and the same get-or-create semantics, producing a /Provenance group that is byte-identical between manual and DB-backed runs.

The helpers here intentionally do not create any Image rows – that remains the responsibility of add_images_to_db.

autowisp.database.provenance_resolver._match_observatory(db_observatory, image_location)[source]

True iff the observatory matches the image location.

autowisp.database.provenance_resolver.get_observatory(header_eval, configuration, db_session)[source]

Return the observatory corresponding to the image (must exist).

autowisp.database.provenance_resolver.get_or_create_observing_session(image_type, header_eval, configuration, db_session)[source]

Return the observing session the image is part of (create if needed).

autowisp.database.provenance_resolver.get_or_create_target(image_type, header_eval, configuration, db_session, field_of_view)[source]

Return the target corresponding to the image (create if necessary).