ngect.api module

API Backend

class ngect.api.ApertureEta(*, value: float, desc: str = 'Aperture Efficiency')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: float
class ngect.api.BandwidthMax(*, value: float | None = None, unit: str | None = None, desc: str = 'Maximum Instantaneous Bandwidth')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str | None
value: float | None
class ngect.api.Chanwidth(*, value: float = 10000.0, unit: str = 'm/s', unit_select: list[str] = ['GHz', 'MHz', 'kHz', 'Hz', 'km/s', 'm/s'], desc: str = 'Chanwidth in velocity or frequency')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list[str]
value: float
class ngect.api.ConfigRev(*, value: str = 'RevF', value_select: list[str] = ['RevD', 'RevF'], desc: str = 'Configuration revision')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: list[str]
class ngect.api.ConfusionLevel(*, value: float, unit: str, desc: str = 'Confusion Level (not implemented)')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
value: float
class ngect.api.DigitalSamplers(*, value: str = '8-bit', desc: str = 'Digital Samplers (not implemented)')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
class ngect.api.EctMode(*, value: str = 'tos2rms', value_select: list[str] = ['tos2rms', 'rms2tos'], desc: str = 'Calculator Model: tos2rms or rms2tos')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: list[str]
class ngect.api.EffArea(*, value: float, unit: str, desc: str = 'Effective Area')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
value: float
class ngect.api.Elevation(*, value: float = 45.0, value_range: tuple = (0, 90), unit: str = 'degree', unit_select: list = ['degree'], desc: str = 'Elevation (not implemented)')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list
value: float
value_range: tuple
class ngect.api.Fov(*, value: float, unit: str, desc: str = 'Field of View')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
value: float
class ngect.api.Frequency(*, value: float = 24.0, unit: str = 'GHz', unit_select: list[str] = ['GHz', 'MHz', 'kHz', 'Hz'], desc: str = 'Representative Frequency')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list[str]
value: float
class ngect.api.InputModel(*, freq: Frequency, theta: Theta, rx_config: RxConfig, subarray: SubArray, configrev: ConfigRev, specmode: SpecMode, chanwidth: Chanwidth, npol: PolNum, tos: Tos, sigma: Sigma, elevation: Elevation, ectmode: EctMode, pwv: Pwv)

Bases: BaseModel

chanwidth: Chanwidth
configrev: ConfigRev
ectmode: EctMode
elevation: Elevation
freq: Frequency
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

npol: PolNum
pwv: Pwv
rx_config: RxConfig
sigma: Sigma
specmode: SpecMode
subarray: SubArray
theta: Theta
tos: Tos
class ngect.api.NumAntenna(*, value: int, desc: str = 'Number of Antennas')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: int
class ngect.api.OutputModel(*, freq: Frequency, rx_name: RxName, fov: Fov, max_bw: BandwidthMax, t_sys: Tsys, chanwidth_freq: Chanwidth, chanwidth_velo: Chanwidth, tos: Tos, sigma_fl: Sigma, sigma_tb: Sigma, samplers: DigitalSamplers, num_ant: NumAntenna, theta: Theta, eta_A: ApertureEta, total_eff_A: EffArea, cf_level: ConfusionLevel)

Bases: BaseModel

cf_level: ConfusionLevel
chanwidth_freq: Chanwidth
chanwidth_velo: Chanwidth
eta_A: ApertureEta
fov: Fov
freq: Frequency
max_bw: BandwidthMax
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

num_ant: NumAntenna
rx_name: RxName
samplers: DigitalSamplers
sigma_fl: Sigma
sigma_tb: Sigma
t_sys: Tsys
theta: Theta
tos: Tos
total_eff_A: EffArea
class ngect.api.PolNum(*, value: int = 2, value_select: list[int] = [1, 2], desc: str = 'Polarization setup: 1=single, 2=dual')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: int
value_select: list[int]
class ngect.api.Pwv(*, value: str = '6 mm', value_select: list[str] = ['1 mm', '6 mm', '13mm'], desc: str = 'Preciptable Water Vapor (not implemented)')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: list[str]
class ngect.api.Quantity(*, value: float, unit: str, desc: str | None = None)

