Models

Data models

pydantic model FileConfigModel[source]

Bases: BaseModel

Pydantic model for transmission curve configuration.

Fields:
field default: bool = False
field description: str = ''
field file: str [Required]
field id: str = ''
field name: str = ''
field vars: dict[str, float | str] = {}
pydantic model EmissionConfigModel[source]

Bases: BaseModel

Pydantic model for emission curve set configuration.

Fields:
field areas: list[~astropy.units.quantity.Annotated[~astropy.units.quantity.Quantity, <pydiet.server.types.quantity.QuantityAnnotation object at 0x7f53f6bb71f0>, FieldInfo(annotation=NoneType, required=True, json_schema_extra={'minimum': '0.0 m2', 'physType': 'area'})]] = [<Quantity 0. m2>]
field files: list[FileConfigModel] = []
field path: str = ''
field temperatures: list[~astropy.units.quantity.Annotated[~astropy.units.quantity.Quantity, <pydiet.server.types.quantity.QuantityAnnotation object at 0x7f53fcf01ea0>, FieldInfo(annotation=NoneType, required=True, json_schema_extra={'exclusiveMinimum': '0.0 K', 'physType': 'temperature'})]] = [<Quantity 283. K>]
pydantic model TransmissionConfigModel[source]

Bases: BaseModel

Pydantic model for transmission curve set configuration.

Fields:
field files: list[FileConfigModel] = []
field path: str = ''
pydantic model SiteConfigModel[source]

Bases: BaseModel

Pydantic model for the observing site data configuration model.

Fields:
field altitude: 0 m', 'physType': 'length'})] [Required]
Constraints:
  • strict = True

  • unit = m

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • ge = -1000.0 m

field default: bool = False
field description: str [Required]
field emission: EmissionConfigModel [Required]
field id: str [Required]
field name: str [Required]
field path: str [Required]
field transmission: TransmissionConfigModel [Required]
pydantic model TelescopeConfigModel[source]

Bases: BaseModel

Pydantic model for the telescope data configuration model.

Fields:
field collecting_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m2

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

field default: bool = False
field description: str [Required]
field emission: EmissionConfigModel [Required]
field id: str [Required]
field name: str [Required]
field obstruction_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m2

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

field path: str [Required]
field transmission: TransmissionConfigModel [Required]
pydantic model DetectorConfigModel[source]

Bases: BaseModel

Pydantic model for the detector data configuration model.

Fields:
field emission: EmissionConfigModel [Required]
field gain: 0 electron / adu', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = electron/adu

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 electron / adu

field path: str [Required]
field ron: 0 electron', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = electron

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • ge = 0.0 electron

field scale: ] arcsec / pix', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = arcsec/pix

  • description =

  • decimals = 4

  • min_shape = 2

  • max_shape = 2

  • gt = [0. 0.] arcsec / pix

field transmission: TransmissionConfigModel [Required]
pydantic model OpticsConfigModel[source]

Bases: BaseModel

Pydantic model for the intrument optics data configuration model.

Fields:
field emission: EmissionConfigModel [Required]
field path: str [Required]
field transmission: TransmissionConfigModel [Required]
pydantic model FiltersConfigModel[source]

Bases: OpticsConfigModel

Pydantic model for the intrument filters data configuration model.

Fields:

pydantic model InstrumentConfigModel[source]

Bases: BaseModel

Pydantic model for the instrument data configuration model.

Fields:
field default: bool = False
field description: str [Required]
field detector: DetectorConfigModel [Required]
field filters: FiltersConfigModel [Required]
field id: str [Required]
field name: str [Required]
field obstruction_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m2

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

field optics: OpticsConfigModel [Required]
field overhead: 0 s', 'physType': 'time'})] [Required]
Constraints:
  • strict = True

  • unit = s

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • ge = 0.0 s

field path: str [Required]
field site_id: str [Required]
field telescope_id: str [Required]
field wavelength_range: ] nm', 'physType': 'length'})] [Required]
Constraints:
  • strict = True

  • unit = nm

  • description =

  • decimals = 4

  • min_shape = 2

  • max_shape = 2

  • gt = [0. 0.] nm

pydantic model DataConfigModel[source]

Bases: BaseModel

Pydantic model for the data configuration

Fields:
field instruments: list[InstrumentConfigModel] [Required]
field path: Annotated[Path, PathType(path_type=dir)] [Required]
Constraints:
  • path_type = dir

field sites: list[SiteConfigModel] [Required]
field telescopes: list[TelescopeConfigModel] [Required]

Default entries for models

Exceptions for model validation.

exception ETCValidationError[source]

Bases: Exception

Data models

pydantic model DetectorModel[source]

Bases: BaseModel

