Scripts (pyobs.robotic.scripts)
A Script is the leaf of the robotic system — it contains the actual
observing logic. Scripts are pydantic models (not Module subclasses), so they
have no async lifecycle of their own. Instead, they receive runtime context (comm, vfs,
observer) injected at instantiation time, and they are created fresh for each task execution.
Writing a script
Subclass Script and implement two async methods:
import logging
from typing import TYPE_CHECKING
from pyobs.interfaces import ICamera, IPointingRaDec
from pyobs.robotic.scripts import Script
if TYPE_CHECKING:
from pyobs.robotic.task import TaskData
log = logging.getLogger(__name__)
class ObserveScript(Script):
camera: str = "camera"
telescope: str = "telescope"
exposure_time: float = 30.0
num_exposures: int = 1
async def can_run(self, data: TaskData | None) -> bool:
try:
await self.comm.proxy(self.camera, ICamera)
await self.comm.proxy(self.telescope, IPointingRaDec)
except ValueError:
return False
return True
async def run(self, data: TaskData | None) -> None:
if data is None or data.task.target is None:
raise ValueError("No target.")
camera = await self.comm.proxy(self.camera, ICamera)
telescope = await self.comm.proxy(self.telescope, IPointingRaDec)
from pyobs.utils.time import Time
target = data.task.target.coordinates(Time.now())
log.info("Moving telescope to %s...", data.task.target.name)
await telescope.move_radec(target.ra.deg, target.dec.deg)
for i in range(self.num_exposures):
log.info("Taking exposure %d/%d...", i + 1, self.num_exposures)
await camera.set_exposure_time(self.exposure_time)
await camera.grab_data(broadcast=True)
``can_run(data)`` is called by the scheduler before each scheduling cycle. Return False if
required hardware is offline or conditions are not met. The scheduler will exclude tasks whose
script returns False from the current slot.
``run(data)`` is called by the mastermind when the task’s scheduled time arrives. The
TaskData argument gives access to the current task, the
ObservationArchive, and the TaskArchive. Raise InterruptedError to signal that the
script was aborted cleanly.
The script is configured in the task YAML under the script key:
script:
class: myobs.scripts.ObserveScript
camera: camera
telescope: telescope
exposure_time: 60.0
num_exposures: 3
Runtime context
Scripts have access to the same runtime properties as Object via
PrivateAttrMixin:
self.comm—Commfor calling other modulesself.vfs—VirtualFileSystemfor file I/Oself.observer—Observerwith the observatory locationself.location—EarthLocationself.timezone—tzinfo
These are injected automatically when the script is created via
pyobs_model_validate(). They are never set during __init__ or
pydantic validation — they are only available when the script is instantiated at runtime from
within an Object context.
TaskData
TaskData is passed to both can_run and run. It is a simple
dataclass that bundles references to the relevant parts of the robotic system:
@dataclass
class TaskData:
task: Task
observation_archive: ObservationArchive | None = None
task_archive: TaskArchive | None = None
Most scripts only need data.task (for the target and duration). Scripts that need to record
results or look up task history can use data.observation_archive.
Script base class
- class Script(*, exptime_done: float = 0.0)[source]
Bases:
PolymorphicBaseModelCreate a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of this script in seconds.
- get_fits_headers(namespaces: list[str] | None = None) dict[str, FitsHeaderEntry][source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- exception ScriptError(message: str | None = None, **context: Any)[source]
Bases:
PyobsErrorA script failed while running – e.g. a proxy/network failure reaching a module it depends on. Deliberately a single flat type rather than per-script leaves; mint a more specific one only once a caller actually wants to distinguish a script’s failure modes.
Built-in scripts
Observing
- class ImagingScript(*, exptime_done: float = 0.0, configuration: ~pyobs.robotic.scripts.imaging.imaging.Configuration = <factory>, camera: ~typing.Annotated[str, ~pyobs.interfaces.ICamera, ~pyobs.interfaces.IBinning, ~pyobs.interfaces.IWindow, ~pyobs.interfaces.IExposureTime, ~pyobs.interfaces.IImageType], telescope: ~types.Annotated[str | None, ~pyobs.interfaces.ITelescope, ~pyobs.interfaces.IPointingRaDec] = None, filters: ~types.Annotated[str | None, ~pyobs.interfaces.IFilters] = None, autoguider: ~types.Annotated[str | None, ~pyobs.interfaces.IAutoGuiding] = None, acquisition: ~types.Annotated[str | None, ~pyobs.interfaces.IAcquisition] = None)[source]
Bases:
ScriptDefault script for imaging configs.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run.
- Returns:
True, if the script can run now
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate the duration of this script in seconds.
Uses real per-binning readout time, per-wheel filter-change time, and telescope slew rate wherever data.instrument_capabilities has a matching, populated row – falling back to today’s flat fudge constants at every point that’s missing (no data, no capabilities, no matching module, or the specific field not set on the matched row).
Two simplifications carried over from today’s flat constants, not new: the slew term is added unconditionally, even for a bias/dark-only sequence that never actually points at anything; and each actual filter transition costs one flat filter_change_time_s (the portal’s own one-position-step estimate) regardless of how many wheel positions that particular change actually spans.
- get_fits_headers(namespaces: list[str] | None = None) dict[str, FitsHeaderEntry][source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
The default script for science exposures: moves to the target, optionally acquires and
guides on it, then works through one or more instrument_configs (binning, window,
exposure time, filter, image type), each repeated count times, for repeats full
passes.
- class TransitImagingScript(*, exptime_done: float = 0.0, configuration: ~pyobs.robotic.scripts.imaging.imaging.Configuration = <factory>, camera: ~typing.Annotated[str, ~pyobs.interfaces.ICamera, ~pyobs.interfaces.IBinning, ~pyobs.interfaces.IWindow, ~pyobs.interfaces.IExposureTime, ~pyobs.interfaces.IImageType], telescope: ~types.Annotated[str | None, ~pyobs.interfaces.ITelescope, ~pyobs.interfaces.IPointingRaDec] = None, filters: ~types.Annotated[str | None, ~pyobs.interfaces.IFilters] = None, autoguider: ~types.Annotated[str | None, ~pyobs.interfaces.IAutoGuiding] = None, acquisition: ~types.Annotated[str | None, ~pyobs.interfaces.IAcquisition] = None)[source]
Bases:
ImagingScriptImaging script that runs until the end of a transit window.
Requires a TransitMerit on the task. Overrides _run_configurations() to loop instrument configurations until transit_time + duration/2 + ingress.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this script can currently run.
In addition to ImagingScript checks, requires a TransitMerit on the task.
- Returns:
True if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the transit observation.
- Parameters:
data – Task data containing the TransitMerit.
time – If given, return remaining time until end of the next transit window that starts at or after
time. If None, return the full observable window (ingress + duration + ingress).
- Returns:
Estimated duration in seconds.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- async run(data: TaskData | None) None[source]
Run script.
- Raises:
InterruptedError – If interrupted.
ValueError – If no TransitMerit found.
An ImagingScript subclass that repeats its
instrument configurations for as long as a transit window is open, instead of a fixed number
of times. Requires a TransitMerit on the task.
- class AutoFocusScript(*, exptime_done: float = 0.0, autofocus: Annotated[str, IAutoFocus] = 'autofocus', telescope: Annotated[str, ITelescope, IPointingRaDec] = 'telescope', count: int = 5, step: float = 0.1, exposure_time: float = 2.0)[source]
Bases:
ScriptScript for running autofocus series.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run. :returns: True if script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the autofocus run.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class DarkBiasScript(*, exptime_done: float = 0.0, camera: Annotated[str, IData, IBinning, IWindow, IExposureTime, IImageType], count: int = 20, exptime: float = 0, exptimes: list[float] | None = None, match_science_exptimes: bool = False, archive: Archive | None = None, site: str | None = None, night: str | None = None, binning: tuple[int, int] = (1, 1))[source]
Bases:
ScriptScript for running darks or biases.
Exactly one of three mutually exclusive modes selects what is exposed:
exptime(default0): a single series –0takes a bias, anything else takes one dark series at that exposure time. This is the classic, unchanged behavior.exptimes: an explicit list of exposure times, one dark series each, run longest-first.0is not allowed inside the list – a bias is always its own single series.match_science_exptimes: derive the series from the night’s science frames instead of a fixed list. Requiresarchiveandsite; the night is taken fromnightif given, else derived from the observer injected by the scheduler (the night that just ended). Science exptimes belowdark_min_exptime(5 s, per ADR 0015) are dropped, near-duplicates are tolerance-grouped (1 %), and only exptimes used at the script’s ownbinningare kept – the script exposes at exactly one binning and never loops over binnings.
Example configs:
Single bias (default):
class: pyobs.robotic.scripts.calibration.darkbias.DarkBiasScript camera: cam1 count: 20 exptime: 0
Explicit dark exptimes:
class: pyobs.robotic.scripts.calibration.darkbias.DarkBiasScript camera: cam1 count: 10 exptimes: [30.0, 300.0, 600.0] binning: [1, 1]
Match the night’s science exptimes (local archive):
class: pyobs.robotic.scripts.calibration.darkbias.DarkBiasScript camera: cam1 count: 10 match_science_exptimes: true site: bsh archive: class: pyobs.robotic.utils.archive.local_archive.LocalArchive root: /data/archive binning: [1, 1]
Match the night’s science exptimes (pyobs-archive server):
class: pyobs.robotic.scripts.calibration.darkbias.DarkBiasScript camera: cam1 count: 10 match_science_exptimes: true site: bsh night: 2026-09-01 # optional; defaults to the just-ended night via the observer archive: class: pyobs.robotic.utils.archive.pyobs_archive.PyobsArchive url: https://archive.example.org token: <token> binning: [1, 1]
Notes:
estimate_duration()sums over all series; formatch_science_exptimesit reads the resultcan_run()already cached (5 min TTL), falling back to a 600 s placeholder per series when nothing is cached yet.For
match_science_exptimesthe binning match is a string comparison against the archive’slist_options()binningsvalues (“NxM”). This always matches forLocalArchive; forPyobsArchiveit depends on the pyobs-archive server returning that format.If no science exptimes are found for the night/binning, nothing is exposed and a warning is logged.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run. :returns: True if script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the dark/bias series.
For match_science_exptimes, this sync method can’t query the archive itself; it reads whatever can_run()’s prior (async) call already cached for this site/night, via peek_cached_science_exptimes_for_night(). Falls back to a placeholder single-series estimate at _FALLBACK_MATCH_EXPTIME if nothing is cached yet – e.g. can_run() hasn’t run for this site/night within the cache’s TTL.
readout uses the camera’s matching BinningOption.readout_time_s (data.instrument_capabilities) when available, falling back to the flat 5.0 s fudge otherwise.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class SkyFlatsScript(*, exptime_done: float = 0.0, roof: Annotated[str, IRoof], telescope: Annotated[str, ITelescope], flatfield: Annotated[str, IBinning, IFilters, IFlatField], functions: str | dict[str, str | dict[str, str]] = {}, priorities: SkyflatPriorities, min_exptime: float = 0.5, max_exptime: float = 5, timespan: float = 7200, filter_change: float = 30, count: int = 20, readout: dict[str, float] | None = None)[source]
Bases:
ScriptScript for scheduling and running skyflats using an IFlatField module.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run.
- Returns:
True if script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the sky flats.
The actual schedule depends on sky conditions that can only be evaluated at runtime, so this returns the configured timespan as a conservative upper bound.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class PointingScript(*, exptime_done: float = 0.0, telescope: Annotated[str, IPointingAltAz, IReady], pointing: SkyFlatsBasePointing)[source]
Bases:
ScriptScript for pointing the telescope for flats.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run. :returns: True if script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of slewing to the flat-field pointing.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Points the telescope at the sky position configured for flat-fielding (via a
SkyFlatsBasePointing\ ), without taking any
exposures itself — typically run just before a SkyFlatsScript.
Control flow
These scripts do not perform observations themselves — they compose other scripts into more complex execution patterns. They can be nested arbitrarily.
- class SequentialRunner(*, exptime_done: float = 0.0, scripts: list[Script], check_all_can_run: bool = True)[source]
Bases:
ScriptScript for running a sequence of other scripts.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration as the sum of the durations of all sub-scripts.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Run a list of scripts one after the other. By default, checks that all scripts can run before starting. Set ``check_all_can_run: false`` to only check the first.
- class ParallelRunner(*, exptime_done: float = 0.0, scripts: list[Script], check_all_can_run: bool = True)[source]
Bases:
ScriptScript for running other scripts in parallel.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration as the longest duration of all sub-scripts, since they run in parallel.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Run a list of scripts concurrently using asyncio.gather. Useful for simultaneously
operating two independent hardware systems.
- class ConditionalRunner(*, exptime_done: float = 0.0, condition: str, true: Script, false: Script | None = None)[source]
Bases:
ScriptScript for running an if condition.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the branch that would be run for the current condition.
- get_fits_headers(namespaces: list[str] | None = None) dict[str, FitsHeaderEntry][source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Evaluate a Python expression and run either a ``true`` or ``false`` sub-script. The expression
context provides ``now`` as a UTC datetime.
- class CasesRunner(*, exptime_done: float = 0.0, expression: str, cases: dict[str | int | float, Script])[source]
Bases:
ScriptScript for distinguishing cases.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the script for the current case.
- get_fits_headers(namespaces: list[str] | None = None) dict[str, FitsHeaderEntry][source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Evaluate an expression and select a sub-script from a dict of cases. Supports an ``else`` key for a default.
- class SelectorScript(*, exptime_done: float = 0.0, mode: str, selector: Annotated[str, IMode, IMotion])[source]
Bases:
ScriptScript for running Mode Selection.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Whether this config can currently run. :returns: True if script can run now.
- estimate_duration(data: TaskData | None = None, time: Time | None = None) float[source]
Estimate duration of the mode change.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Switch a module implementing IMode to a specified mode.
- class CallModuleScript(*, exptime_done: float = 0.0, module: str, interface: str, method: str, params: dict[str, str | int | float]=<factory>)[source]
Bases:
ScriptScript for calling a method on a module.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Call an arbitrary method on any module by name. Useful for one-off actions without writing a full script class.
- class LogScript(*, exptime_done: float = 0.0, expression: str)[source]
Bases:
ScriptScript for logging something.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Evaluate a Python expression and log the result. Useful for debugging.
- class DebugTriggerScript(*, exptime_done: float = 0.0, triggered: bool = False)[source]
Bases:
ScriptScript for a debug trigger.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- async can_run(data: TaskData | None) bool[source]
Checks whether this script could run now.
- Returns:
True, if the script can run now.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Sets its own triggered flag to True when run and does nothing else. Useful as a
minimal, dependency-free script for testing scheduling and task-runner behavior without any
real hardware.
Sky flat utilities
These classes support the SkyFlatsScript script and are configured as
nested objects within it.
- class FlatFielder(functions: str | dict[str, str | dict[str, str]], target_count: float = 30000, min_exptime: float = 0.5, max_exptime: float = 5, test_frame: tuple[float, float, float, float] | None = None, counts_frame: tuple[float, float, float, float] | None = None, allowed_offset_frac: float = 0.2, min_counts: int = 100, pointing: dict[str, Any] | SkyFlatsBasePointing | None = None, callback: Callable[[...], Coroutine[Any, Any, None]] | None = None, **kwargs: Any)
Bases:
ObjectAutomatized flat-fielding.
Initialize a new flat fielder.
- Parameters:
functions – Function f(h) for each filter to describe ideal exposure time as a function of solar elevation h, i.e. something like exp(-0.9*(h+3.9)). See ExpTimeEval for details.
target_count – Count rate to aim for.
min_exptime – Minimum exposure time.
max_exptime – Maximum exposure time.
test_frame – Tupel (left, top, width, height) in percent that describe the frame for on-sky testing.
counts_frame – Tupel (left, top, width, height) in percent that describe the frame for calculating mean count rate.
allowed_offset_frac – Offset from target_count (given in fraction of it) that’s still allowed for good flat-field
min_counts – Minimum counts in frames.
observer – Observer to use.
vfs – VFS to use.
callback – Callback function for statistics.
- class SkyFlatsBasePointing[source]
Bases:
PolymorphicBaseModelBase class for flat pointings.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class SkyFlatsStaticPointing[source]
Bases:
SkyFlatsBasePointingStatic flat pointing.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class SkyflatPriorities[source]
Bases:
PolymorphicBaseModelBase class for sky flat priorities.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ConstSkyflatPriorities(*, priorities: dict[tuple[str, tuple[int, int]], float])[source]
Bases:
SkyflatPrioritiesConstant flat priorities.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ArchiveSkyflatPriorities(*, archive: Archive, site: str, instrument: str, filter_names: list[str], binnings: list[int])[source]
Bases:
SkyflatPrioritiesCalculate flat priorities from an archive.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].