Bases: BaseModel

desc: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
value: float
class ngect.api.RxConfig(*, value: str = 'Baseline', desc: str = 'Receiver Configuration', value_select: dict = {'BAND_1': {'Tprimesys': 13.263636363636362, 'Tsys': 13.163636363636362, 'antEff': [0.83, 0.85, 0.87, 0.89, 0.9, 0.91, 0.92, 0.92, 0.91, 0.93, 0.92], 'elevation': 45.0, 'eta_A': 0.8954545454545454, 'freq': [1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.3, 2.5, 2.8, 3.2, 3.5], 'freq_center': 2.4, 'max_bw': 2.3, 'pwv': 6, 'tRx': [5.6, 4.9, 4.7, 4.7, 5.0, 5.3, 5.5, 5.7, 5.6, 6.0, 6.5], 'tSpill': [3.6, 3.0, 2.6, 2.4, 2.1, 1.7, 1.5, 1.4, 1.1, 1.1, 1.2], 'tSys': [15.7, 14.2, 13.3, 13.1, 12.9, 12.7, 12.5, 12.6, 12.2, 12.5, 13.1], 'tau': [0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.007, 0.008], 'tprimeSys': [15.9, 14.3, 13.4, 13.1, 13.0, 12.8, 12.6, 12.7, 12.3, 12.6, 13.2]}, 'BAND_2': {'Tprimesys': 15.97272727272727, 'Tsys': 15.827272727272726, 'antEff': [0.89, 0.9, 0.91, 0.91, 0.92, 0.93, 0.94, 0.94, 0.94, 0.95, 0.95], 'elevation': 45.0, 'eta_A': 0.9254545454545453, 'freq': [3.4, 3.9, 4.4, 5.0, 5.7, 6.4, 7.4, 8.4, 9.5, 10.8, 12.3], 'freq_center': 8.0, 'max_bw': 8.8, 'pwv': 6, 'tRx': [9.1, 7.2, 7.2, 7.4, 7.4, 7.4, 7.7, 8.5, 9.4, 10.0, 10.9], 'tSpill': [2.4, 2.2, 1.9, 1.6, 1.5, 1.5, 1.4, 1.5, 1.6, 1.7, 1.8], 'tSys': [17.0, 14.9, 14.6, 14.5, 14.5, 14.5, 14.8, 15.7, 16.9, 17.7, 19.0], 'tau': [0.007, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.009, 0.009, 0.01, 0.01], 'tprimeSys': [17.1, 15.0, 14.7, 14.7, 14.7, 14.6, 14.9, 15.9, 17.0, 17.9, 19.2]}, 'BAND_3': {'Tprimesys': 22.700000000000003, 'Tsys': 22.28181818181818, 'antEff': [0.93, 0.93, 0.94, 0.94, 0.94, 0.94, 0.94, 0.95, 0.95, 0.94, 0.94], 'elevation': 45.0, 'eta_A': 0.9399999999999998, 'freq': [12.3, 12.9, 13.6, 14.4, 15.1, 15.9, 16.7, 17.6, 18.5, 19.5, 20.5], 'freq_center': 16.0, 'max_bw': 8.2, 'pwv': 6, 'tRx': [12.8, 12.5, 12.3, 12.4, 12.5, 12.8, 13.1, 13.4, 13.7, 14.1, 14.4], 'tSpill': [1.0, 0.9, 0.9, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7], 'tSys': [20.1, 19.8, 19.8, 20.0, 20.3, 20.8, 21.6, 22.6, 23.9, 26.2, 30.0], 'tau': [0.01, 0.011, 0.011, 0.012, 0.013, 0.014, 0.016, 0.018, 0.022, 0.03, 0.044], 'tprimeSys': [20.3, 20.0, 20.0, 20.2, 20.6, 21.1, 21.9, 23.0, 24.4, 26.9, 31.3]}, 'BAND_4': {'Tprimesys': 32.190909090909095, 'Tsys': 30.736363636363638, 'antEff': [0.92, 0.92, 0.92, 0.93, 0.93, 0.93, 0.93, 0.92, 0.92, 0.92, 0.91], 'elevation': 45.0, 'eta_A': 0.9227272727272727, 'freq': [20.5, 21.6, 22.7, 23.9, 25.1, 26.4, 27.8, 29.2, 30.7, 32.4, 34.0], 'freq_center': 27.0, 'max_bw': 13.5, 'pwv': 6, 'tRx': [14.9, 14.4, 14.2, 14.2, 14.1, 14.1, 14.2, 14.3, 14.5, 14.9, 15.6], 'tSpill': [1.1, 1.0, 1.0, 0.9, 0.9, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7], 'tSys': [30.8, 36.4, 38.4, 33.7, 30.0, 28.0, 27.3, 27.2, 27.7, 28.6, 30.0], 'tau': [0.044, 0.068, 0.078, 0.059, 0.044, 0.036, 0.033, 0.033, 0.033, 0.036, 0.039], 'tprimeSys': [32.1, 38.9, 41.5, 35.7, 31.3, 29.0, 28.2, 28.1, 28.6, 29.6, 31.1]}, 'BAND_5': {'Tprimesys': 52.79090909090908, 'Tsys': 46.29090909090909, 'antEff': [0.9, 0.9, 0.9, 0.9, 0.9, 0.89, 0.89, 0.88, 0.88, 0.87, 0.86], 'elevation': 45.0, 'eta_A': 0.8881818181818182, 'freq': [30.5, 32.0, 33.7, 35.5, 37.3, 39.3, 41.3, 43.3, 45.7, 48.0, 50.5], 'freq_center': 41.0, 'max_bw': 20.0, 'pwv': 6, 'tRx': [16.8, 16.2, 16.9, 17.8, 17.9, 18.1, 19.1, 20.9, 23.2, 25.4, 24.8], 'tSpill': [1.0, 1.0, 0.9, 0.9, 0.9, 0.8, 0.8, 0.8, 0.9, 0.9, 0.8], 'tSys': [30.1, 29.8, 31.4, 33.3, 34.9, 37.2, 41.0, 46.8, 56.4, 70.6, 97.7], 'tau': [0.033, 0.035, 0.038, 0.043, 0.048, 0.057, 0.069, 0.087, 0.119, 0.175, 0.316], 'tprimeSys': [31.1, 30.9, 32.5, 34.7, 36.6, 39.3, 43.9, 50.9, 63.4, 83.9, 133.5]}, 'BAND_6': {'Tprimesys': 90.47272727272725, 'Tsys': 71.66363636363636, 'antEff': [0.75, 0.74, 0.72, 0.71, 0.69, 0.67, 0.64, 0.61, 0.59, 0.56, 0.53], 'elevation': 45.0, 'eta_A': 0.6554545454545454, 'freq': [70.0, 73.8, 77.5, 81.5, 85.5, 90.0, 95.0, 100.0, 105.0, 110.6, 116.0], 'freq_center': 90.0, 'max_bw': 20.0, 'pwv': 1, 'tRx': [31.3, 26.1, 27.1, 28.6, 30.6, 34.2, 38.1, 40.6, 41.6, 41.7, 41.6], 'tSpill': [0.5, 0.4, 0.4, 0.3, 0.3, 0.2, 0.2, 0.2, 0.2, 0.1, 0.2], 'tSys': [101.4, 67.8, 57.7, 52.9, 51.6, 53.1, 56.1, 59.1, 62.2, 71.7, 154.7], 'tau': [0.314, 0.161, 0.106, 0.078, 0.063, 0.054, 0.05, 0.051, 0.06, 0.104, 0.601], 'tprimeSys': [138.1, 79.4, 63.9, 57.0, 54.8, 56.0, 58.9, 62.0, 65.9, 79.3, 279.9]}})

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: dict
class ngect.api.RxName(*, value: str, desc: str = 'Receiver Band Name')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
class ngect.api.Sigma(*, value: float = 10, unit: str = 'K', desc: str = '', unit_select: list[str] = ['nJy/beam', 'uJy/beam', 'mJy/beam', 'Jy/beam', 'mK', 'K'])

