opihiexarata.gui.selector module

class opihiexarata.gui.selector.TargetSelectorWindow(current_fits_filename: str, reference_fits_filename: str = None)[source]

Bases: QWidget

__connect_check_box_autoscale_1_99() None

This check box allows the user to force the autoscaling of images when the subtraction method changes.

Parameters:

None

Return type:

None

__connect_check_box_reverse_colorbar() None

This check box allows the user to reverse the colors of the color bar.

Parameters:

None

Return type:

None

__connect_line_edit_dynamic_scale_high() None

A function to operate on the change of the text of the high scale.

Parameters:

None

Return type:

None

__connect_line_edit_dynamic_scale_low() None

A function to operate on the change of the text of the low scale.

Parameters:

None

Return type:

None

__connect_matplotlib_mouse_press_event(event: MouseEvent) None

A function to describe what would happen when a mouse press is done on the Matplotlib image.

This function defaults to the toolbar functionality when the toolbar is considered active.

Parameters:

event (MouseEvent) – The event of the click itself.

Return type:

None

__connect_matplotlib_mouse_release_event(event: MouseEvent) None

A function to describe what would happen when a mouse press is released done on the Matplotlib image.

Parameters:

event (MouseEvent) – The event of the click itself.

Return type:

None

__connect_push_button_change_reference_filename() None

This function provides a popup dialog to prompt the user to change the reference fits filename.

Parameters:

None

Return type:

None

__connect_push_button_mode_non_sidereal() None

This function sets the subtraction method to non-sidereal, for comparing the current image from the reference image.

This method assumes the approximation that the target itself did not move at all compared to both images, but the stars do as they are moving siderally.

Parameters:

None

Return type:

None

__connect_push_button_mode_none() None

This function sets the subtraction method to None, for comparing the current image from the reference image.

Both None the type and the string is valid as no subtraction. The type just means that it has not been formally specified using the GUI.

This method has no subtraction and thus no comparison to the reference image.

Parameters:

None

Return type:

None

__connect_push_button_mode_reference() None

This function sets the subtraction method to Reference, plotting the reference image instead of the current image.

This method has no subtraction and thus no comparison to the current image.

Parameters:

None

Return type:

None

__connect_push_button_mode_sidereal() None

This function sets the subtraction method to sidereal, for comparing the current image from the reference image.

This method assumes the approximation that both the current and reference images are pointing to the same point in the sky.

Parameters:

None

Return type:

None

__connect_push_button_scale_1_99() None

A function set the scale automatically to 1-99 within the region currently displayed on the screen.

Parameters:

None

Return type:

None

__connect_push_button_submit_target() None

This button submits the current location of the target and closes the window. (The target information is saved within the class instance.)

If the text within the line edits differ than what the box selection has selected, then this prioritizes the values as manually defined. Although this should be rare as any time a box is drawn, the values and text boxes should be updated.

If no entry is properly convertible, we default to center of the image.

Parameters:

None

Return type:

None

__init__(current_fits_filename: str, reference_fits_filename: str = None) None[source]

Create the target selector window. Though often used for asteroids, there is no reason why is should specific to them; so we use a general name.

Parameters:
  • current_fits_filename (string) – The current fits filename which will be used to determine where the location of the target is.

  • reference_fits_filename (string, default = None) – The reference fits filename which will be used to compare against the current fits filename to determine where the location of the target is. If None, then no image will be loaded until manually specified.

Return type:

None

__init_gui_connections()

A initiation set of functions that attach to the buttons on the GUI.

Parameters:

None

Return type:

None

__init_opihi_image() None

Create the image area which will display what Opihi took from the sky. This takes advantage of a reserved image vertical layout in the design of the window.

Parameters:

None

Return type:

None

__refresh_image() None

Redraw and refresh the image, this is mostly used to allow for the program to update where the user selected.

Parameters:

None

Return type:

None

__refresh_text() None

This function just refreshes the GUI text based on the current actual values.

Parameters:

None

Return type:

None

_recompute_colorbar_autoscale(lower_percentile: float = 1, higher_percentile: float = 99) None[source]

This is a function to recompute the autoscaling of the colorbar.

This function needs to be split from the connection buttons otherwise an infinite loop occurs because of their inherent and expected calls to refresh the window.

Parameters:
  • lower_percentile (float, default = 1) – The lower percentile value which will be defined at the zero point for the colorbar.

  • higher_percentile (float, default = 99) – The higher (upper) percentile value which will be defined as the one point for the colorbar.

Return type:

None

_recompute_subtraction_arrays() None[source]

This computes the subtracted arrays for both none, sidereal, and non-sidereal subtractions. This is done mostly for speed considerations as the values can be computed and stored during image loading.

Parameters:

None

Return type:

None

close_window() None[source]

Closes the window. Generally called when it is all done.

Parameters:

None

Return type:

None

find_target_location(x0: float, x1: float, y0: float, y1: float) tuple[float, float][source]

Find the location of a target by using a guessed location. The bounds of the search is specified by the rectangle.

We use a quick way of finding the centroid based on summations on each axis.

Parameters:
  • x0 (float) – The lower x axis bound of the search area. These values are cast into integers upon indexing the search area.

  • x1 (float) – The upper x axis bound of the search area. These values are cast into integers upon indexing the search area.

  • y0 (float) – The lower y axis bound of the search area. These values are cast into integers upon indexing the search area.

  • y1 (float) – The upper y axis bound of the search area. These values are cast into integers upon indexing the search area.

Returns:

  • target_x (float) – The location of the target, based on the guess.

  • target_y (float) – The location of the target, based on the guess.

refresh_window() None[source]

Refresh the text content of the window given new information. This refreshes both the dynamic label text and redraws the image.

Parameters:

None

Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("TargetSelectorWindow" inherits "QWidget": )
opihiexarata.gui.selector.ask_user_target_selector_window(current_fits_filename, reference_fits_filename: str = None) tuple[float, float][source]

Use the target selector window to have the user provide the information needed to determine the location of the target.

Parameters:
  • current_fits_filename (string) – The current fits filename which will be used to determine where the location of the target is.

  • reference_fits_filename (string, default = None) – The reference fits filename which will be used to compare against the current fits filename to determine where the location of the target is. If None, then no image will be loaded until manually specified.

Returns:

  • target_x (float) – The location of the target in the x axis direction.

  • target_y (float) – The location of the target in the y axis direction.

opihiexarata.gui.selector.main()[source]