Wise utilities module

Summary

The following functions will be used for detection:

wise.wiseutils.imshow_segmented_image(ax, …) Display the segmented image on the axes.
wise.wiseutils.plot_features(ax, features[, …]) Plots the segments location and optionally the segments ids on a map.
wise.wiseutils.plot_features_dfc(ax, …[, mode]) Plot features distance from core vs epoch.
wise.wiseutils.plot_features_pa(ax, …[, mode]) Plot features PA vs epoch.
wise.wiseutils.plot_ms_set_map(ax, img, …) Display all features of ms_set on a map.
wise.wiseutils.plot_segments_contour(ax, …) Display the segments contour of a segmented_image on a map.

The following functions will be used for matching:

wise.wiseutils.plot_displacement_vector(ax, …) Display displacements vectors represented as arrows.
wise.wiseutils.plot_displacements(ax, …[, …]) Display displacements of features on a map.
wise.wiseutils.plot_links_dfc(ax, …[, …]) Plot features link on a distance from core vs epoch plot.
wise.wiseutils.plot_links_dfc_fit(ax, …[, …]) Plot features link fit on a distance from core vs epoch plot.
wise.wiseutils.plot_links_map(ax, img, …) Display features links on a map.
wise.wiseutils.plot_links_pa(ax, projection, …) Plot features link on a PA vs epoch plot.
wise.wiseutils.plot_links_snr(ax, …[, mode]) Plot features link on a SNR vs epoch plot.

Full reference

wise.wiseutils.imshow_segmented_image(ax, segmented_image, projection=None, title=True, beam=True, num=False, bg=None, mode='com', **kwargs)

Display the segmented image on the axes.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • segmented_image (wise.wds.SegmentedImages) –
  • projection (libwise.imgutils.Projection, optional) –
  • title (bool, optional) – Whatever to optionally display a title. Default is True.
  • beam (bool, optional) – Whatever to optionally display the beam of the image. Default is True.
  • num (bool, optional) – Whatever to optionally annotate the segments with there ids. Default is False.
  • bg (libwise.imgutils.Image, optional) – Diplay bg as background image instead of the on from segmented_image.
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to libwise.plotutils.imshow_image().
wise.wiseutils.plot_segments_contour(ax, segmented_image, **kwargs)

Display the segments contour of a segmented_image on a map.

Parameters:
  • ax (matplotlib.axes.Axes.) –
  • segmented_image (wise.wds.SegmentedImages.) –
  • **kwargs – Additional arguments to be passed to libwise.plotutils.plot_mask().
wise.wiseutils.plot_features(ax, features, mode='com', color_fct=None, num=False, num_offset=[3, -3], **kwargs)

Plots the segments location and optionally the segments ids on a map.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • features (wise.features.FeaturesGroup) – Any FeaturesGroup objects that store Features.
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • color_fct (a function, optional) – If set, it should be a function that take a feature as argument and return a color.
  • num (bool, optional) – Whatever to optionally annotate the segments with there ids.
  • num_offset (list, optional) – Offset in pixel for the id.
  • **kwargs – Additional arguments to be passed to libwise.plotutils.plot_coords()
wise.wiseutils.plot_displacement_vector(ax, delta_info, mode='com', color_fct=None, flag=2, **kwargs)

Display displacements vectors represented as arrows.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • delta_info (wise.features.DeltaInformation) – An object containing the displacements to display.
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • color_fct (TYPE, optional) – If set, it should be a function that take a feature as argument and return a color.
  • flag (Attribute, optional) – Default is DeltaInformation.DELTA_MATCH.
  • **kwargs – Additional arguments to be passed to matplotlib.pyltot.Arrow().
wise.wiseutils.plot_displacements(ax, features1, features2, delta_info, num=False, projection=None, mode='com', bg=None, beam=True, cmap=None, **kwargs)

Display displacements of features on a map.

If bg is not set and features1 and features2 are both SegmentedImage, a two color map, one color for the segments of each SegmentedImage, will be used as bg.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • features1 (wise.features.FeaturesGroup) – The features of the first epoch.
  • features2 (wise.features.FeaturesGroup) – The features of the second epoch.
  • delta_info (wise.features.DeltaInformation) – An object containing the displacements information.
  • num (bool, optional) – Whatever to optionally annotate the segments with there ids.
  • projection (libwise.imgutils.Projection, optional) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • bg (libwise.imgutils.Image, optional) – The image to be used as background map.
  • beam (bool, optional) – Whatever to optionally display the beam of the image. Default is True.
  • cmap (matplotlib.cm.ColorMap or str, optional) – A color map for the background map.
  • **kwargs – Additional arguments to be passed to plot_displacement_vector()