Pydantic model for an instrument detector (e.g., CMOS or CCD).

Fields:
field emissions: dict[str, SBSEDModel] [Required]
field gain: 0 electron / adu', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = electron / adu

  • description =

  • decimals = 4

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 electron / adu

field ron: 0 electron', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = electron

  • description =

  • decimals = 4

  • min_shape = 1

  • max_shape = 1

  • ge = 0.0 electron

field scale: ] arcsec / pix', 'physType': 'unknown'})] [Required]
Constraints:
  • strict = True

  • unit = arcsec/pix

  • description =

  • decimals = 4

  • min_shape = 2

  • max_shape = 2

  • gt = [0. 0.] arcsec / pix

field transmissions: dict[str, TransmissionModel] [Required]
pydantic model InstrumentModel[source]

Bases: BaseModel

Pydantic model for a PyDIET instrument.

Config:
  • arbitrary_types_allowed: bool = True

Fields:
Validators:
  • _update_transmissions » all fields

field default: bool = False
Validated by:
  • _update_transmissions

field description: str [Required]
Validated by:
  • _update_transmissions

field detector: DetectorModel [Required]
Validated by:
  • _update_transmissions

field emissions_ct: dict | None = None
Validated by:
  • _update_transmissions

field filters: FiltersModel [Required]
Validated by:
  • _update_transmissions

field id: str [Required]
Validated by:
  • _update_transmissions

field name: str [Required]
Validated by:
  • _update_transmissions

field obstruction_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m2

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

Validated by:
  • _update_transmissions

field optics: OpticsModel [Required]
Validated by:
  • _update_transmissions

field overhead: 0 s', 'physType': 'time'})] [Required]
Constraints:
  • strict = True

  • unit = s

  • description =

  • decimals = 3

  • min_shape = 1

  • max_shape = 1

  • ge = 0.0 s

Validated by:
  • _update_transmissions

field site: SiteModel [Required]
Validated by:
  • _update_transmissions

field telescope: TelescopeModel [Required]
Validated by:
  • _update_transmissions

field transmissions: dict | None = None
Validated by:
  • _update_transmissions

field wavelength_range: ] nm', 'physType': 'length'})] [Required]
Constraints:
  • strict = True

  • unit = nm

  • description =

  • decimals = 4

  • min_shape = 2

  • max_shape = 2

  • gt = [0. 0.] nm

Validated by:
  • _update_transmissions

pydantic model OpticsModel[source]

Bases: BaseModel

Pydantic model for optics.

Fields:
field emissions: dict[str, SBSEDModel] [Required]
field transmissions: dict[str, TransmissionModel] [Required]
pydantic model FiltersModel[source]

Bases: OpticsModel

Pydantic model for a filter set.

Fields:

pydantic model SBSEDModel[source]

Bases: BaseModel

Pydantic model for a Surface Brightness Spectral Energy Distribution (SBSED).

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field default: bool = False
field description: str [Required]
field id: str [Required]
field name: str [Required]
field sbsed: 0 Jy / arcsec2', 'physType': 'surface brightness'})] | None = None
field spectral: SourceSpectrum [Required]
field vars: dict[str, float | str] = {}
field wave: 0 nm', 'physType': 'length'})] | None = None
pydantic model SEDModel[source]

Bases: BaseModel

Pydantic model for a Spectral Energy Distribution (SED).

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field default: bool = False
field description: str [Required]
field id: str [Required]
field name: str [Required]
field sed: 0 Jy', 'physType': 'spectral flux density'})] | None = None
field spectral: SourceSpectrum [Required]
field vars: dict[str, float] = {}
field wave: 0 nm', 'physType': 'length'})] | None = None
pydantic model SiteModel[source]

Bases: BaseModel

Pydantic model for an observing site.

Fields:
field default: bool = False
field description: str [Required]
field id: str [Required]
field name: str [Required]
field sky_emissions: dict[str, SBSEDModel] [Required]
field sky_transmissions: dict[str, TransmissionModel] [Required]
pydantic model TelescopeModel[source]

Bases: BaseModel

Pydantic model for a telescope.

Fields:
field collecting_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m**2

  • description =

  • decimals = 4

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

field default: bool = False
field description: str [Required]
field emissions: dict[str, SBSEDModel] [Required]
field id: str [Required]
field name: str [Required]
field obstruction_area: 0 m2', 'physType': 'area'})] [Required]
Constraints:
  • strict = True

  • unit = m**2

  • description =

  • decimals = 4

  • min_shape = 1

  • max_shape = 1

  • gt = 0.0 m2

field transmissions: dict[str, TransmissionModel] [Required]
pydantic model TransmissionModel[source]

Bases: BaseModel

