spino.pipeline.nea_fetch module¶
NEA Catalog Fetch¶
Optional online fetch of the NASA Exoplanet Archive PS table via its TAP
service. On any failure (network error, timeout, HTTP error) the caller
should fall back to a local CSV (see resolve_catalog_path).
The column allow-list NEA_COLUMNS lists exactly the columns the phase
scheduler pipeline reads (plus a few extra magnitudes useful for GIANO-B
target selection). Restricting the SELECT keeps the cached CSV small and
makes the dependency between the pipeline and the catalog explicit.
- spino.pipeline.nea_fetch.fetch_nea_catalog(out_path, source='NEA', timeout=30)[source]¶
Query the NEA TAP service for
NEA_COLUMNSfrom thepstable, keeping onlyPublished Confirmedrows.sourcecontrols the WHERE clause:“NEA”: no extra filter (full PS confirmed) “TESS”: adds
AND disc_facility LIKE '%TESS%'“BOTH”: same as NEA (per-row source is derived downstream)Writes the response CSV atomically to
out_path.Raises any underlying
requests/ IO exception; the caller is responsible for catching and falling back.
- spino.pipeline.nea_fetch.resolve_catalog_path(source, online, catalog_dir, timeout=30)[source]¶
Decide which CSV path the pipeline should load for
source.The filename is always
PS_latest_{source}.csvinsidecatalog_dir. Ifonlineis True, attempt a fresh fetch into that file and return its path on success. On any failure print a single warning line and return the same path (the caller will load the local copy if it exists, or raise on read). Ifonlineis False, return the path directly without fetching.