Skip to content

Models API Reference

Documentation for the scheduler module models. For TOM Toolkit models (Target, ObservationRecord, etc.) see the official TOM Toolkit documentation.

SchedulingProfile

from scheduler.models import SchedulingProfile

Scheduling profile associated with a target (1:1 relationship).

Fields

Field Type Default Description
target OneToOneField(Target) — Associated target
category CharField STANDARD Scheduling category
priority FloatField 1.0 Urgency multiplier
is_active BooleanField True Include in scheduler
facility ForeignKey(FacilitySettings, null=True) None Assigned telescope
min_altitude FloatField 30.0 Minimum altitude (°)
max_airmass FloatField 2.5 Maximum airmass
min_seeing FloatField 0.6 Minimum seeing (")
min_moon_distance FloatField 20.0 Minimum lunar separation (°)
max_moon_illumination FloatField 0.85 Maximum lunar illumination [0,1]
night_type CharField dm Required night type
transparency_type CharField dm Required transparency
transit_start DateTimeField(null=True) None Transit start (PERIODIC)
transit_end DateTimeField(null=True) None Transit end (PERIODIC)
fade_date DateTimeField(null=True) None Fade-out date (TRANSIENT)
last_scheduled DateTimeField(null=True) None Last scheduled time

Validation

The clean() method validates: - PERIODIC: requires transit_start and transit_end. - TRANSIENT: recommends fade_date.


ObservationFrames

from scheduler.models import ObservationFrames

Defines the exposure sequence for a target.

Fields

Field Type Default Description
scheduling_profile ForeignKey(SchedulingProfile) — Parent profile
filter_name CharField — Filter name
exposure_time FloatField 60.0 Exposure duration (s)
repetitions PositiveIntegerField 1 Number of exposures
dithering_enabled BooleanField False Enable dithering
ra_offset FloatField 0.0 RA offset in arcsec
dec_offset FloatField 0.0 Dec offset in arcsec

FacilitySettings

from scheduler.models import FacilitySettings

Represents a physical telescope with its control parameters.

Fields

Field Type Description
name CharField(unique=True) Telescope name
manager ForeignKey(User) Responsible user
description TextField Free-text description
is_public BooleanField Visible to all users
shared_with ManyToManyField(Group) Groups with access
latitude FloatField Observatory latitude (−90 to 90)
longitude FloatField Observatory longitude (−180 to 180)
elevation FloatField Elevation (m)
slew_rate FloatField Slew speed (°/s)
settle_time FloatField Settle time after slew (s)
readout_overhead FloatField Readout overhead per frame (s)
horizon_limit FloatField Horizon limit (°)
limiting_magnitude FloatField Limiting magnitude
ascom_enabled BooleanField Use ASCOM control
ascom_driver CharField ASCOM driver ProgID

ScheduledWindow

from scheduler.models import ScheduledWindow

Observation window generated by the scheduler.

Fields

Field Type Description
target ForeignKey(Target) Scheduled target
scheduling_profile ForeignKey(SchedulingProfile) Profile used
facility ForeignKey(FacilitySettings) Telescope
observation_block ForeignKey(ObservationBlock, null=True) Parent block
start_time DateTimeField Window start
end_time DateTimeField Window end
score FloatField Computed score
visibility_curve JSONField Pre-computed altitude curve
created_at DateTimeField(auto_now_add=True) Creation timestamp

ObservationBlock

from scheduler.models import ObservationBlock

Groups multiple targets for joint observation.

Fields

Field Type Description
number PositiveIntegerField(unique=True) Auto-assigned sequential number
project_name CharField(blank=True) Project name
profiles ManyToManyField(SchedulingProfile) Block members
is_active BooleanField Active in the scheduler
created_at DateTimeField Creation timestamp

Methods

  • next_number() — Returns the next available sequential number.

NightObservationWindow

from scheduler.models import NightObservationWindow

Stores the astronomical night boundaries (−18° twilight).

Fields

Field Type Description
date DateField(unique=True) Night date
start_time DateTimeField Astronomical twilight start
end_time DateTimeField Astronomical twilight end