life_td_data_generation.provider package

life_td_data_generation.provider.utils module

Generates the data for the database for each of the data providers separately.

class provider.utils.IdentifierCreator(name: str, colname: str)

Bases: object

Create ADQL query builder for fetch_main_id using an identifier column.

create_main_id_query() str

Build the ADQL query that joins via SIMBAD ‘ident’ on identifiers.

Returns:

ADQL string with column alias and identifier join.

Return type:

str

class provider.utils.OidCreator(name: str, colname: str)

Bases: object

Create ADQL query builder for fetch_main_id using an ‘oid’ join column.

create_main_id_query() str

Build the ADQL query that joins SIMBAD basic on an ‘oid’ column.

Returns:

ADQL string with column alias and join.

Return type:

str

provider.utils.create_provider_table(provider_name: str, provider_url: str, provider_bibcode: str, provider_access: str = '2026-06-05') Table

Build a one-row provider metadata table.

Parameters:
  • provider_name (str) – Human-readable provider name.

  • provider_url (str) – TAP/base URL for the provider service.

  • provider_bibcode (str) – ADS bibcode or similar reference marker.

  • provider_access (str) – Access date (YYYY-MM-DD). Defaults to today.

Returns:

Table with provider metadata columns.

Return type:

astropy.table.Table

provider.utils.create_sources_table(tables: list[Table], ref_columns: list[list[str]], provider_name: str) Table

Build a sources table from multiple input tables and reference columns.

Parameters:
  • tables (list[astropy.table.table.Table]) – List of input tables to scan for references.

  • ref_columns (list[list[str]]) – Parallel list of reference-column name lists.

  • provider_name (str) – Provider label to attach to each reference.

Returns:

Final sources table with unique references.

Return type:

astropy.table.table.Table

provider.utils.distance_cut(cat: Table, colname: str, main_id: bool = True) Table

Filter a table by matching against SIMBAD objects inside the cut.

If main_id is True, match on main identifiers; otherwise match using an identifier table.

Parameters:
  • cat (astropy.table.table.Table) – Table to be matched against SIMBAD objects/identifiers.

  • colname (str) – Column name to use for matching.

  • main_id (bool) – If True, match on SIMBAD ‘main_id’, else on ‘id’.

Returns:

Reduced table keeping only matching entries.

Return type:

astropy.table.table.Table

provider.utils.fetch_main_id(cat: ~astropy.table.table.Table, id_creator: object = <provider.utils.OidCreator object>) Table

Attach SIMBAD main_id to a table via an ADQL join strategy.

The id_creator decides whether to join via ‘oid’ (OidCreator) or via identifiers (IdentifierCreator). The returned table is the uploaded table with an additional main_id-alias column.

Parameters:
  • cat (astropy.table.table.Table) – Table containing the join column (as decided by id_creator).

  • id_creator (object) – Strategy object with create_main_id_query() method. Typically OidCreator or IdentifierCreator.

Returns:

The uploaded table enriched with SIMBAD main_id.

Return type:

astropy.table.table.Table

provider.utils.fill_sources_table(cat: ~astropy.table.table.Table, ref_columns: list[str], provider: str, old_sources: ~astropy.table.table.Table = <Table length=0> <No columns>) Table

Create or update the sources table from reference columns of a table.

Entries are unique. Output has two columns: ‘ref’ and ‘provider_name’.

Parameters:
  • cat (astropy.table.table.Table) – Table on which to gather references.

  • ref_columns (list[str]) – Column names containing reference strings.

  • provider (str) – Provider name tag for all collected references.

  • old_sources (astropy.table.table.Table) – Previously created sources table to extend.

Returns:

Sources table containing unique refs and provider labels.

Return type:

astropy.table.table.Table

provider.utils.ids_from_ident(ident: Table, objects: Table) Table

Concatenate identifier entries of the same object into one ‘ids’ string.

Groups rows by main_id and joins ‘id’ values with the ‘|’ separator, adding one row per main_id into the objects table.

Parameters:
  • ident (astropy.table.table.Table) – Table containing ‘main_id’ and ‘id’ columns.

  • objects (astropy.table.table.Table) – Table to fill with concatenated identifiers.

Returns:

The updated objects table with ‘main_id’ and ‘ids’.

Return type:

astropy.table.table.Table

provider.utils.initiate_columns(table_obj: Table, columns: list[str], types: list[type], mask: list[bool]) Table

Initialize multiple columns on a table with dtype and mask settings.

Parameters:
  • table_obj (astropy.table.Table) – Table to receive the new columns.

  • columns (list[str]) – Column names to create.

  • types (list[type]) – Dtypes for the respective columns.

  • mask (list[bool]) – Mask flags; True -> MaskedColumn, False -> Column.

