specbox.qtmodule

Package

class specbox.qtmodule.PGSpecPlot(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Interactive spectrum viewer based on pyqtgraph.

This widget was originally developed for Euclid SIR 1D spectra but has been generalized to handle any spectrum class derived from ConvenientSpecMixin (e.g. SpecEuclid1d, SpecLAMOST).

coordinate_changed

alias of float

update_slider_and_spin()[source]
slider_changed(slider_value)[source]
spin_changed(z)[source]
plot_single()[source]
update_spectrum_info_label()[source]

Update the spectrum info label above the plot.

plot_next()[source]
plot_previous()[source]
keyPressEvent(event)[source]
class specbox.qtmodule.PGSpecPlotApp(*args: Any, **kwargs: Any)[source]

Bases: QApplication

Standalone application running PGSpecPlot.

make_layout()[source]
keyPressEvent(event)[source]
mousePressEvent(event)[source]
save_dict_todf()[source]
class specbox.qtmodule.PGSpecPlotThread(*args: Any, **kwargs: Any)[source]

Bases: QThread

Run PGSpecPlotApp in a separate thread.

run()[source]
class specbox.qtmodule.PGSpecPlotThreadFeLo(*args: Any, **kwargs: Any)[source]

Bases: QThread

run()[source]
class specbox.qtmodule.PGSpecPlotEnhanced(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Enhanced version of PGSpecPlot with image cutouts and template switching.

coordinate_changed

alias of float

record_committed

alias of object

update_slider_and_spin()[source]
slider_changed(slider_value)[source]
spin_changed(z_value)[source]
plot_single(preserve_view=False)[source]

Plot the spectrum without template.

update_spectrum_info_label()[source]

Update the spectrum info label above the plot.

plot_template()[source]

Plot template with current redshift.

plot_next()[source]

Plot next spectrum.

plot_previous()[source]

Plot previous spectrum.

jump_to_spectrum(index_one_based)[source]

Jump directly to a spectrum by 1-based index.

change_template(template_name)[source]

Change current template.

keyPressEvent(event)[source]

Handle keyboard events.

class specbox.qtmodule.PGSpecPlotAppEnhanced(*args: Any, **kwargs: Any)[source]

Bases: QApplication

Enhanced standalone application with image cutouts and template switching.

on_coordinate_changed(ra, dec)[source]

Handle coordinate changes and pass object ID to cutout widget.

on_current_spec_changed()[source]
on_record_committed(objid)[source]
sync_qa_checkbox_from_current_spec()[source]

Restore QA checkboxes from current spec/history.

on_qa_flag_changed(_state)[source]

Persist QA flag from checkbox selections into current spec/history.

on_review_panel_qa_changed(qa_flag)[source]
on_review_notes_changed(text)[source]
on_review_reviewer_changed(text)[source]
start_background_prefetch()[source]

Start background prefetching of cutouts for upcoming spectra.

on_downsample_toggled(checked)[source]
make_layout()[source]

Create the enhanced layout with image cutouts and controls.

keyPressEvent(event)[source]

Forward keyboard events to plot widget.

go_to_index()[source]
mousePressEvent(event)[source]

Forward mouse events to plot widget.

save_data()[source]

Save current data to CSV.

save_png()[source]

Save the entire application window as a PNG image.

save_and_quit()[source]

Save data and quit application.

toggle_image_panel()[source]

Toggle visibility of the image cutout panel.

run_cross_correlation()[source]

Run cross-correlation analysis - placeholder.

save_dict_todf()[source]

Save classification results to CSV.

class specbox.qtmodule.PGSpecPlotThreadEnhanced(*args: Any, **kwargs: Any)[source]

Bases: QThread

Enhanced thread wrapper for the enhanced application.

run()[source]
class specbox.qtmodule.ImageCutoutWidget(*args: Any, **kwargs: Any)[source]

Bases: QWidget

Widget for displaying astronomical image cutouts.

QA_CONTAMINATION_BIT = 1
QA_UNUSABLE_BIT = 2
setup_ui()[source]

Module: qtmodule

class specbox.qtmodule.qtmodule.PGSpecPlot(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Interactive spectrum viewer based on pyqtgraph.

This widget was originally developed for Euclid SIR 1D spectra but has been generalized to handle any spectrum class derived from ConvenientSpecMixin (e.g. SpecEuclid1d, SpecLAMOST).

coordinate_changed

alias of float

update_slider_and_spin()[source]
slider_changed(slider_value)[source]
spin_changed(z)[source]
plot_single()[source]
update_spectrum_info_label()[source]

Update the spectrum info label above the plot.

plot_next()[source]
plot_previous()[source]
keyPressEvent(event)[source]
class specbox.qtmodule.qtmodule.PGSpecPlotApp(*args: Any, **kwargs: Any)[source]

Bases: QApplication

Standalone application running PGSpecPlot.

make_layout()[source]
keyPressEvent(event)[source]
mousePressEvent(event)[source]
save_dict_todf()[source]
class specbox.qtmodule.qtmodule.PGSpecPlotThread(*args: Any, **kwargs: Any)[source]

Bases: QThread

Run PGSpecPlotApp in a separate thread.

run()[source]

Module: qtmodule_enhanced

specbox.qtmodule.qtmodule_enhanced.normalize_class_label(value)[source]
specbox.qtmodule.qtmodule_enhanced.display_class_label(value)[source]
specbox.qtmodule.qtmodule_enhanced.default_reviewer_username()[source]
specbox.qtmodule.qtmodule_enhanced.normalize_data_release(value, *, aimsz_review=False)[source]
specbox.qtmodule.qtmodule_enhanced.load_template_table(template_path)[source]
class specbox.qtmodule.qtmodule_enhanced.ImageCutoutWidget(*args: Any, **kwargs: Any)[source]

Bases: QWidget

Widget for displaying astronomical image cutouts.

QA_CONTAMINATION_BIT = 1
QA_UNUSABLE_BIT = 2
setup_ui()[source]
class specbox.qtmodule.qtmodule_enhanced.AIMSZReviewPanel(*args: Any, **kwargs: Any)[source]

Bases: QWidget

Read-only review context plus reviewer-editable fields for AIMS-z.

qa_flag_changed

alias of int

notes_changed

alias of str

reviewer_changed

alias of str

hide_notes_editor()[source]
set_default_reviewer(reviewer)[source]
set_review_context(spec, record=None)[source]
get_qa_flag()[source]
set_qa_flag(qa_flag)[source]
load_online_cutouts(ra, dec, objid=None)[source]

Load cutouts from HiPS2FITS service for given coordinates.

add_image_from_pil(pil_image, label='')[source]

Add PIL image directly to display (for JPEG format).

add_image_from_array(data, label='')[source]

Add image from numpy array to display.

add_image_from_rgb_array(rgb_data, label='')[source]

Add RGB image from numpy array (for JPEG format).

create_composite_image(ra, dec, size_arcsec)[source]

Create RGB composite from multiple bands.

add_image_from_fits(fits_path, label='')[source]

Add FITS image to display.

add_image_from_file(file_path)[source]

Add image from file (FITS or regular image formats).

add_image_widget(pixmap, label='')[source]

Add image widget to layout.

add_status_message(message)[source]

Add status message to display.

remove_widget(widget)[source]

Remove widget from layout.

clear_images()[source]

Clear all displayed images.

get_cache_filename(objid, survey_name)[source]

Get cache filename for an object and survey.

save_cutout_to_cache(objid, survey_name, image_data)[source]

Save cutout image to cache.

load_cutout_from_cache(objid, survey_name)[source]

Load cutout from cache if exists.

prefetch_cutouts_background(spectrum_list, current_index, num_prefetch=None)[source]

Prefetch cutouts for upcoming spectra in the background.

class specbox.qtmodule.qtmodule_enhanced.TemplateManager[source]

Bases: object

Manages spectrum templates.

load_default_templates()[source]

Load default templates.

get_template(template_name)[source]

Get template by name.

get_available_templates()[source]

Get list of available template names.

add_template(name, wave, flux, description='')[source]

Add new template.

class specbox.qtmodule.qtmodule_enhanced.PGSpecPlotEnhanced(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Enhanced version of PGSpecPlot with image cutouts and template switching.

coordinate_changed

alias of float

record_committed

alias of object

update_slider_and_spin()[source]
slider_changed(slider_value)[source]
spin_changed(z_value)[source]
plot_single(preserve_view=False)[source]

Plot the spectrum without template.

update_spectrum_info_label()[source]

Update the spectrum info label above the plot.

plot_template()[source]

Plot template with current redshift.

plot_next()[source]

Plot next spectrum.

plot_previous()[source]

Plot previous spectrum.

jump_to_spectrum(index_one_based)[source]

Jump directly to a spectrum by 1-based index.

change_template(template_name)[source]

Change current template.

keyPressEvent(event)[source]

Handle keyboard events.

class specbox.qtmodule.qtmodule_enhanced.PGSpecPlotAppEnhanced(*args: Any, **kwargs: Any)[source]

Bases: QApplication

Enhanced standalone application with image cutouts and template switching.

on_coordinate_changed(ra, dec)[source]

Handle coordinate changes and pass object ID to cutout widget.

on_current_spec_changed()[source]
on_record_committed(objid)[source]
sync_qa_checkbox_from_current_spec()[source]

Restore QA checkboxes from current spec/history.

on_qa_flag_changed(_state)[source]

Persist QA flag from checkbox selections into current spec/history.

on_review_panel_qa_changed(qa_flag)[source]
on_review_notes_changed(text)[source]
on_review_reviewer_changed(text)[source]
start_background_prefetch()[source]

Start background prefetching of cutouts for upcoming spectra.

on_downsample_toggled(checked)[source]
make_layout()[source]

Create the enhanced layout with image cutouts and controls.

keyPressEvent(event)[source]

Forward keyboard events to plot widget.

go_to_index()[source]
mousePressEvent(event)[source]

Forward mouse events to plot widget.

save_data()[source]

Save current data to CSV.

save_png()[source]

Save the entire application window as a PNG image.

save_and_quit()[source]

Save data and quit application.

toggle_image_panel()[source]

Toggle visibility of the image cutout panel.

run_cross_correlation()[source]

Run cross-correlation analysis - placeholder.

save_dict_todf()[source]

Save classification results to CSV.

class specbox.qtmodule.qtmodule_enhanced.PGSpecPlotThreadEnhanced(*args: Any, **kwargs: Any)[source]

Bases: QThread

Enhanced thread wrapper for the enhanced application.

run()[source]

Module: qtfelo

class specbox.qtmodule.qtfelo.PGSpecPlotFeLo(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Plot widget for plotting spectra using pyqtgraph.

plot_single()[source]
plot_next()[source]
plot_previous()[source]
keyPressEvent(event)[source]
class specbox.qtmodule.qtfelo.PGSpecPlotAppFeLo(*args: Any, **kwargs: Any)[source]

Bases: QApplication

mousePressEvent(event)[source]
save_dict_todf()[source]
make_layout()[source]
keyPressEvent(event)[source]
class specbox.qtmodule.qtfelo.PGSpecPlotThreadFeLo(*args: Any, **kwargs: Any)[source]

Bases: QThread

run()[source]

Module: qtsir1d

Backward compatibility module.

The functionality of the original qtsir1d viewer has been merged into qtmodule. This file simply re-exports the public classes so that existing imports continue to work.

class specbox.qtmodule.qtsir1d.PGSpecPlot(*args: Any, **kwargs: Any)[source]

Bases: PlotWidget

Interactive spectrum viewer based on pyqtgraph.

This widget was originally developed for Euclid SIR 1D spectra but has been generalized to handle any spectrum class derived from ConvenientSpecMixin (e.g. SpecEuclid1d, SpecLAMOST).

coordinate_changed

alias of float

update_slider_and_spin()[source]
slider_changed(slider_value)[source]
spin_changed(z)[source]
plot_single()[source]
update_spectrum_info_label()[source]

Update the spectrum info label above the plot.

plot_next()[source]
plot_previous()[source]
keyPressEvent(event)[source]
class specbox.qtmodule.qtsir1d.PGSpecPlotApp(*args: Any, **kwargs: Any)[source]

Bases: QApplication

Standalone application running PGSpecPlot.

make_layout()[source]
keyPressEvent(event)[source]
mousePressEvent(event)[source]
save_dict_todf()[source]
class specbox.qtmodule.qtsir1d.PGSpecPlotThread(*args: Any, **kwargs: Any)[source]

Bases: QThread

Run PGSpecPlotApp in a separate thread.

run()[source]