"""
The ska_oso_pdm.sb_definition_sb_definition module defines
a simple Python representation of the scheduling block
that contains the details of the observation
"""
from pydantic import Field
from ska_oso_pdm._shared import (
Metadata,
PdmObject,
ProjectID,
SBDefinitionID,
Target,
TelescopeType,
ValidationArrayAssembly,
)
from .csp.csp_configuration import CSPConfiguration
from .dish.dish_allocation import DishAllocation
from .mccs.mccs_allocation import MCCSAllocation
from .observing_constraints import ObservingConstraints
from .procedures import ProcedureUnion
from .qa_threshold_overrides import QAThresholdOverrides
from .sdp.sdp_configuration import SDPConfiguration
__all__ = ["SBDefinition"]
# URI of the Scheduling Block definition. Not currently part of telescope model.
SBD_SCHEMA_URI = "https://schema.skao.int/ska-oso-pdm-sbd/0.1"
[docs]
class SBDefinition(PdmObject):
"""
SKA scheduling block
"""
interface: str | None = SBD_SCHEMA_URI
sbd_id: SBDefinitionID | None = None
name: str | None = None
description: str | None = None
telescope: TelescopeType | None = None
validate_against: ValidationArrayAssembly | None = Field(
default=None,
description="Array Assembly to use for validation of this SBD.",
)
metadata: Metadata | None = None
prj_ref: ProjectID | None = Field(
default=None,
description="Reference to a Project that the SBDefinition ultimately belongs to via the ob_ref. This should be consistent with the ob_ref and is included for quick checks during comissioning.",
)
ob_ref: ProjectID | None = Field(
default=None,
description="Reference to an ObservingBlock that the SBDefinition belongs to. This should be consistent with the prj_ref.",
)
activities: dict[str, ProcedureUnion] | None = Field(default_factory=dict)
targets: list[Target] | None = Field(default_factory=list)
observing_constraints: ObservingConstraints | None = None
qa_threshold_overrides: QAThresholdOverrides | None = Field(
default=None,
description="Optional QA threshold overrides. If unset, runtime defaults from OSD are used.",
)
csp_configurations: list[CSPConfiguration] | None = Field(default_factory=list)
dish_allocations: DishAllocation | None = None
mccs_allocation: MCCSAllocation | None = None
sdp_configurations: list[SDPConfiguration] | None = Field(default_factory=list)