Returns:

The same table with the new columns added.

Return type:

astropy.table.Table

provider.utils.lower_quality(qual: str) str

Lower a quality flag by one step in the order A > B > C > D > E.

The function does not handle ‘?’ by design and returns it unchanged when passed.

Parameters:

qual (str) – Quality flag (‘A’..’E’ or others).

Returns:

Lowered quality flag (or unchanged if not applicable).

Return type:

str

provider.utils.nullvalues(cat: Table, colname: str, nullvalue: object, verbose: bool = False) Table

Fill masked entries in a given column with a specified value.

Parameters:
  • cat (astropy.table.table.Table) – Table containing the column to modify.

  • colname (str) – Name of the column to fill.

  • nullvalue (object) – Replacement value for masked entries.

  • verbose (bool) – If True, print a note if the column is not masked.

Returns:

Table with masked values replaced.

Return type:

astropy.table.table.Table

provider.utils.query(link: str, adql_query: str, upload_tables: list[Table] = [], no_description=True, sync=False) Table

Perform a TAP query against a service.

If upload tables are provided, they are made available to the service as TAP_UPLOAD tables.

Parameters:
  • link (str) – Service access URL.

  • adql_query (str) – Query to execute (ADQL).

  • upload_tables (list[astropy.table.table.Table]) – Optional tables to upload for join operations.

Returns:

Result table returned by the TAP service.

Return type:

astropy.table.table.Table

provider.utils.remove_catalog_description(cat: Table, no_description: bool) Table

Remove description metadata from all columns of a table.

Useful when merging catalogs has left descriptions inconsistent.

Parameters:
  • cat (astropy.table.table.Table) – Catalog to sanitize.

  • no_description (bool) – When True, clear all column descriptions.

Returns:

Catalog with cleared descriptions (if requested).

Return type:

astropy.table.table.Table

provider.utils.replace_value(cat: Table, colname: str, value: object, replace_by: object) Table

Replace all occurrences of a value in a column with another value.

Parameters:
  • cat (astropy.table.table.Table) – Table containing the column to modify.

  • colname (str) – Target column name.

  • value (object) – Value to be replaced.

  • replace_by (object) – Value to insert instead.

Returns:

Table with values replaced in the specified column.

Return type:

astropy.table.table.Table

provider.utils.sorting_number_of_id(input_column, occurences, match_column)
Parameters:
  • input_column

  • occurences

  • match_column – Column to with the return flag_array will belong

life_td_data_generation.provider.exo module

Generates the data for the database for the provider Exo-Mercat. Distance cut is performed by joining on life_db simbad objects.

provider.exo.align_quality_with_bestmass(exo_mes_mass_pl: Table) Table

Ensure msini/mass quality flags align with bestmass provenance.

For each planet (grouped by main_id), compares the qualities of the two entries (msini and mass) against bestmass and lowers the other when necessary to enforce a strict preference.

Parameters:

exo_mes_mass_pl (astropy.table.table.Table) – Unified mass table (mass and msini rows).

Returns:

Mass table with adjusted ‘mass_pl_qual’ values.

Return type:

astropy.table.table.Table

provider.exo.assign_new_qual(exo_mes_mass_pl: Table, main_id: str, flag: str, new_qual: str) Table

Assign a new quality to one entry selected by planet id and sini-flag.

Parameters:
  • exo_mes_mass_pl (astropy.table.table.Table) – Unified mass table (mass+msini entries).

  • main_id (str) – Planet ‘main_id’ identifying the target object.

  • flag (str) – ‘True’ for msini, ‘False’ for mass.

  • new_qual (str) – New quality flag to set.

Returns:

Table with updated quality for the matching entry.

Return type:

astropy.table.table.Table

provider.exo.bestmass_better_qual(bestmass: str, qual_msini: str, qual_mass: str) tuple[str, str]

Reconcile quality flags based on the chosen best-mass provenance.

If bestmass indicates ‘Mass’, then a same-or-better msini quality is lowered. Conversely for ‘Msini’. This recursion continues until both qualities are consistent with the chosen bestmass.

Parameters:
  • bestmass (str) – ‘Mass’ or ‘Msini’ provenance marker.

  • qual_msini (str) – Quality for the msini measurement.

  • qual_mass (str) – Quality for the mass measurement.

Returns:

Tuple of possibly adjusted (qual_msini, qual_mass).

Return type:

tuple[str, str]

provider.exo.betterthan(qual1: str, qual2: str) bool

Compare Exo-MerCat/DB quality flags.

Returns True if qual1 is strictly better than qual2 according to the order A > B > C > D > E > ?.

Parameters:
  • qual1 (str) – Candidate quality flag.

  • qual2 (str) – Other quality flag.

