autowisp.browser_interface.processing.select_photref_views module

Class Inheritance Diagram

Inheritance diagram of DiagnosticType, Evaluator, Image, ImageDiagnostics, ImageProcessingManager, SkyCoord, StringIO

Implement the view for selecting single photometric reference.

autowisp.browser_interface.processing.select_photref_views._create_merit_histograms(merit_data, image_index, max_photref_separation=0.2)[source]

Create SVG histograms of various merit metrics showing image in each.

autowisp.browser_interface.processing.select_photref_views._create_pointing_plots(merit_data, image_index, max_photref_separation=0.2, zoom_threshold=3, **plot_cfg)[source]

Create SVG plots for pointing: RA vs Dec scatter and separation histogram.

Images within max_photref_separation * diagonal_fov of the current image are drawn with in_range_cfg, those outside with out_of_range_cfg, and the current image itself with this_img_cfg. RA axis is inverted per astronomical convention. The separation histogram includes a vertical line at the threshold.

If the maximum separation among all images exceeds zoom_threshold * threshold_deg, an additional zoomed scatter plot is appended that restricts the view to images within that radius so the in-range clustering remains visible despite the wider spread. Images in the zoomed plot are still coloured by the original threshold_deg.

Returns:

List of SVG strings, or empty list if the required diagnostics (ra_center, dec_center, diagonal_fov) are absent.

autowisp.browser_interface.processing.select_photref_views._get_merit_data(request, target_index)[source]

Add to the session the merit information for selecting single ref.

autowisp.browser_interface.processing.select_photref_views._get_missing_photref(request)[source]

Add all frame sets missing photometric reference to the session.

autowisp.browser_interface.processing.select_photref_views.create_svg(fig)[source]

Save fig to an SVG string, close the figure, and return the string.

autowisp.browser_interface.processing.select_photref_views.get_photref_merit_info(photref_group, db_session, merit_function)[source]

Return the diagnostics, ranking, and std for each photref_group image.

Parameters:
  • photref_group – The group of images for which an independent reference needs to be selected: list of (_, image_id, channel) tuples.

  • db_session – Active SQLAlchemy session for DB queries.

  • merit_function (str) – Expression to evaluate for ranking images. May reference any diagnostic column as qnt_<name> (rank) or std_<name> (standard deviation).

Returns:

pandas.DataFrame with one row per image/channel, columns for all available diagnostics by name, additionally the rank of the image in that diagnostic is added (qnt_<name>). Finally a ‘merit’ column contains the value of the specified merit function.

autowisp.browser_interface.processing.select_photref_views.record_photref_selection(request, target_index, image_index)[source]

Record a single photometric reference frame selected by the user.

autowisp.browser_interface.processing.select_photref_views.select_photref_image(request, *, target_index, recalculate=False)[source]

Display the interface for reviewing canditate reference frames.

autowisp.browser_interface.processing.select_photref_views.select_photref_target(request, recalc=False)[source]

Display view to select which of the missing photrefs to define.