Bases: Quantity

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list[str]
value: float
class ngect.api.SpecMode(*, value: str = 'line', value_select: list[str] = ['line', 'cont'], desc: str = '')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: list[str]
class ngect.api.SubArray(*, value: str = 'core', value_select: list[str] = ['core', 'coreInner', 'main+long', 'mid+long', 'long', 'main', 'mid+spiral+outerCore', 'mid', 'sba', 'spiral+core', 'spiral+mid', 'spiral+outerCore'], desc: str = 'Subarray')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str
value_select: list[str]
class ngect.api.Theta(*, value: float = -1, unit: str = 'arcsec', unit_select: list[str] = ['arcsec', 'mas'], desc: str = '')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list[str]
value: float
class ngect.api.Tos(*, value: float = 60, unit: str = 's', unit_select: list[str] = ['hr', 'min', 's'], desc: str = 'Time on Source')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
unit_select: list[str]
value: float
class ngect.api.Tsys(*, value: float, unit: str, desc: str = 'System Temeperature')

Bases: BaseModel

desc: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

unit: str
value: float
async ngect.api.ect(input: InputModel)

Calculate ngVLA exposure time and sensitivity parameters.

This endpoint performs exposure calculator computations for the next-generation Very Large Array (ngVLA), calculating sensitivity and observing time parameters based on input observational requirements.