wise.wiseutils.plot_features_dfc(ax, projection, features, mode='com', **kwargs)

Plot features distance from core vs epoch.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • features (wise.features.FeaturesGroup) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot().
wise.wiseutils.plot_features_pa(ax, projection, features, mode='com', **kwargs)

Plot features PA vs epoch.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • features (wise.features.FeaturesGroup) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot().
wise.wiseutils.plot_ms_set_map(ax, img, ms_set, projection, mode='com', color_style='date', colorbar_setting=None, map_cmap='jet', **kwargs)

Display all features of ms_set on a map.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • img (Image) – An image to be used as background map.
  • ms_set (wise.wds.MultiScaleImageSet) – An object containing all the features to be displayed.
  • projection (libwise.imgutils.Projection) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • color_style (str, optional) – ‘scale’: display one color per scale. ‘date’: color correspond to the epoch.
  • colorbar_setting (:class:`libwise.ColorbarSetting, optional) – Settings for the color bar if color_style is ‘date’.
  • map_cmap (matplotlib.cm.ColorMap or str, optional) –
  • **kwargs – Additional arguments to be passed to libwise.plotutils.imshow_image().

Plot features link on a distance from core vs epoch plot.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • links (a list of wise.matcher.FeaturesLink) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • num (bool, optional) – Whatever to optionally annotate the links with there ids.
  • num_bbox (dict, optional) –
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot().

Plot features link fit on a distance from core vs epoch plot.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • links (a list of wise.matcher.FeaturesLink) –
  • fit_fct (libwise.nputils.AbstractFct) – The function that will be used for the fit.
  • fit_min_size (int, optional) – Fit only links with size >= fit_min_size.
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot().

Plot features link on a PA vs epoch plot.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • links (a list of wise.matcher.FeaturesLink) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot()

Plot features link on a SNR vs epoch plot.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • projection (libwise.imgutils.Projection) –
  • links (a list of wise.matcher.FeaturesLink) –
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • **kwargs – Additional arguments to be passed to matplotlib.pyplot.plot().

Display features links on a map.

Parameters:
  • ax (matplotlib.axes.Axes) –
  • img (Image) – An image to be used as background map.
  • projection (libwise.imgutils.Projection) –
  • links (a list of wise.matcher.FeaturesLink) –
  • color_style (str, optional) – ‘link’: one color per link. ‘date’: map the features epochs to a color. any color string: use one color for each displacements vectors. function: a function that take a feature as argument and return a color.
  • mode (str, optional) – Coord mode for the location of the features: ‘lm’, ‘com’ or ‘cos’.
  • colorbar_setting (ColorBar, optional) – Settings for the color bar if color_style is ‘date’.
  • map_cmap (matplotlib.cm.ColorMap or str, optional) –
  • vector_width (int, optional) – Width of the displacements vector arrows. Default is 4.
  • link_id_label (bool, optional) – Annotate the links with there ids.
  • num_bbox (dict, optional) –
  • **kwargs – Additional arguments to be passed to libwise.plotutils.imshow_image().
class wise.wiseutils.DifmapComponent(flux, radius, theta, major=0, ratio=0, phi=0, t=0, freq=0, specind=0)

Format is: Flux (Jy) Radius (mas) Theta (deg) Major (mas) Axial ratio Phi (deg) T Freq (Hz):

Flux - The integrated flux in the component (Jy). Radius - The radial distance of the component center from the

center of the map (milli-arcsec).
Theta - The position angle of the center of the component (degrees
North -> East) wrt an imaginary line drawn vertically through the map center.

The following components may be omitted for delta components, except when you want to specify spectral indexes, in which case they should be specified as zero.

Major - The FWHM major axis of the elliptically stretched
component (milli-arcsec).

Ratio - The ratio of the minor axis to the major axis (0 -> 1). Phi - The Position angle of the major axis (degrees North -> East). T - The type of component. Recognised types are:

0 - Delta function. 1 - Gaussian. 2 - Uniformly bright disk. 3 - Optically thin sphere. 4 - Ring. 5 - Un-supported component type - kept for compatibility. 6 - Sunyaev-Zel’dovich.

The following two parameters are used to optionally give components spectral indexes.

Freq - The frequency for which the specified Flux value is defined,
specified in Hz.

SpecInd - The spectral index.

get_coord()

Return coord as index: yx

class wise.wiseutils.DifmapModel

See DifmapComponent for information on format

class wise.wiseutils.CoreOffsetPositions

Format is: epoch (iso:%Y-%m-%d), id (always 0), dist, pa (in degrees). All space separated