Quantities
Quantities are physical measurements extracted from GCN Circulars. Each quantity type has its own schema—so a redshift, for example, always has the same fields regardless of how the circular reports it. This makes it much easier to write code around them or store them in a database.
You can inspect the Quantity type itself to see all kind of measurements
currently supported:
tgcn.Quantity
Quantity = Annotated[Localization | DetectionTime | T90 | T50 | Magnitude | Redshift | HEFlux | HEFluence | RadioFlux | UpperLimit, Field(discriminator=type)]
Each quantity is composed of smaller, reusable building blocks called
primitives. For example, a Circle and a ConfidenceLevel primitive may
combine into a Localization quantity describing where an event occurred on
the sky. Each primitive has its own schema, with types for geometry, time,
statistics, and more.
To avoid floating-point rounding artifacts and preserve the exact precision
reported in the circular, all numeric values use Python's Decimal type.
Every quantity also includes an instruments and a referencesfield:
instruments identifies the instruments or observatories behind that
measurement, while references records the character spans where those
values were found in the original circular text.
Core quantity types
tgcn.normalized.Localization
A sky region with uncertainties.
confidence
confidence: Confidence | None = None
A confidence level.
error_role
error_role: Literal['statistical', 'systematic', 'combined'] | None = None
Qualifies the sky region uncertainty.
geometry
geometry: Geometry
The sky region geometry.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
systematics
systematics: Systematics | None = None
Optional systematic associated to the measure.
tgcn.normalized.DetectionTime
Time for an event detection.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
value
value: TimePoint
The detection time.
tgcn.normalized.T90
A transient T90 duration.
confidence
confidence: Confidence | None = None
A confidence level associated to the measure.
energy_band
energy_band: EnergyBand | None = None
An energy band over which the quantity was computed.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
unit
unit: Literal[SECOND] = UnitTime.SECOND
Unit of measurement for the value.
value
value: Annotated[Decimal, Field(ge=0)]
The duration value, in seconds.
tgcn.normalized.T50
A transient T50 duration.
confidence
confidence: Confidence | None = None
A confidence level associated to the measure.
energy_band
energy_band: EnergyBand | None = None
An energy band over which the quantity was computed.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
unit
unit: Literal[SECOND] = UnitTime.SECOND
Unit of measurement for the value.
value
value: Annotated[Decimal, Field(ge=0)]
The duration value, in seconds.
tgcn.normalized.Magnitude
Apparent magnitude measurement of an astronomical source.
band
band: str | None = None
Photometric filter or passband used for the observation (e.g., "g",
"r", "J", "UVW1").
confidence
confidence: Confidence | None = None
The statistical confidence level associated with the detection.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
system
system: Literal['ab', 'vega'] | None = None
Photometric calibration system defining the zero-point (AB or Vega).
time
time: Time | None = None
Observation timestamp or epoch associated with the measurement, if known.
time_role
time_role: Literal['start', 'midpoint'] | None = None
Point within the exposure interval that time refers to (exposure start or
midpoint).
unit
unit: Literal[MAGNITUDE] = UnitDimensionless.MAGNITUDE
Unit of measurement for the value.
value
value: Decimal
Measured apparent brightness on a logarithmic magnitude scale.
tgcn.normalized.Redshift
Spectroscopic or photometric redshift measurement of an astronomical source.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
method
method: Literal['spectroscopic', 'photometric'] | None = None
Technique used to determine the redshift (e.g., spectral line fitting vs. broadband SED modeling).
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
unit
unit: Literal[DIMENSIONLESS] = UnitDimensionless.DIMENSIONLESS
Unit of measurement for the value.
value
value: Decimal
A dimensionless cosmological redshift.
tgcn.normalized.HEFlux
High-energy (X-ray or gamma-ray) flux measurement of a astrophysical source or transient.
absorption
absorption: Literal['absorbed', 'unabsorbed'] | None = None
Indicates whether the flux is corrected for interstellar or intrinsic absorption.
confidence
confidence: Confidence | None = None
Statistical confidence level of the measurement, if reported.
energy_band
energy_band: EnergyBand | None = None
Spectral energy range over which the flux was integrated, if specified.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
integration_bounds
integration_bounds: TimeInterval | None = None
Start and end timestamps defining the integration window, if known.
integration_duration
integration_duration: TimeDuration | None = None
Length of the time window over which the flux was integrated, in seconds.
is_peak
is_peak: bool
True if the measurement is explicitly reported as a peak flux rather than a time-averaged value.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
unit
unit: UnitFlux
Unit of measurement for the value.
value
value: Decimal
Measured energy or photon flux.
tgcn.normalized.HEFluence
High-energy (X-ray or gamma-ray) time-integrated fluence measurement of an astronomical source.
confidence
confidence: Confidence | None = None
Statistical confidence level of the measurement, if reported.
energy_band
energy_band: EnergyBand | None = None
Spectral energy range over which the fluence was integrated, if specified.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
integration_bounds
integration_bounds: TimeInterval | None = None
Start and end timestamps defining the integration window, if known.
integration_duration
integration_duration: TimeDuration | None = None
Length of the time window over which the fluence was accumulated, in seconds.
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
unit
unit: Literal[ERG_CM2] = UnitFluence.ERG_CM2
Unit of measurement for the value.
value
value: Decimal
Measured time-integrated energy fluence, in erg cm⁻².
tgcn.normalized.RadioFlux
Radio flux density measurement of an astronomical source.
confidence
confidence: Confidence | None = None
Statistical confidence level or upper-limit significance of the measurement, if reported.
err_lower
err_lower: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to subtract from the value, in the quantity's unit.
err_upper
err_upper: Annotated[Decimal, Field(ge=0, allow_inf_nan=False)] | None = None
Error magnitude to add to the value, in the quantity's unit.
frequency
frequency: Frequency | FrequencyRange | None = None
Observing frequency or frequency range, in GHz, if reported.
instruments
instruments: tuple[Instrument, ...]
The instruments responsible for the measurement.
measurement
measurement: Literal['peak', 'integrated'] | None = None
Method used to extract the flux from the radio image (peak pixel brightness or spatially integrated flux).
references
references: tuple[tuple[int, int], ...] = ()
Spans of supporting text in the circular body. Each pair contains a start and an exclusive end offset. Spans are sorted and contain no duplicates.
rms
rms: ImageRMS | None = None
Local background root-mean-square (RMS) noise level of the radio image, if reported.
time
time: Time | None = None
Observation timestamp or epoch associated with the measurement, if known.
time_role
time_role: Literal['start', 'midpoint'] | None = None
Point within the observation interval that time refers to (observation
start or midpoint).
unit
unit: Literal[JANSKY, JANSKY_PER_BEAM]
Unit of measurement for the value.
value
value: Decimal
Measured radio flux density.
tgcn.normalized.UpperLimit
A limiting value reported for a non-detection.
The wrapped quantity gives the detection threshold, such as a flux limit or limiting magnitude. For magnitudes, the limit bounds brightness: a fainter source has a larger numerical magnitude.
instruments
instruments: tuple[Instrument, ...]
Returns the wrapped quantity's instruments field.
quantity
quantity: T
The measurement carrying the limiting value.
references
references: tuple[tuple[int, int], ...]
Returns the wrapped quantity's references field.
Geometry Primitives
tgcn.normalized.Geometry
Geometry = Annotated[Point | Circle | Rectangle | Ellipse | Polygon | Annulus, Field(discriminator=type)]
A one-of type representing the supported sky region geometries.
tgcn.normalized.Point
A point-like sky region in equatorial coordinates.
dec
dec: Decimal
Declination in degrees, in the range [-90, 90].
ra
ra: Decimal
Right ascension in decimal degrees, in the range [0, 360).
unit
unit: Literal[DEGREE] = UnitAngle.DEGREE
Unit for the coordinates and any angular dimensions.
tgcn.normalized.Circle
A circular sky region around a center position.
dec
dec: Decimal
Declination in degrees, in the range [-90, 90].
ra
ra: Decimal
Right ascension in decimal degrees, in the range [0, 360).
radius
radius: Decimal
Angular radius in degrees, greater than zero and at most 180.
unit
unit: Literal[DEGREE] = UnitAngle.DEGREE
Unit for the coordinates and any angular dimensions.
tgcn.normalized.Rectangle
An equatorial, coordinate-aligned, rectangular region.
dec
dec: Decimal
Declination in degrees, in the range [-90, 90].
dec_minus
dec_minus: Decimal
Non-negative offset subtracted from declination.
dec_plus
dec_plus: Decimal
Non-negative offset added to declination.
ra
ra: Decimal
Right ascension in decimal degrees, in the range [0, 360).
ra_minus
ra_minus: Decimal
Non-negative offset subtracted from right ascension.
ra_plus
ra_plus: Decimal
Non-negative offset added to right ascension.
unit
unit: Literal[DEGREE] = UnitAngle.DEGREE
Unit for the coordinates and any angular dimensions.
tgcn.normalized.Ellipse
An elliptical sky region with optional orientation.
dec
dec: Decimal
Declination in degrees, in the range [-90, 90].
orientation
orientation: Decimal | None = None
Semi-major axis angle from north through east in [0, 180) degrees. None if not reported.
ra
ra: Decimal
Right ascension in decimal degrees, in the range [0, 360).
semi_major
semi_major: Decimal
Length of the semi-major axis in degrees.
semi_minor
semi_minor: Decimal
Length of the semi-minor axis in degrees.
unit
unit: Literal[DEGREE] = UnitAngle.DEGREE
Unit for the coordinates and any angular dimensions.
tgcn.normalized.Polygon
A closed, polygonal sky region.
center
center: Point | None = None
Center as stated in the circular, or None when absent.
vertices
vertices: tuple[Point, ...]
Polygon vertices in order. The closing edge joins the last to the first.
tgcn.normalized.Annulus
A sky region between two radii around a common center.
dec
dec: Decimal
Declination in degrees, in the range [-90, 90].
inner_radius
inner_radius: Decimal
Angular radius of the inner edge in degrees, zero or greater.
outer_radius
outer_radius: Decimal
Angular radius of the outer edge in degrees, at most 180.
ra
ra: Decimal
Right ascension in decimal degrees, in the range [0, 360).
unit
unit: Literal[DEGREE] = UnitAngle.DEGREE
Unit for the coordinates and any angular dimensions.
Time Primitives
tgcn.normalized.Time
Time = Annotated[TimePoint | TimeRelative, Field(discriminator=type)]
A one-of type representing a point in time or the time elapsed from a reference.
tgcn.normalized.TimePoint
A date, a clock time or a complete timestamp, with optional timezone and
preserving unstated components as None. A date may omit its year, and a clock
time may omit its seconds.
Source code in src/tgcn/normalized.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
tgcn.normalized.TimeRelative
A signed offset in seconds from an optional reference.
Positive offsets are after the reference; negative offsets are before it.
Months and years use the following fixed Julian conversion: one month is assumed to
last 2.6298e6 seconds, one year is assumed to last 3.15576e7 seconds.
Source code in src/tgcn/normalized.py
321 322 323 324 325 326 327 328 329 330 331 332 333 | |
tgcn.normalized.TimeDuration
An elapsed length of time in seconds.
Source code in src/tgcn/normalized.py
301 302 303 304 305 | |
tgcn.normalized.TimeInterval
A time interval with a known start, end, or both.
Source code in src/tgcn/normalized.py
308 309 310 311 312 313 314 315 316 317 318 | |
Energy and frequency
tgcn.normalized.EnergyBand
An energy band, in keV.
Source code in src/tgcn/normalized.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
tgcn.normalized.Frequency
An observing frequency in GHz.
Source code in src/tgcn/normalized.py
352 353 354 355 356 | |
tgcn.normalized.FrequencyRange
Observing frequency boundaries in GHz.
Source code in src/tgcn/normalized.py
359 360 361 362 363 364 365 366 367 368 369 370 | |
Errors and statistics
tgcn.normalized.Confidence
A confidence level associated to an uncertainty. Expressed either as a percentage (90% C.L.) or as sigma level.
Source code in src/tgcn/normalized.py
373 374 375 376 377 378 379 380 381 382 383 384 | |
tgcn.normalized.Systematics
Systematics = Annotated[RadialSystematic | SystematicMixture, Field(discriminator=type)]
A one-of type representing a systematic uncertainty associated with a quantity.
tgcn.normalized.RadialSystematic
A separate radial systematic error in degrees and its confidence.
Source code in src/tgcn/normalized.py
394 395 396 397 398 399 400 401 402 403 404 405 406 | |
tgcn.normalized.SystematicMixture
Gaussian systematic components with their reported weights.
Source code in src/tgcn/normalized.py
426 427 428 429 430 431 432 433 434 435 436 437 | |
tgcn.normalized.SystematicMixtureComponent
A Gaussian systematic component. The unit applies to error; weight is a dimensionless fraction in (0, 1].
Source code in src/tgcn/normalized.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | |
tgcn.normalized.ImageRMS
Radio image noise in Jy or Jy/beam, independent of source uncertainty.
Source code in src/tgcn/normalized.py
444 445 446 447 448 | |
Instruments
tgcn.Instrument
Bases: StrEnum
An observing instrument or telescope from a curated list.
Source code in src/tgcn/instruments.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |