coolest.api.plot_util#
Functions#
|
|
|
Reconstruct infinite voronoi regions in a 2D diagram to finite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calculate the vmin and vmax to normalize the colormap across multiple coolest objects |
|
Given .tar.gz COOLEST file, plots and optionally saves DMR and corner plots for COOLEST file. Returns dictionary of important extracted information. |
Module Contents#
- plot_voronoi(ax, x, y, z, neg_values_as_bad=False, norm=None, cmap=None, zmin=None, zmax=None, edgecolor=None, zorder=1)[source]#
- voronoi_finite_polygons_2d(vor, radius=None)[source]#
Reconstruct infinite voronoi regions in a 2D diagram to finite regions. This function is taken from: https://gist.github.com/pv/8036995
- Parameters:
vor (Voronoi) – Input diagram
radius (float, optional) – Distance to ‘points at infinity’.
- Returns:
regions (list of tuples) – Indices of vertices in each revised Voronoi regions.
vertices (list of tuples) – Coordinates for revised Voronoi vertices. Same as coordinates of input vertices, with ‘points at infinity’ appended to the end.
- std_colorbar_residuals(mappable, res_map, vmin, vmax, label=None, fontsize=12, label_kwargs={}, **colorbar_kwargs)[source]#
- nice_colorbar(mappable, ax=None, position='right', pad=0.1, size='5%', label=None, fontsize=12, invisible=False, divider_kwargs={}, colorbar_kwargs={}, label_kwargs={})[source]#
- nice_colorbar_residuals(mappable, res_map, vmin, vmax, ax=None, position='right', pad=0.1, size='5%', invisible=False, label=None, fontsize=12, divider_kwargs={}, colorbar_kwargs={}, label_kwargs={})[source]#
- cax_colorbar(fig, cax, norm=None, cmap=None, mappable=None, label=None, fontsize=12, orientation='horizontal', label_kwargs={})[source]#
- plot_irregular_grid(ax, title, points, xylim, neg_values_as_bad=False, norm=None, cmap=None, plot_points=False)[source]#
- normalize_across_images(plotter_list, data_model_specifier, auto_selection=False, kwargs_source=None, kwargs_lens_mass=None, kwargs_lens_light=None, supersampling=5, convolved=True, super_convolution=True)[source]#
Calculate the vmin and vmax to normalize the colormap across multiple coolest objects
- Parameters:
plotter_list (list) – List of ModelPlotter objects. May be acquired from MultiModelPlotter object
data_model_specifier (list) – List of 0s and 1s; 0 = data, 1 = model. Specifies which set of pixel values should be used when finding global minima and maxima – data or model
kwargs_source (dict) – Dictionary with “entity_selection” key, same as used in MultiModelPlotters. “Entity_selection” contains list of lists. Selects source entities. Insert dummy None values into dictionary for data.
kwargs_lens_mass (dict) – Dictionary with “entity_selection” key, same as used in MultiModelPlotters. “Entity_selection” contains list of lists. Selects lens mass entities. Insert dummy None values into dictionary for data.
kwargs_lens_light (dict) – Dictionary with “entity_selection” key, same as used in MultiModelPlotters. “Entity_selection” contains list of lists. Selects lens light entities. Insert dummy None values into dictionary for data.
supersampling (int) – Model image generation param
convolved (bool) – Model image generation param
super_convolution (bool) – Model image generation param
- Returns:
vmin (float) – global min value across all coolest objects in plotter_list for the specified data/models
vmax (float) – global max value across all coolest objects in plotter_list for the specified data/models
- dmr_corner(tar_path, output_dir=None)[source]#
Given .tar.gz COOLEST file, plots and optionally saves DMR and corner plots for COOLEST file. Returns dictionary of important extracted information.
- Parameters:
tar_path (string) – Path to .tar.gz COOLEST file
output_dir (string, optional) – Path to automatically save DMR and corner plot to if specified, by default None
- Returns:
results – Contains useful information about the COOLEST objects
- Return type:
dictionary