I/O, extinction, and archive API

qsospec.query_galactic_ebv(ra, dec, config=None)[source]

Return applied E(B-V) and query provenance for one ICRS coordinate.

Parameters:
Return type:

Tuple[float, Dict[str, Any]]

qsospec.f99_dereddening_factor(wave_obs, ebv, rv=3.1)[source]

Return the multiplicative F99 dereddening factor.

Parameters:
Return type:

ndarray

qsospec.correct_spectrum(spectrum, *, ra=None, dec=None, config=None)[source]

Return a corrected in-memory spectrum and correction provenance.

Parameters:
Return type:

Tuple[Spectrum, Dict[str, Any]]

qsospec.correct_spectrum_data(spectrum, config=None)[source]

Apply the configured Galactic correction exactly once.

Parameters:
Return type:

SpectrumData

qsospec.prepare_spectrum(spectrum, *, galactic_extinction_config=None)[source]

Prepare an in-memory spectrum for fitting.

Array spectra are assumed to be uncorrected unless constructed with galactic_extinction_corrected=True. Correction is performed in the observed frame, then flux and uncertainty are normalized to rest-frame F_lambda. Both operations are recorded and applied exactly once.

Parameters:
Return type:

Spectrum

qsospec.preflight_galactic_extinction(config=None)[source]

Validate that the configured external dust map can be opened.

Parameters:

config (GalacticExtinctionConfig | None)

Return type:

None

qsospec.open_run(path)[source]

Open an existing run bundle.

Parameters:

path (str)

Return type:

RunStore

qsospec.load_model(run, identifier)[source]

Reconstruct a workflow result from the Parquet model archive.

Parameters:
  • run (str | RunStore)

  • identifier (str)

Return type:

WorkflowResult

qsospec.finalize_run(run, *, compact_models=False)[source]

Validate canonical datasets and finalize a resumable run.

Parameters:
  • run (str | RunStore)

  • compact_models (bool)

Return type:

Dict[str, str]

qsospec.build_science_catalog(run, specification=None, *, output_path=None)[source]

Materialize a provisional wide catalog from long measurements.

Parameters:
Return type:

DataFrame

qsospec.compute_derived_quantities(run, calculators)[source]

Run calibration-neutral user calculators and archive long-form results.

Parameters:
Return type:

DataFrame

qsospec.render_qa(run, *, object_ids=None, warning_codes=None, query=None, sample=None, random_seed=12345, include_failed=False, plot_config=None, output_dir=None)[source]

Render main QA figures without refitting archived objects.

Parameters:
Return type:

Dict[str, Dict[str, str]]

qsospec.write_global_line_products(result, output_dir, qa_plot_config=None)[source]

Write standard global-continuum and multi-complex products.

Parameters:
Return type:

Dict[str, str]

qsospec.write_global_hbeta_products(result, output_dir, qa_plot_config=None)[source]

Compatibility wrapper retaining H-beta summary/full-grid paths.

Parameters:
Return type:

Dict[str, str]

Templates

qsospec.list_iron_templates()[source]

Return supported canonical template names and references.

Return type:

Dict[str, str]

qsospec.load_iron_template(template, template_path=None, normalization='area')[source]

Load a bundled or user-provided iron template.

Parameters:
  • template (str)

  • template_path (str | None)

  • normalization (str)

Return type:

IronTemplate

qsospec.list_balmer_templates()[source]

Return bundled template names and their production/systematics status.

Return type:

Dict[str, str]

qsospec.load_balmer_template(*, log10_ne=9, n_min=6, provenance='sh95')[source]

Load one bundled Case-B, 15000 K Balmer line list.

Parameters:
  • log10_ne (int)

  • n_min (int)

  • provenance (str)

Return type:

BalmerSeriesTemplate