Returns:

True if qual1 ranks better than qual2, else False.

Return type:

bool

provider.exo.create_exo_helpertable() tuple[dict, Table]

Create the Exo-MerCat helper table used downstream.

Steps: 1. Query or load Exo-MerCat base data (provider dict + raw table). 2. Build host/planet canonical ids (host_main_id, planet_main_id). 3. Apply distance cut (via SIMBAD join) and strip whitespace. 4. Fetch SIMBAD planet names and left-join them. 5. Save a table of removed objects for auditing. 6. Return provider dict and finalized helper table.

Returns:

Tuple of (provider dict, helper table).

Return type:

tuple[dict[str, Table], astropy.table.table.Table]

provider.exo.create_exo_sources_table(exo: dict[str, Table]) Table

Create the unified sources table for Exo-MerCat-derived data.

Collects and de-duplicates reference strings from multiple tables (provider, h_link, ident, mes_mass_pl) and tags them with the provider name.

Parameters:

exo (dict[str, astropy.table.table.Table]) – Provider dict with the listed tables present.

Returns:

Sources table with columns ‘ref’ and ‘provider_name’.

Return type:

astropy.table.table.Table

Create the hierarchical link table for planet-to-host relations.

The link connects child ‘main_id’ (planet) to ‘parent_main_id’ (host). A uniform reference column is filled using the Exo-MerCat provider bibcode.

Parameters:
  • exo_helptab (astropy.table.table.Table) – Helper table with ‘planet_main_id’ and ‘host_main_id’.

  • exo (dict[str, astropy.table.table.Table]) – Provider dict containing ‘provider’ table with ‘provider_bibcode’.

Returns:

h_link table with ‘main_id’, ‘parent_main_id’, ‘h_link_ref’.

Return type:

astropy.table.table.Table

provider.exo.create_ident_table(exo_helptab: Table, exo: dict[str, Table]) tuple[Table, Table]

Create the identifier table for Exo-MerCat objects.

For each row in the helper table this function emits two identifier rows: - (main_id, main_id, id_ref) where id_ref comes from SIMBAD if

sim_planet_main_id is available, otherwise from Exo-MerCat.

  • (main_id, exomercat_name, exomercat_bibcode) as the Exo-MerCat alias.

If sim_planet_main_id is not empty, planet_main_id in the helper table is replaced with that SIMBAD value. This matches downstream expectations (e.g. uniqueness, join behavior).

Parameters:
  • exo_helptab (astropy.table.table.Table) – Helper table with ‘planet_main_id’, ‘sim_planet_main_id’ and ‘exomercat_name’ columns.

  • exo (dict[str, astropy.table.table.Table]) – Provider dict containing the ‘provider’ table with ‘provider_bibcode’.

Returns:

Tuple of (identifier table, possibly updated helper table).

Return type:

tuple[astropy.table.table.Table, astropy.table.table.Table]

provider.exo.create_mes_mass_pl_table(exo_helptab: Table) Table

Create the planetary mass-measurement table (mass and msini entries).

Steps: - Normalize mass columns and assign initial qualities. - Build separate tables for ‘mass’ (flag=False) and ‘msini’ (flag=True). - Vertically stack, de-duplicate, then align qualities with bestmass.

Parameters:

exo_helptab (astropy.table.table.Table) – Helper table with mass and msini columns.

Returns:

Unified planetary mass table.

Return type:

astropy.table.table.Table

provider.exo.create_object_main_id(exo_helptab: Table) Table

Build canonical main identifiers for host and planet objects.

Constructs: - host_main_id: host name augmented with a binary component (if present). - planet_main_id: host_main_id + letter (planet label).

The inputs can contain masked values (astropy masked columns). This function preserves those semantics and falls back to the ‘host’ column if ‘main_id’ is masked.

Parameters:

exo_helptab (astropy.table.table.Table) – Raw Exo-MerCat helper table with columns ‘main_id’, ‘host’, ‘binary’ and ‘letter’.

Returns:

The same table with ‘host_main_id’ and ‘planet_main_id’ added.

Return type:

astropy.table.table.Table

provider.exo.create_objects_table(exo: dict[str, Table]) Table

Create the objects table from identifiers.

Builds a unique list of objects from the identifier table and assigns object type ‘pl’ (planet) for all entries produced by the Exo-MerCat provider.

Parameters:

exo (dict[str, astropy.table.table.Table]) – Provider dict that contains ‘ident’ table with columns ‘main_id’ and ‘id’.

Returns:

Objects table with columns ‘main_id’, ‘ids’, and ‘type’.

Return type:

astropy.table.table.Table

provider.exo.create_para_exo_mes_mass_pl(exo_helptab: Table, para: str, sini_flag: str) Table

Extract a single-parameter planet-mass table (mass or msini).

Selects columns for the given parameter, renames them to the unified ‘mes_mass_pl’ schema, assigns the sin(i) flag, and filters out rows with placeholder values.

Parameters:
  • exo_helptab (astropy.table.table.Table) – Normalized helper table with mass columns present.

  • para (str) – Parameter to extract (‘mass’ or ‘msini’).

  • sini_flag (str) – ‘True’ when para is ‘msini’, else ‘False’.

Returns:

Parameter-specific mass table in unified format.

Return type:

astropy.table.table.Table

provider.exo.deal_with_mass_nullvalues(exo_helptab: Table, cols: list[str]) Table

Normalize null and infinite values in mass-related columns.

Replaces masked and sentinel values in the given columns using the shared null-handling utilities. This makes downstream filtering consistent and avoids NaN/Inf artifacts in calculations.

Parameters:
  • exo_helptab (astropy.table.table.Table) – Helper table with mass-like columns to normalize.

  • cols (list[str]) – Column names to normalize (e.g. ‘mass’, ‘msini’, …).

Returns:

Table with normalized mass columns.

Return type:

astropy.table.table.Table

provider.exo.load_exomercat(exo: dict) Table

Load a previously exported Exo-MerCat helper table from local storage.

This is used as a fallback when the remote TAP service is not reachable.

Parameters:

exo (dict[str, Table]) – Mutable dictionary that will receive the provider table. Expected to be the shared provider dict used through this module.

Returns:

The locally loaded Exo-MerCat helper table.

Return type:

astropy.table.table.Table

provider.exo.provider_exo() dict[str, Table]

Build and persist the full Exo-MerCat provider dataset.

Pipeline: 1. Build helper table (query/load, ids, distance cut, SIMBAD join). 2. Create identifier and object tables. 3. Build the planet mass measurement table (mass + msini). 4. Create hierarchical links and the unified sources table. 5. Save all provider tables for reuse and return them.

Returns:

Provider dictionary with all Exo-MerCat tables.

Return type:

dict[str, astropy.table.table.Table]

provider.exo.query_exomercat(adql_query: str, exo: dict) Table

Query the Exo-MerCat TAP service for the helper table.

Parameters:
  • adql_query (str) – ADQL query string executed on the Exo-MerCat TAP service.

  • exo (dict[str, Table]) – Mutable dictionary that will receive the provider table. Expected to be the shared provider dict used through this module.

Returns:

The queried Exo-MerCat helper table.

Return type:

astropy.table.table.Table

provider.exo.query_or_load_exomercat() tuple[dict, Table]

Get the Exo-MerCat helper table either via TAP or from local backup.

Tries the live TAP query first. If that fails (e.g. server down), a shipped CSV snapshot is loaded instead. The returned provider dict is the shared container used throughout the Exo provider pipeline.

Returns:

Tuple of (provider dict, helper table).

Return type:

tuple[dict[str, Table], astropy.table.table.Table]

life_td_data_generation.provider.gaia module

Generates the data for the database for the provider gaia.

provider.gaia.create_gaia_helpertable(distance_cut_in_pc)

Creates helper table.

If the gaia server asynchronous query is not working a temporary method to use the synchronous query is used.

Parameters:

distance_cut_in_pc (float) – Distance up to which stars are included.

Returns:

Helper table.

Return type:

astropy.table.table.Table

provider.gaia.create_gaia_sources_table(gaia)

Creates sources table.

Parameters:

gaia (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Sources table.

Return type:

astropy.table.table.Table

provider.gaia.create_ident_table(gaia_helptab)

Creates identifier table.

Parameters:

gaia_helptab (astropy.table.table.Table) – Gaia helper table.

Returns:

Identifier table and gaia helper table.

Return type:

astropy.table.table.Table, astropy.table.table.Table

provider.gaia.create_mes_binary_table(gaia)

Creates binarity measurement table.

Parameters:

gaia (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Binarity measurement table.

Return type:

astropy.table.table.Table

provider.gaia.create_mes_mass_st_table(gaia_helptab)

Creates stellar mass table.

Parameters:

gaia_helptab (astropy.table.table.Table) – Gaia helper table.

Returns:

Stellar masse table.

Return type:

astropy.table.table.Table

provider.gaia.create_mes_radius_st_table(gaia_helptab)

Creates stellar radius table.

Parameters:

gaia_helptab (astropy.table.table.Table) – Gaia helper table.

Returns:

Stellar radius table.

Return type:

astropy.table.table.Table

provider.gaia.create_mes_teff_st_table(gaia_helptab)

Creates stellar effective temperature table.

Parameters:

gaia_helptab (astropy.table.table.Table) – Gaia helper table.

Returns:

Stellar effective temperature table.

Return type:

astropy.table.table.Table

provider.gaia.create_objects_table(gaia_helptab, gaia)

Creates objects table.

Parameters:
  • gaia_helptab (astropy.table.table.Table) – Gaia helper table.

  • gaia (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Objects table.

Return type:

astropy.table.table.Table

provider.gaia.provider_gaia(distance_cut_in_pc)

Obtains and arranges gaia data.

Parameters:

distance_cut_in_pc (float) – Distance up to which stars are included.

Returns:

Dictionary with names and astropy tables containing reference data, provider data, object data, identifier data, stellar effective temperature, radius, mass and binarity data.

Return type:

dict(str,astropy.table.table.Table)

life_td_data_generation.provider.life module

Generates the data for the database for the provider LIFE.

provider.life.assign_diff_lum_classes(i, sptype, table)

Note that the class_lum parameter from the LIFE Target Database assumes V if no luminosity class is given in the sptype_string parameter. This is justified as the main sequence is the longest lasting evolutionary period of a star leaving the great majority of stars in this stage. This assumption was previously neccessary as the in previous LIFE-StarCat versions estimated stellar effective temperature, mass and radius values use a relation requiring luminosity class V.

provider.life.assign_null_values(table, index)

Sets table entry to ‘?’ for given index in specific columns.

Parameters:
  • table (astropy.table.table.Table) – Table containing columns class_temp, class_temp_nr, class_lum and class_ref.

  • index (int) – Index of entry.

provider.life.create_life_helpertable(life)

Creates helper table.

Parameters:

life (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Helper table.

Return type:

astropy.table.table.Table

provider.life.create_life_sources_table(life)

Creates sources table.

Parameters:

life (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Sources table.

Return type:

astropy.table.table.Table

provider.life.create_mes_mass_st_table(life_helptab)

Creates stellar mass table.

Parameters:

life_helptab (astropy.table.table.Table) – Life helper table.

Returns:

Stellar mass table.

Return type:

astropy.table.table.Table

provider.life.create_mes_radius_st_table(life_helptab)

Creates stellar radius table.

Parameters:

life_helptab (astropy.table.table.Table) – Life helper table.

Returns:

Stellar radius table.

Return type:

astropy.table.table.Table

provider.life.create_mes_teff_st_table(life_helptab)

Creates stellar effective temperature table.

Parameters:

life_helptab (astropy.table.table.Table) – Life helper table.

Returns:

Stellar effective temperature table.

Return type:

astropy.table.table.Table

provider.life.create_star_basic_table()

Creates basic stellar data table.

Returns:

Dictionary of database table names and tables with filled basic stellar data table.

Return type:

dict(str,astropy.table.table.Table)

provider.life.deal_with_leading_d_sptype(table, index)

Deals with old annotation of leading d in spectraltype representing dwarf star.

Parameters:
  • table (astropy.table.table.Table) – Table containing column ‘sptype_string’.

  • index (int) – Index of entry.

Returns:

Entry with leading d removed.

Return type:

str

provider.life.deal_with_middle_minus(sptype_string)

Removes intermediate minus sign from sptype_string.

Parameters:

sptype_string (str)

Returns:

Entry with middle - removed.

Return type:

str

provider.life.decimal_sptype(i, sptype, table)
provider.life.extract_lum_class(nr, sptype)

Extracts luminocity class.

Parameters:
  • nr (int) – index number

  • sptype (str) – spectral type

Returns:

luminocity class

Return type:

str

provider.life.match_sptype(cat, sptypestring='mp_specmatch', teffstring='mod_Teff', rstring='mod_R', mstring='mod_M')

Assigns modeled parameter values.

Matches the spectral types with the ones in Mamajek’s table and includes the modeled effective Temperature, stellar radius and stellar mass into the catalog.

Parameters:
  • cat (astropy.table.table.Table) – astropy table containing spectral type information

  • sptypestring (str) – Column name where the spectral type information is located

  • teffstring (str) – Column name for the stellar effective temperature column

  • rstring (str) – Column name for the stellar radius column

  • mstring (str) – Column name for the stellar mass column

Returns:

Table cat with added new columns for effective temperature, radius and mass filled with model values

Return type:

astropy.table.table.Table

provider.life.modeled_param()

Loads and cleans up model file.

Loads the table of Eric E. Mamajek containing stellar parameters modeled from spectral types. Cleans up the columns for spectral type, effective temperature radius and mass.

Returns:

Table of the 4 parameters as columns

Return type:

astropy.table.table.Table

provider.life.provider_life()

Loads SIMBAD data and postprocesses it.

Postprocessing enables to provide more useful information. It uses a model from Eric E. Mamajek to predict temperature, mass and radius from the simbad spectral type data.

Returns:

Dictionary with names and astropy tables containing reference data, provider data, basic stellar data, stellar effective temperature data, stellar radius data and stellar mass data.

Return type:

dict(str,astropy.table.table.Table)

provider.life.realspectype(cat)

Removes rows not containing main sequence stars.

Removes rows of cat where elements in column named ‘sim_sptype’ are either ‘’, ‘nan’ or start with another letter than the main sequence spectral type classification.

Parameters:

cat (astropy.table.table.Table) – Table containing class_temp and class_lum column

Returns:

Table, param cat with undesired rows removed

Return type:

astropy.table.table.Table

provider.life.spec(cat)

Runs the spectral type related functions realspectype and match_sptype.

It also removes all empty columns of the effective temperature, removes rows that are not main sequence, removes rows with binary subtype and non unique simbad name.

Parameters:

cat (astropy.table.table.Table) – astropy table containing columns named ‘main_id’, class_temp_nr, class_temp and,class_lum

Returns:

Catalog of mainsequence stars with unique simbad names, no binary subtypes and modeled parameters.

Return type:

astropy.table.table.Table

provider.life.sptype_string_to_class(table, ref)

Extracts stellar parameters from spectral type string one.

This function extracts the temperature class, temperature class number and luminocity class information from the spectral type string (e.g. M5V to M, 5 and V). It stores that information in the for this purpose generated new columns. Only objects of temperature class O, B, A, F, G, K, and M are processed. Only objects of luminocity class IV, V and VI are processed.

Parameters:
  • table (astropy.table.table.Table) – Table containing spectral type information in the column sptype_string.

  • ref (str) – Designates origin of data.

Returns:

Table like temp with additional columns class_temp, class_temp_nr, class_lum and class_ref.

Return type:

astropy.table.table.Table

provider.life.triple_star_handling()

life_td_data_generation.provider.sdb module

Acquires and processes the data from the provider sdb. Requires server connection to SIMBAD.

provider.sdb.create_disk_basic_table(sdb_helptab)

Creates basic disk data table.

Parameters:

sdb_helptab (astropy.table.table.Table) – Sdb helper table.

Returns:

Basic disk data table.

Return type:

astropy.table.table.Table

Creates hierarchical link table.

Parameters:

sdb_helptab (astropy.table.table.Table) – Sdb helper table.

Returns:

Hierarchical link table.

Return type:

astropy.table.table.Table

provider.sdb.create_ident_table(sdb_helptab)

Creates identifier table.

Parameters:

sdb_helptab (astropy.table.table.Table) – Sdb helper table.

Returns:

Identifier table.

Return type:

astropy.table.table.Table

provider.sdb.create_objects_table(sdb_helptab)

Creates objects table.

Parameters:

sdb_helptab (astropy.table.table.Table) – Sdb helper table.

Returns:

Objects table.

Return type:

astropy.table.table.Table

provider.sdb.create_sdb_helpertable(distance_cut_in_pc, sdb_ref, data)

Creates helper table.

Parameters:
  • distance_cut_in_pc (float) – Distance up to which stars are included.

  • sdb_ref (str) – Reference information for the sdb data.

  • data (astropy.table.table.Table) – Table containing sdb data.

Returns:

Helper table.

Return type:

astropy.table.table.Table

provider.sdb.create_sdb_sources_table(sdb_helptab, sdb)

Creates sources table.

Parameters:
  • sdb_helptab (astropy.table.table.Table) – Sdb helper table.

  • sdb (dict(str,astropy.table.table.Table)) – Dictionary of database table names and tables.

Returns:

Sources table.

Return type:

astropy.table.table.Table

provider.sdb.provider_sdb(distance_cut_in_pc, data)

Optains and arranges disk data.

Parameters:
  • distance_cut_in_pc (float) – Distance up to which stars are included.

  • data – Table containing sdb data.

Returns:

Dictionary with names and astropy tables containing reference data, provider data, object data, identifier data, object to object relation data and basic disk data.

Return type:

dict(str,astropy.table.table.Table)

life_td_data_generation.provider.simbad module

Generates the data for the database for each of the data providers separately.

Create the hierarchical link (parent-child) table.

Filters to hierarchical multiples (i.e., removes cluster/association although there shouldn’t be any in this distance cut anyways), resolves parent oids to main_ids, normalizes null values, and adds reference information.

Parameters:
  • sim_helptab (astropy.table.Table) – Main SIMBAD helper table.

  • sim (dict[str, astropy.table.Table]) – Dictionary of database table names and tables.

  • stars (astropy.table.Table) – Secondary SIMBAD helper table.

Returns:

Hierarchical link table with parent_main_id, main_id, membership, and h_link_ref.

Return type:

astropy.table.Table

provider.simbad.create_ident_table(sim_helptab: Table, sim: dict[str, Table]) Table

Create the identifier table.

Upload the object IDs to SIMBAD to fetch the corresponding identifiers (id) and add a reference column.

Parameters:
  • sim_helptab (astropy.table.Table) – Main SIMBAD helper table.

  • sim (dict[str, astropy.table.Table]) – Dictionary of database table names and tables.

Returns:

Identifier table with id and id_ref columns.

Return type:

astropy.table.Table

provider.simbad.create_objects_table(sim_helptab: Table, stars: Table) Table

Create the objects table.

Combines unique planet rows with star/system rows, keeping main_id, ids, and type.

Parameters:
  • sim_helptab (astropy.table.Table) – Main SIMBAD helper table.

  • stars (astropy.table.Table) – Secondary SIMBAD helper table.

Returns:

Objects table with main_id, ids, and type.

Return type:

astropy.table.Table

provider.simbad.create_sim_sources_table(stars: Table, sim: dict[str, Table]) Table

Create the sources table.

Collects and normalizes reference columns from provider, stars, h_link, and ident tables into a unified sources table.

Parameters:
  • sim (dict[str, astropy.table.Table]) – Dictionary of database table names and tables.

  • stars (astropy.table.Table) – Secondary SIMBAD helper table.

Returns:

Sources table with deduplicated references.

Return type:

astropy.table.Table

provider.simbad.create_simbad_helpertable(distance_cut_in_pc: float, test_objects: Sequence[str] | None) tuple[Table, dict[str, Table]]

Create the main SIMBAD helper table.

Parameters:
  • distance_cut_in_pc (float) – Distance up to which stars are included (pc).

  • test_objects (list[str] or None) – Optional list of object names to trace through the filtering pipeline for debugging.

Returns:

Helper table and a dictionary of database tables.

Return type:

(astropy.table.Table, dict[str, astropy.table.Table])

provider.simbad.create_star_basic_table(stars: Table) Table

Create the table with basic stellar data.

Converts certain columns to strings to support downstream joins that rely on fixed-width string dtype compatibility.

Parameters:

stars (astropy.table.Table) – Secondary SIMBAD helper table.

Returns:

Basic stellar data table.

Return type:

astropy.table.Table

provider.simbad.creating_helpertable_stars(sim_helptab: Table) Table

Create a helper table for stars.

Removes planets, de-duplicates by main_id, and returns the table that contains only systems and stars.

Parameters:
  • sim_helptab (astropy.table.Table) – Main SIMBAD helper table.

  • sim (dict[str, astropy.table.Table]) – Dictionary of database table names and tables.

Returns:

Helper table for star/system entries.

Return type:

astropy.table.Table

provider.simbad.expanding_helpertable_stars(sim_helptab: Table, sim: dict[str, Table], stars: Table) Table

Expand the star helper table with additional fields and quality flags.

Updates the multiplicity type for certain systems, sets binary flags, normalizes reference fields, and assigns quality flags.

Parameters:
  • sim_helptab (astropy.table.Table) – Main SIMBAD helper table.

  • sim (dict[str, astropy.table.Table]) – Dictionary of database table names and tables.

  • stars (astropy.table.Table) – Secondary SIMBAD helper table.

Returns:

Expanded star helper table.

Return type:

astropy.table.Table

provider.simbad.main_adql_queries(plx_cut: float) str

Build the main ADQL query for SIMBAD with a parallax cut.

Parameters:

plx_cut (float) – Minimum parallax in milliarcseconds to include.

Returns:

Complete ADQL string for the TAP service.

Return type:

str

provider.simbad.provider_simbad(distance_cut_in_pc: float, test_objects: Sequence[str] | None = None) dict[str, Table]

Obtain and arrange SIMBAD data.

Runs the SIMBAD queries, builds helper tables, expands star data with quality flags and references, and assembles the final set of SIMBAD provider tables.

Parameters:
  • distance_cut_in_pc (float) – Distance up to which stars are included (pc).

  • test_objects (list[str] or None) – Optional list of object names to trace through the filtering pipeline for debugging.

Returns:

Dictionary of SIMBAD tables (sources, provider, objects, ident, h_link, star_basic, mes_binary).

Return type:

dict[str, astropy.table.Table]

provider.simbad.stars_in_multiple_system(cat: Table, sim_h_link: Table, all_objects: Table) Table

Assign object type “st” to a subset of systems.

Assign the object type “st” to those entries in a system table that are members of multiple systems but do not have stellar children.

Parameters:
  • cat (astropy.table.Table) – Table alias containing objects of type “sy”.

  • sim_h_link (astropy.table.Table) – Table with columns parent_main_id, main_id and h_link_ref (parent-child pairs).

  • all_objects (astropy.table.Table) – Table copy containing columns main_id and type. Rows are all objects with child objects and their children.

Returns:

The input table with selected rows having their type set to “st”.

Return type:

astropy.table.Table

life_td_data_generation.provider.wds module

Generate WDS provider data for the database.

provider.wds.assign_names(wds_helptab: Table) Table

Assign WDS system/component names.

Parameters:

wds_helptab (astropy.table.Table) – Raw WDS helper table.

Returns:

Helper table with name columns populated.

Return type:

astropy.table.Table

Create identifier and hierarchical-link tables.

Parameters:
  • wds_helptab (astropy.table.Table) – WDS helper table.

  • wds (dict[str, astropy.table.Table]) – Provider dictionary.

  • test_objects (collections.abc.Sequence[str]) – Debug object identifiers.

Returns:

Identifier and hierarchical-link tables.

Return type:

tuple[astropy.table.Table, astropy.table.Table]

provider.wds.create_mes_binary_table(wds_helptab: Table, wds: dict[str, Table], test_objects: Sequence[str]) Table

Create the binary measurement table.

Parameters:
  • wds_helptab (astropy.table.Table) – WDS helper table.

  • wds (dict[str, astropy.table.Table]) – Provider dictionary.

  • test_objects (collections.abc.Sequence[str]) – Debug object identifiers.

Returns:

Binary measurement table.

Return type:

astropy.table.Table

provider.wds.create_mes_sep_ang_table(wds_helptab: Table, wds: dict[str, Table], test_objects: Sequence[str]) Table

Create the angular-separation measurement table.

Parameters:
  • wds_helptab (astropy.table.Table) – WDS helper table.

  • wds (dict[str, astropy.table.Table]) – Provider dictionary.

  • test_objects (collections.abc.Sequence[str]) – Debug object identifiers.

Returns:

Angular-separation measurement table.

Return type:

astropy.table.Table

provider.wds.create_objects_table(wds_helptab: Table, wds: dict[str, Table], test_objects: Sequence[str]) Table

Create the object table.

Objects start as systems, then objects without children are reclassified as stars.

Parameters:
  • wds_helptab (astropy.table.Table) – WDS helper table.

  • wds (dict[str, astropy.table.Table]) – Provider dictionary.

  • test_objects (collections.abc.Sequence[str]) – Debug object identifiers.

Returns:

Object table.

Return type:

astropy.table.Table

provider.wds.create_wds_helpertable(temp: bool, test_objects: Sequence[str]) tuple[Table, dict[str, Table]]

Create the WDS helper table and provider metadata.

Parameters:
  • temp (bool) – If True, load the cached helper table.

  • test_objects (collections.abc.Sequence[str]) – Debug object identifiers.

Returns:

Helper table and provider dictionary.

Return type:

tuple[astropy.table.Table, dict[str, astropy.table.Table]]

provider.wds.create_wds_helptab(adql_query: list[str], test_objects: ndarray, wds: dict[str, Table]) Table

Query WDS and build the helper table.

Parameters:
  • adql_query (list[str]) – Query list; the first query is used here.

  • test_objects (numpy.ndarray) – Objects used for debug prints.

  • wds (dict[str, astropy.table.Table]) – Provider table dictionary.

Returns:

WDS helper table.

Return type:

astropy.table.Table

provider.wds.create_wds_sources_table(wds: dict[str, Table]) Table

Create the sources table.

Parameters:

wds (dict[str, astropy.table.Table]) – Provider dictionary.

Returns:

Sources table.

Return type:

astropy.table.Table

provider.wds.load_wds_helptab() Table

Load the cached WDS helper table.

Returns:

Cached WDS helper table.

Return type:

astropy.table.Table

provider.wds.look_at_test_objects_after_name_assignment(test_objects: ndarray, wds_helptab: Table) None

Print which test objects match the derived WDS name columns.

provider.wds.look_at_test_objects_after_wds_creation(test_objects: ndarray, wds_helptab: Table) None

Print which test objects match the main-id columns after creation.

provider.wds.provider_wds(temp: bool = False, test_objects: Sequence[str] | None = None) dict[str, Table]

Build all WDS provider tables.

Parameters:
  • temp (bool) – If True, load cached helper data instead of querying.

  • test_objects (collections.abc.Sequence[str] | None) – Debug object identifiers. Defaults to an empty list.

Returns:

Provider table dictionary.

Return type:

dict[str, astropy.table.Table]