Pydantic model for a transmission curve (with wavelength).

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field default: bool = False
field description: str = ''
field id: str [Required]
field name: str [Required]
field response: 0', 'physType': 'dimensionless'})] | None = None
field spectral: SpectralElement | None = None
field vars: dict[str, float | str] | None = None
field wave: 0 nm', 'physType': 'length'})] | None = None
field wave_range: ] nm', 'physType': 'length'})] | None = None

Query models

pydantic model ETCQueryModel[source]

Bases: BaseModel

Fields:
Validators:
field airmass: float = 1.2

Observation airmass

Constraints:
  • ge = 1.0

field aperture: float = 3.0

Photometric aperture diameter ["]

Constraints:
  • gt = 0.0

  • le = 15.0

field brightness: float = 20.0

Source brightness

Constraints:
  • ge = -100.0

  • le = 1000.0

field compute: Literal['etime', 'snr'] = 'etime'

Computation type

field etime: float = 20.0

Exposure time [s]

Constraints:
  • ge = 0.0

  • le = 1e+30

field exposures: int = 1

Number of exposures

Constraints:
  • ge = 1

  • le = 1000000

field filter: FilterID = TransmissionModel(id='u', name='u', description='', vars={}, wave_range=None, wave=None, response=None, spectral=<synphot.spectrum.SpectralElement object>, default=False)

Instrument filter

Validated by:
field instrument: InstrumentID = 'megacam'

Instrument ID

field photometry: Literal['model_fitting', 'fixed_aperture', 'optimal_aperture', 'large_aperture'] = 'model_fitting'

Photometry type

field seeing: float = 0.7
Constraints:
  • ge = 0.1

  • le = 100.0

field sersic_index: float = 1.0

Sérsic index

Constraints:
  • ge = 0.3

  • le = 10.0

field sersic_radius: float = 1.0

Sérsic effective radius ["]

Constraints:
  • gt = 0.0

  • le = 10.0

field sky: Literal['dark', 'grey', 'bright', 'specify'] = 'dark'

Sky setting

field sky_brightness: float = 22.0

Sky surface brightness

Constraints:
  • ge = -100.0

  • le = 1000.0

field sky_unit: Literal['abmag', 'vegamag', 'fmegajy', 'fmujy', 'flux', 'photons'] = 'abmag'

Sky background photometric system

field snr: float = 10.0

Required source Signal-to-Noise Ratio

Constraints:
  • gt = 0.0

field source: Literal['point_source', 'galaxy', 'extended'] = 'point_source'

Source type

field stacking: Literal['average', 'median'] = 'median'

Stacking method

field transparency: float = 1.0

Sky transparency

Constraints:
  • gt = 0.0

  • le = 1.0

field unit: Literal['abmag', 'vegamag', 'fmegajy', 'fmujy', 'flux', 'photons'] = 'abmag'

Photometric system

validator validate_filter  »  filter[source]

Kind of emulate Enum validation and errors.

Response models

pydantic model ETCResponseModel[source]

Bases: BaseModel

Fields:
field atmosphere_transmission: Json | None = None
field bandwidth_rect: float = 0.0

Equivalent rectangular bandwidth of the full filter response in nm

Constraints:
  • ge = 0.0

  • lt = 1000000000000.0

field compute: Literal['etime', 'snr'] [Required]
field cutout: str | None = None

GIF animation of the source

field etime: float = 1.0

Estimated exposure time

Constraints:
  • ge = 0.0

  • lt = 1e+30

field etime_skysat: float = 0.0

Estimated exposure time for sky background saturation

Constraints:
  • ge = 0.0

  • lt = 1e+30

field etime_sourcesat: float = 0.0

Estimated exposure time for source saturation

Constraints:
  • ge = 0.0

  • lt = 1e+30

field filter: str [Required]
field filter_transmission: Json | None = None
field instrument: str [Required]
field lambda_pivot: float = 0.0

Pivot wavelength of the full filter response in nm

Constraints:
  • ge = 0.0

  • lt = 1000000000000.0

field sky_mag: float = 99.0

Estimated sky background in mag/arcsec2

Constraints:
  • ge = -100.0

  • le = 100.0

field snr: float = 10.0

Estimated source Signal-to-Noise Ratio

Constraints:
  • ge = 0.0

  • lt = 1e+30

field ttime: float = 1.0

Estimated total time

Constraints:
  • ge = 0.0

  • lt = 1e+30

field zp: float = 0.0

Estimate magnitude zero-point

Constraints:
  • ge = -100.0

  • le = 100.0

Custom types for PyDIET data models

class FilterID(value)

Bases: str, Enum

An enumeration.

class InstrumentID(value)

Bases: str, Enum

An enumeration.