Models API Reference#

Documentation Verified Last checked: 2025-11-25 Reviewer: Christof Buchbender

This page provides the complete Python API reference for all SQLAlchemy models in ops-db.

For conceptual explanations of these models, see:

Complete Model Documentation#

class ccat_ops_db.models.LocationType(value)[source]#

Bases: Enum

Location type enum

The location type determines the role of the location in the data transfer system.

SOURCE: Telescope instrument computers BUFFER: Input/transit buffers LONG_TERM_ARCHIVE: Permanent storage PROCESSING: Temporary processing areas

SOURCE = 'source'#
BUFFER = 'buffer'#
LONG_TERM_ARCHIVE = 'long_term_archive'#
PROCESSING = 'processing'#
class ccat_ops_db.models.StorageType(value)[source]#

Bases: Enum

Storage type enum

The storage type determines the physical storage medium of the location.

DISK: Traditional disk storage S3: Object storage (AWS S3 or compatible) TAPE: Tape-based archival storage

DISK = 'disk'#
S3 = 's3'#
TAPE = 'tape'#
class ccat_ops_db.models.RouteType(value)[source]#

Bases: Enum

Route type enum

The route type determines the route of the data transfer.

DIRECT: RELAY: Route through intermediate site CUSTOM: Custom location-to-location override

DIRECT = 'direct'#
RELAY = 'relay'#
CUSTOM = 'custom'#
class ccat_ops_db.models.Status(value)[source]#

Bases: Enum

Status enum

These Status labels are used to make the Status checks uniform accross the entire data transfer system.

These are used accros many concepts such as RawDataPackage, DataTransferPackage, DataTransfer, etc.

PENDING: Is used to mark a concept as waiting for execution e.g. a RawDataPackage in PENDING will be scheduled to be build. SCHEDULED: Marks a concept as scheduled for execution e.g. a RawDataPackage in IN_PROGRESS: Marks that a celery job is working on this concept. COMPLETED: Succesfully completed the concept. FAILED: Failed to execute the concept.

PENDING = 'pending'#
SCHEDULED = 'scheduled'#
IN_PROGRESS = 'in_progress'#
COMPLETED = 'completed'#
FAILED = 'failed'#
class ccat_ops_db.models.PackageState(value)[source]#

Bases: Enum

Package state enum

The package state determines the state of the package.

WAITING: Waiting for transfer TRANSFERRING: Transferring ARCHIVED: Archived FAILED: Failed

WAITING = 'waiting'#
TRANSFERRING = 'transferring'#
ARCHIVED = 'archived'#
FAILED = 'failed'#
class ccat_ops_db.models.PhysicalCopyStatus(value)[source]#

Bases: Enum

An enumeration.

PRESENT = 'present'#
STAGED = 'staged'#
DELETION_POSSIBLE = 'deletion_possible'#
DELETION_PENDING = 'deletion_pending'#
DELETION_SCHEDULED = 'deletion_scheduled'#
DELETION_IN_PROGRESS = 'deletion_in_progress'#
DELETION_FAILED = 'deletion_failed'#
DELETED = 'deleted'#
class ccat_ops_db.models.Site(**kwargs)[source]#

Bases: Base

Represents a physical or logical site where data can be stored or processed.

id#
name#
short_name#
site_location#
long_term_archive_transfers#
locations#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DataLocation(**kwargs)[source]#

Bases: Base

Base class for all data storage locations with polymorphic storage types.

id#
name#
location_type#
site_id#
site#
active#
priority#
storage_type#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DiskDataLocation(**kwargs)[source]#

Bases: DataLocation

Disk-based storage location.

id#
path#
host#
user#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

active#
location_type#
name#
priority#
site#
site_id#
storage_type#
class ccat_ops_db.models.S3DataLocation(**kwargs)[source]#

Bases: DataLocation

S3-compatible object storage location.

id#
bucket_name#
region#
endpoint_url#
get_s3_credentials(site_name: str) tuple[str, str][source]#

Get S3 credentials from environment variables using the pattern: {Site.name}_{DataLocation.name}_S3_ACCESS_KEY_ID {Site.name}_{DataLocation.name}_S3_SECRET_ACCESS_KEY

Examples

Cologne site, long_term_archive location:

COLOGNE_LONG_TERM_ARCHIVE_S3_ACCESS_KEY_ID=your_access_key
COLOGNE_LONG_TERM_ARCHIVE_S3_SECRET_ACCESS_KEY=your_secret_key

US site, long_term_archive location:

