Fitting and workflow API

qsospec.fit_local(spectrum, config)[source]

Fit one or more local line-complex windows independently.

Parameters:
Return type:

LocalFitResult

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

Fit one local Gaussian line complex on the spectrum rest-frame grid.

Parameters:
Return type:

FitResult

qsospec.fit_global_continuum(spectrum, config=None, *, compute_covariance=True)[source]

Fit the global AGN continuum and resolve automatic power-law mode.

Parameters:
Return type:

GlobalContinuumResult

qsospec.fit_hbeta_complex(spectrum, continuum_result, config=None, *, compute_covariance=True)[source]

Fit core-only and optional wing H-beta/[O III] candidates.

Parameters:
Return type:

EmissionComplexResult

qsospec.fit_mgii_complex(spectrum, continuum_result, config=None, *, compute_covariance=True)[source]

Fit two broad Mg II components plus one narrow component.

Parameters:
Return type:

EmissionComplexResult

qsospec.fit_halpha_complex(spectrum, continuum_result, config=None, *, compute_covariance=True)[source]

Fit broad H-alpha plus tied narrow H-alpha/[N II]/[S II].

Parameters:
Return type:

EmissionComplexResult

qsospec.fit_global_lines(spectrum, global_config=None, hbeta_config=None, mgii_config=None, halpha_config=None, uncertainty_config=None, *, lya_nv_config=None, host_model_on_grid=None, complexes=None)[source]

Fit the global continuum and adaptively selected emission recipes.

Parameters:
Return type:

WorkflowResult

qsospec.fit_global_hbeta(spectrum, global_config=None, hbeta_config=None, uncertainty_config=None, *, host_model_on_grid=None)[source]

Compatibility wrapper for fit_global_lines().

Parameters:
Return type:

WorkflowResult

qsospec.fit_global_lines_workflow(input_path, *, row_index=None, redshift=None, object_id=None, run_host_decomp=False, template_root='~/tools/ppxf_data', template_file='spectra_emiles_9.0.npz', host_fit_range=(3600.0, 7000.0), host_config=None, galactic_extinction_config=None, global_config=None, hbeta_config=None, mgii_config=None, halpha_config=None, lya_nv_config=None, uncertainty_config=None, complexes=None)[source]

Read one spectrum and run optional pPXF plus global multi-line qsospec.

Parameters:
Return type:

WorkflowResult

qsospec.fit_global_hbeta_workflow(input_path, *, row_index=None, redshift=None, object_id=None, run_host_decomp=False, template_root='~/tools/ppxf_data', template_file='spectra_emiles_9.0.npz', host_fit_range=(3600.0, 7000.0), host_config=None, galactic_extinction_config=None, global_config=None, hbeta_config=None, uncertainty_config=None)[source]

Compatibility wrapper for fit_global_lines_workflow().

Parameters:
Return type:

WorkflowResult

qsospec.fit_with_optional_host_decomp(input_path, local_config=None, *, row_index=None, redshift=None, object_id=None, run_host_decomp=False, fit_kind='local', template_root='~/tools/ppxf_data', template_file='spectra_emiles_9.0.npz', host_fit_range=(3600.0, 7000.0), host_config=None, galactic_extinction_config=None, global_config=None, hbeta_config=None, mgii_config=None, halpha_config=None, lya_nv_config=None, uncertainty_config=None, complexes=None)[source]

Read a spectrum, optionally subtract a pPXF host, then run qsospec.

fit_kind may be "local" or "global".

Parameters:
qsospec.fit_object_to_store(input_data, run_directory, *, row_index=None, redshift=None, object_id=None, reader='auto', flux_unit=None, flux_scale=None, run_host_decomp=False, template_root='~/tools/ppxf_data', template_file='spectra_emiles_9.0.npz', host_fit_range=(3600.0, 7000.0), host_config=None, galactic_extinction_config=None, global_config=None, hbeta_config=None, mgii_config=None, halpha_config=None, lya_nv_config=None, uncertainty_config=None, complexes=None, run_id=None, resume=True, write_qa=True, qa_plot_config=None, write_legacy_products=False)[source]

Fit one object into the same run bundle used for batch fitting.

Parameters:
Return type:

WorkflowResult

qsospec.fit_batch(inputs, run_directory, *, row_indices=None, filter_expression=None, parquet_batch_size=128, task_size=8, n_workers='auto', num_shards=1, shard_index=0, run_host_decomp=False, template_root='~/tools/ppxf_data', template_file='spectra_emiles_9.0.npz', host_fit_range=(3600.0, 7000.0), host_config=None, galactic_extinction_config=None, global_config=None, hbeta_config=None, mgii_config=None, halpha_config=None, lya_nv_config=None, uncertainty_config=None, complexes=None, run_id=None, resume=True, retry_failures=True, finalize=True, compact_models=False, write_legacy_products=False)[source]

Fit a Parquet or FITS sample with resumable process parallelism.

Parameters:
Return type:

BatchResult