specdash package

Submodules

specdash.app_layout module

specdash.app_layout.get_docs_layout()[source]
specdash.app_layout.get_documentation_page_layout(self)[source]
specdash.app_layout.get_navbar()[source]
specdash.app_layout.get_spectrum_page_layout(self)[source]
specdash.app_layout.load_app_layout(self)[source]

specdash.callbacks module

specdash.callbacks.load_callbacks(self)[source]

specdash.colors module

specdash.colors.get_next_color(previous_colors)[source]

specdash.config module

specdash.flux module

specdash.flux.abmag_to_flambda(abmag, lam, wavelength_unit)[source]
specdash.flux.abmag_to_fnu(abmag)[source]
specdash.flux.abmag_to_jansky(abmag)[source]
specdash.flux.convert_flux(flux=[], wavelength=[], from_flux_unit='F_lambda', to_flux_unit='F_lambda', to_wavelength_unit='angstrom')[source]
specdash.flux.convert_wavelength(wavelength, from_wavelength_unit='angstrom', to_wavelength_unit='angstrom')[source]
specdash.flux.flambda_to_abmag(flam, lam, wavelength_unit)[source]
specdash.flux.flambda_to_fnu(flam, lam, wavelength_unit)[source]
specdash.flux.flambda_to_jansky(flam, lam, wavelength_unit)[source]
specdash.flux.fnu_to_abmag(fnu)[source]
specdash.flux.fnu_to_flambda(fnu, lam, wavelength_unit)[source]
specdash.flux.fnu_to_jansky(fnu)[source]
specdash.flux.jansky_to_absmag(jy)[source]
specdash.flux.jansky_to_flambda(jy, lam, wavelength_unit)[source]
specdash.flux.jansky_to_fnu(jy)[source]

specdash.spectral_lines module

specdash.spectral_lines.get_artificial_lines()[source]
specdash.spectral_lines.get_sky_lines()[source]
specdash.spectral_lines.get_spectral_lines()[source]
specdash.spectral_lines.get_spectral_lines_from_json()[source]

specdash.utilities module

specdash.utilities.get_specid_list(specid_text)[source]
specdash.utilities.get_unused_port(initial_port, address='127.0.0.1', max_tries=10)[source]
specdash.utilities.is_server_port_used(address, port)[source]

specdash.viewer module

class specdash.viewer.Viewer(as_website=False)[source]

Bases: object

Class representing the spectrum viewer object.

APP_DATA_KEYS = ['traces', 'fitted_models', 'selection', 'smoothing_kernel_types', 'fitting_model_types', 'redshift_distributions', 'metadata', 'line_analysis', 'axis_units', 'updates', 'trace_store_mapping', 'zdist_store_mapping']
add_spectrum(spectrum, is_visible=True)[source]
Parameters
  • spectrum

  • is_visible

add_spectrum_from_file(file_path, catalog_name, display_name=None, to_wavelength_unit=None, to_flux_unit=None)[source]
Parameters
  • file_path

  • catalog_name

  • display_name

  • to_wavelength_unit

  • to_flux_unit

add_spectrum_from_id(specid, catalog_name, display_name=None, to_wavelength_unit=None, to_flux_unit=None)[source]
Parameters
  • specid

  • catalog_name

  • display_name

  • to_wavelength_unit

  • to_flux_unit

static build_app_data()[source]
static build_graph_settings(axis_units_changed=False)[source]
fit_model(trace_name, median_filter_width=1, add_fit_substracted_trace=False)[source]
Parameters
  • trace_name

  • median_filter_width

  • add_fit_substracted_trace

get_catalog_names()[source]
get_data_dict(data)[source]
get_data_selection()[source]
get_spectrum(name)[source]
Parameters

name

get_trace_names()[source]
initialize_api_endpoints()[source]
remove_trace(name, also_remove_children=True)[source]
Parameters
  • name

  • also_remove_children

reset_smoothing(trace_name)[source]

Resets the smoothing previously done on trace :param trace_name: name of trace :return:

set_axis_units(wavelength_unit='angstrom', flux_unit='F_lambda')[source]
Parameters
  • wavelength_unit

  • flux_unit

set_custom_model_fitter(model, fitter)[source]

Sets the instances of a model and fitter in order to perform model fitting on a trace. :param model: model instance :param fitter: fitter instance :return:

set_data_selection(trace_name, selection_indices=[])[source]
Parameters
  • trace_name

  • selection_indices

set_model_fitter(trace_name, fitting_model='gaussian + linear')[source]

Sets the instances of a model and fitter in order to perform model fitting on a trace. :param model: model instance :param fitter: fitter instance :return:

set_smoothing_kernel(kernel='Gaussian', kernel_width=20, custom_array_kernel=None, custom_kernel_function=None, function_array_size=21)[source]

Sets the smoothing kernel from several kernel options :param kernel: :param kernel_width: :param custom_array_kernel: :param custom_kernel_function: :param function_array_size: :return:

show_jupyter_app(debug=False, mode='jupyterlab')[source]

Opens the Spectrum Viewer inside Jupyter. :param debug: :param mode: :return:

smooth_trace(trace_name, do_substract=False)[source]

Smooths a trace after the kernel is set with ‘set_smoothing_kernel’ :param trace_name: name of trace :param do_substract: True if the smoothed trace is substraced from the original trace. False otherwise. :return:

toggle(name=None, is_visible=True, all_traces=True)[source]
Parameters
  • name

  • is_visible

  • all_traces

update_client(component_names=[], timestamp=None)[source]
update_trace(name, trace)[source]
Parameters
  • name

  • trace

write_info(info, file_endding='')[source]

Module contents