US_LONG_TERM_ARCHIVE_S3_ACCESS_KEY_ID=your_access_key
US_LONG_TERM_ARCHIVE_S3_SECRET_ACCESS_KEY=your_secret_key
Parameters:

site_name (str) – Name of the site

Returns:

(access_key_id, secret_access_key)

Return type:

tuple[str, str]

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

active#
location_type#
name#
priority#
site#
site_id#
storage_type#
class ccat_ops_db.models.TapeDataLocation(**kwargs)[source]#

Bases: DataLocation

Tape-based storage location.

id#
library_name#
mount_path#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

active#
location_type#
name#
priority#
site#
site_id#
storage_type#
class ccat_ops_db.models.ObservingProgram(**kwargs)[source]#

Bases: Base

id#
name#
short_name#
description#
lead_id#
lead#
sub_observing_programs#
instruments#
obs_units#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.SubObservingProgram(**kwargs)[source]#

Bases: Base

id#
name#
short_name#
description#
observing_program_id#
observing_program#
obs_units#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.Source(**kwargs)[source]#

Bases: Base

A source is a celestial object

This class serves as a base class for various types of sources. It is a polymorphic class in SQLAlchemy, not instantiated directly, but used to provide common attributes. Subclasses, implemented as separate database tables, inherit from the source class and can have additional specific attributes.

See classes that are based on this class for more information on the implemented types of sources.

id#
name#

The name of the source

type#

The polymorphic identity

obs_units#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.FixedSource(**kwargs)[source]#

Bases: Source

A source that has a fixed coordinates

This class is a subclass of the Source class and inherits all attributes from the Source class.

The class implements the skycoord property that returns a SkyCoord object from the ra_deg and dec_deg columns.

id#
ra_deg#

The right ascension in degrees (ICRS)

dec_deg#

The declination in degrees (ICRS)

slam#

Longitude string of the original input

sbet#

Latitude string of the original input

vlsr#

The local standard of rest velocity in km/s

frame#

The frame of the coordinates of the original input

property skycoord#

Return a SkyCoord object from the ra_deg and dec_deg columns

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name#

The name of the source

obs_units#
type#

The polymorphic identity

class ccat_ops_db.models.SolarSystemObject(**kwargs)[source]#

Bases: Source

A source that is a solar system object

This class is a subclass of the Source class and inherits all attributes from the Source class.

id#
eph_name#

Standard ephemeris name of the source

naif_id#

The NAIF ID of the source

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name#

The name of the source

obs_units#
type#

The polymorphic identity

class ccat_ops_db.models.ConstantElevationSource(**kwargs)[source]#

Bases: Source

A source that is observed at a constant elevation

This class is a subclass of the Source class and inherits all attributes from the Source class.

id#
ra_deg_min#

The minimum right ascension of the area in degrees

ra_deg_max#

The maximum right ascension of the area in degrees

dec_deg_min#

The minimum declination of the area in degrees

dec_deg_max#

The maximum declination of the area in degrees

slam_min#

The minimum longitude string of the original input

slam_max#

The maximum longitude string of the original input

sbet_min#

The minimum latitude string of the original input

sbet_max#

The maximum latitude string of the original input

vlsr#

The local standard of rest velocity in km/s

frame#

The frame of the coordinates of the original input

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name#

The name of the source

obs_units#
type#

The polymorphic identity

class ccat_ops_db.models.Line(**kwargs)[source]#

Bases: Base

A spectral line that is observed by an instrument

id#
name#

The name of the spectral line

rest_frequency#

The rest frequency of the line

side_band#

The side band of the line

available#
comment#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.Observatory(**kwargs)[source]#

Bases: Base

id#
name#
description#
telescopes#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.Telescope(**kwargs)[source]#

Bases: Base

id#
name#
description#
lon_deg#
lat_deg#
alt_m#
instruments#
observatory_id#
observatory#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.Instrument(**kwargs)[source]#

Bases: Base

id#
name#
instrument_type#
description#
telescope_id#
telescope#
modules#
observing_programs#
available#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.InstrumentModule(**kwargs)[source]#

Bases: Base

id#
name#
description#
pixels#
instrument_id#
instrument#
instrument_module_configurations#
available#
raw_data_packages#
raw_data_files#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.InstrumentModuleConfiguration(**kwargs)[source]#

Bases: Base

id#
type#
instrument_module_id#
instrument_module#
raw_data_files#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ChaiModuleConfiguration(**kwargs)[source]#

Bases: InstrumentModuleConfiguration

id#
line_id#
line#
config_parameters#

List of instrument configuration parameters

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