The endpoint processes input parameters, performs array performance calculations, and returns detailed results including sensitivity metrics, system temperatures, and observing recommendations.

Parameters

inputInputModel

Input model containing observational parameters including:

  • frequency specifications

  • array configuration

  • observing mode settings

  • target sensitivity requirements

  • channel width and spectral settings

Returns

dict

Dictionary containing calculated exposure parameters with the following structure:

  • freq : Observing frequency with units

  • sigma_fl : Point source flux density sensitivity

  • sigma_tb : Brightness temperature sensitivity

  • tos : Required on-source observing time

  • rx_name : Selected receiver band name

  • rx_freq_min/max : Receiver frequency range

  • max_bw : Maximum available bandwidth

  • fov : Field of view

  • eta_A : Antenna efficiency

  • total_eff_A : Total effective area

  • t_sys : System temperature

  • sefd : System equivalent flux density

  • theta_max : Maximum angular resolution

  • theta : Synthesized beam size

  • chanwidth_freq/velo : Channel width in frequency/velocity units

  • eta_W : Weighting efficiency factor

  • LAS : Largest angular scale

  • num_ant : Number of antennas

  • samplers : Digitizer configuration

  • cf_level : Confusion limit

  • info : Processing log messages

Raises

HTTPException

Status 400 for invalid input parameters or calculation errors.

For out-of-range frequency errors, includes an X-ngect-suggestion header containing JSON with the nearest supported frequency recommendation.

Notes

The endpoint automatically:

  • Converts input units using astropy.units

  • Selects appropriate receiver bands based on frequency

  • Performs continuum and/or spectral line calculations

  • Provides detailed logging of calculation steps

  • Handles frequency validation with helpful suggestions

Examples

A typical successful response includes sensitivity calculations for both continuum and spectral line observing modes, with all physical quantities properly unit-tagged for scientific applications.

For invalid frequency inputs, the error response includes machine-readable suggestions for the nearest supported frequency via response headers.

See Also

InputModel : Request model schema OutputModel : Response model schema ArrayPerformance.ect : Core calculation engine

async ngect.api.get_ect_valid()

Return valid selections/ranges for the ECT input schema.

Builds a lightweight dictionary describing frontend-selectable options for each field in the InputModel, including descriptions, unit choices, value ranges, and enumerations. Also appends static configuration such as available subarray choices and default revision.

Returns

dict

Mapping of input field names to metadata suitable for populating UI controls, plus subarray_choices and default configrev.

ngect.api.home(request: Request)

Root handler that delegates to the status page.

ngect.api.lifespan(app: FastAPI)
ngect.api.start_api()
ngect.api.status(request: Request)

Render a simple service status page.

Parameters

requestfastapi.Request

Incoming request object used by the Jinja template renderer.

Returns

fastapi.responses.HTMLResponse

HTML page with a few runtime details (time, hostname, uptime, version).