instrument_module#
instrument_module_id#
raw_data_files#
type#
class ccat_ops_db.models.PrimeCamModuleConfiguration(**kwargs)[source]#

Bases: InstrumentModuleConfiguration

id#
config_parameters#

List of instrument configuration parameters

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

instrument_module#
instrument_module_id#
raw_data_files#
type#
class ccat_ops_db.models.ObservationConfiguration(**kwargs)[source]#

Bases: Base

id#
type#
obs_units#
azimuth_range#

Azimuth range lookup table for constant elevation scans

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ChaiObservationConfiguration(**kwargs)[source]#

Bases: ObservationConfiguration

id#
chai_tilings#
ntilelines#

Number of tile lines to be grouped (for socring in scheduler)

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

azimuth_range#

Azimuth range lookup table for constant elevation scans

obs_units#
type#
class ccat_ops_db.models.PrimeCamObservationConfiguration(**kwargs)[source]#

Bases: ObservationConfiguration

id#
version#
history#
mapping_parameters#

List of mapping parameters

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

azimuth_range#

Azimuth range lookup table for constant elevation scans

obs_units#
type#
class ccat_ops_db.models.ObsMode(**kwargs)[source]#

Bases: Base

id#
name#
description#
obs_units#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ObsUnit(**kwargs)[source]#

Bases: Base

id#
name#
version#
history#
phase#

CM=commissioning BS=baseline science etc.

group#
group_type#
equal_tolerance#

Tolerance of inbalanced schedule when group_type is equal

min_alt#
max_alt#
min_rotang#
max_rotang#
nominal_alt#
min_lsa#
max_lsa#
lsa_margin#
cadence#
requested_time_h#
unit_duration_h#
max_distance_in_map#
trans_ref#

Reference transmission

priorities#
available#

Whether this ObsUnit is ready to be scheduled

pre_scheduled_basis#

Whether this Obsunit is executed on pre-scheduled basis, meaning that it has a very low priority outside of the pre-scheduled slots.

additional_parameters#

Any special parameters or constraints to be stored

source_id#
source#
observing_program_id#
observing_program#
sub_observing_program_id#
sub_observing_program#
obs_mode_id#
obs_mode#
primary_instrument_module_configuration_id#
primary_instrument_module_configuration#
instrument_module_configurations#
observation_configuration_id#
observation_configuration#
executed_obs_units#
pre_scheduled_slots#
raw_data_files#
raw_data_packages#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.PreScheduledSlot(**kwargs)[source]#

Bases: Base

id#
start_time#
end_time#
obs_unit_id#
obs_unit#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ExecutedObsUnit(**kwargs)[source]#

Bases: Base

id#
start_time#
end_time#
status#

running/success/interruped/unusable/…

mean_pwv#
mean_elevation#
obs_unit_id#
obs_unit#
obs_info#

Static ancillary infomation (e.g. ObsUnit version, tiling ID for CHAI)

obs_progress#

Field for progress tracking

raw_data_packages#
raw_data_files#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ChaiTiling(**kwargs)[source]#

Bases: Base

id#
version#
history#
priority_in_tiling#
tile_id#
tile_offset_x#
tile_offset_y#
x_or_y#
tile_unit_scaling_x#
tile_unit_scaling_y#
edge#
goal_ncycle#
chai_observation_configuration_id#
chai_observation_configuration#
chai_inpar_parameter_id#
chai_inpar_parameter#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ChaiInparParameter(**kwargs)[source]#

Bases: Base

id#
name#
version#
history#
chai_tilings#
lam#

Map center offset in longitude [arcsec]

bet#

Map center offset in latitude [arcsec]

cormap#

Map cood. system

line_range#

v,-10:10:v”)

Type:

Range of velocities [km/s] affected by lines (e.g. “-70

Type:

-30

goal_resolution#

Spectral resolution [km/s] with which the scientific analysis will be done

refname#

Reference name when using the absolute positions. Set NAN to use relative

refoffl#

Reference position relative to on in longitude [arcsec]

refoffb#

Reference position relative to on in latitude [arcesc]

corref#

Reference cood. system

mode#

Observing mode; otfl or otfb

otfpattern#

OTF pattern file name specified in kosma_software

ton#

On integration time [sec]

toff#

Forced off time [s] (-1 to use the default calculation = default)

repetition#

Repetition number

offononoff#

Sequence of OFF and ON (1 = OFF-ON-ON-OFF (default), 0 = OFF-ON)

stepl#

Step size in longitude [arcsec]

stepb#

Step size in latitude [arcsec]

mapsizel#

Size of map in longitude [arcsec]

mapsizeb#

Size of map in latitude [arcsec]

nmapl#

number of raster positions along longitude

nmapb#

number of raster positions along latitude

mapangle#

Position angle of the map (counter-clock) [degree]

crosssizel#

Size of cross in longitude [arcsec]

crosssizeb#

Size of cross in latitude [arcsec]

reverseflg#

0 = (+x,+y), 1 = (-x,-y), 2 = (-x,+x,-y,+y)

Type:

OTF scan direction in cross

scan_dir#

OTF scan direction (1 is +x or +y, -1 is -x or -y)

scan_order#

Order of OTF lines (1 is +x or +y, -1 is -x or -y)

evendump#

If 1 allow even number of dump positions without hitting the center. Default = 0

novertical#

If 1 skip the second (vertical) scan for cross observations. Default = 0

pointingflg#

Flag to indicate that it is a pointing session. Default = 0

offperload#

Define how many off for one load measurment

onperload#

Define how many on positions for one load measurement

repperload#

Define how many repetition for one load measurment

lineperoff#

Define how many otf scan lines for one off measurement

onperoff#

Define how many on positions for one off measurement

offperpattern#

Define how many off measurement per pattern

refpoint#

Reference point (as is used in setpoint)

act_pixflg#

Flag to use the actual pixel position of refpoint. Default = 0

nextflg#

If Y, enable telescope moving when writing data. Default = N

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.Role(**kwargs)[source]#

Bases: Base

id#
name#
description#
github_team_mappings#

GitHub teams that map to this role

permissions#

List of permissions granted to this role

users#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.User(**kwargs)[source]#

Bases: Base

id#
email#
username#
first_name#
last_name#
title#
affiliation#
password#
github_id#

GitHub user ID

github_username#

GitHub username

preferences#

User preferences and settings

roles#
last_login_at#
current_login_at#
last_login_ip#
current_login_ip#
login_count#
active#
confirmed_at#
observing_programs#
api_tokens#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.ApiToken(**kwargs)[source]#

Bases: Base

API tokens for programmatic access to the API

id#
user_id#
user#
name#

Human-readable name for the token

token_hash#

Hashed token value

token_prefix#

First few characters for identification

scopes#

List of permission scopes for this token

created_at#
expires_at#

Token expiration time

last_used_at#

Last time token was used

active#

Whether token is active

usage_count#

Number of times token was used

last_used_ip#

IP address of last usage

is_expired()[source]#

Check if token is expired

is_valid()[source]#

Check if token is valid (active and not expired)

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DataTransferRoute(**kwargs)[source]#

Bases: Base

Defines routes for data transfer between sites and locations.

The database implements a flexible routing system that supports: 1. Direct routes between specific locations 2. Relay routes through intermediate sites 3. Custom location-to-location overrides

id#
name#
origin_site_id#
origin_site#
destination_site_id#
destination_site#
route_type#
transfer_method#
origin_location_id#
origin_location#
destination_location_id#
destination_location#
relay_site_id#
relay_site#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.RawDataFile(**kwargs)[source]#

Bases: Base

Represents a raw data file from an instrument.

id#
name#
relative_path#
obs_unit_id#
obs_unit#
created_at#
instrument_module_id#
instrument_module#
instrument_module_configuration_id#
instrument_module_configuration#
file_type#
size#
checksum#
description#
source_location_id#
source_location#
raw_data_package_id#
raw_data_package#
data_transfer_package_id#
data_transfer_package#
executed_obs_unit_id#
executed_obs_unit#
state#
physical_copies#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.RawDataPackageMetadata(**kwargs)[source]#

Bases: Base

Model for storing additional metadata for raw data packages.

This table stores metadata that is not part of the core database models but is needed for IVOA-compatible metadata generation. It includes: - Instrument-specific parameters - Additional quality metrics - Extended provenance information - Custom metadata fields

id#
raw_data_package_id#
created_at#
updated_at#
instrument_specific#
quality_metrics#
provenance#
custom_metadata#
raw_data_package#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.RawDataPackage(**kwargs)[source]#

Bases: Base

A raw data package is a bundle of raw data files that were observed in an observation unit. But they should never be larger than 50GB in size.

id#
name#
relative_path#

This is the relative path to the raw data package. The absolute path of the location of this file for each archive is stored in the DataLocation table. The path is relative to the raw_data_path of the DataLocation.

size#
executed_obs_unit_id#
executed_obs_unit#
instrument_module_id#
instrument_module#
obs_unit_id#
obs_unit#
created_at#
checksum#
raw_data_files#
data_transfer_package_id#
data_transfer_package#
long_term_archive_transfers#
analyze_status#
physical_copies#
package_metadata#
status#
state#
staging_jobs#
retry_count#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DataTransferPackage(**kwargs)[source]#

Bases: Base

id#
hash_id#
file_name#
size#
checksum#
relative_path#
origin_location_id#
origin_location#
raw_data_files#
raw_data_packages#
data_transfers#
status#
failure_error_message#
physical_copies#
retry_count#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DataTransfer(**kwargs)[source]#

Bases: Base

Tracks data transfers between locations.

id#
process_id#
retry_count#
start_time#
end_time#
data_transfer_method#
status#
failure_error_message#
transfer_program_log#
origin_location_id#
origin_location#
destination_location_id#
destination_location#
data_transfer_package_id#
data_transfer_package#
unpack_status#
unpack_failure_error_message#
unpack_start_time#
unpack_end_time#
unpack_log#
unpack_retry_count#
logs#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.SystemLog(**kwargs)[source]#

Bases: Base

id#
type#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.DataTransferLog(**kwargs)[source]#

Bases: SystemLog

Log entries for data transfers with references to log files.

This model implements a lightweight approach where: - Basic status info and log file path are stored in the database - Full command outputs are stored in files - Detailed metrics are stored in InfluxDB

id#
data_transfer_id#
data_transfer#
timestamp#
status#

Status of this transfer attempt (success/failure)

log_path#

Path to file containing full command output

property content: str | None#

Read and return the full log content if file exists.

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

type#
class ccat_ops_db.models.DataArchive(**kwargs)[source]#

Bases: Base

id#
name#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.PhysicalCopy(**kwargs)[source]#

Bases: Base

Base class for tracking physical copies of files across different storage locations.

This class implements a polymorphic pattern to track physical copies of different types of files (RawDataFile, RawDataPackage, DataTransferPackage) across different storage locations and types. Each physical copy represents an actual file on disk or other storage medium.

id#
type#
data_location_id#
data_location#
created_at#
verified_at#
status#
checksum#
deletion_task_id#
deleted_at#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.RawDataFilePhysicalCopy(**kwargs)[source]#

Bases: PhysicalCopy

Tracks physical copies of individual raw data files.

id#
raw_data_file_id#
raw_data_file#
property full_path#

Get the full path/S3 key for this physical copy.

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

checksum#
created_at#
data_location#
data_location_id#
deleted_at#
deletion_task_id#
status#
type#
verified_at#
class ccat_ops_db.models.RawDataPackagePhysicalCopy(**kwargs)[source]#

Bases: PhysicalCopy

Tracks physical copies of raw data packages.

id#
raw_data_package_id#
raw_data_package#
property full_path#

Get the full path/S3 key for this physical copy.

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

checksum#
created_at#
data_location#
data_location_id#
deleted_at#
deletion_task_id#
status#
type#
verified_at#
class ccat_ops_db.models.DataTransferPackagePhysicalCopy(**kwargs)[source]#

Bases: PhysicalCopy

Tracks physical copies of data transfer packages.

id#
data_transfer_package_id#
data_transfer_package#
property full_path#

Get the full path/S3 key for this physical copy.

__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

checksum#
created_at#
data_location#
data_location_id#
deleted_at#
deletion_task_id#
status#
type#
verified_at#
class ccat_ops_db.models.LongTermArchiveTransfer(**kwargs)[source]#

Bases: Base

id#
site_id#
site#
origin_data_location_id#
origin_data_location#
destination_data_location_id#
destination_data_location#
raw_data_package_id#
raw_data_package#
logs#
status#
failure_error_message#
start_time#
end_time#
attempt_count#
last_attempt_time#
error_message#
requires_intervention#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.LongTermArchiveTransferLog(**kwargs)[source]#

Bases: SystemLog

id#
long_term_archive_transfer_id#
long_term_archive_transfer#
log#
timestamp#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

type#
class ccat_ops_db.models.StagingJob(**kwargs)[source]#

Bases: Base

id#
status#
failure_error_message#
start_time#
active#
end_time#
retry_count#
raw_data_packages#
logs#
origin_data_location_id#
origin_data_location#
destination_data_location_id#
destination_data_location#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class ccat_ops_db.models.StagingJobLog(**kwargs)[source]#

Bases: SystemLog

id#
staging_job_id#
staging_job#
log#
timestamp#
__init__(**kwargs)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

type#