sp_validation.plots

PLOTS.

Name:

plots.py

Description:

This script contains methods for plots.

Author:

Martin Kilbinger

plot_spatial_density(ra, dec, title, x_label, y_label, cbar_label, out_path, n_grid=1000, verbose=False)[source]

Plot Spatial Density.

Plot spatial density distribution of objects.

Parameters:
  • ra (array of float) – coordinates

  • dec (array of float) – coordinates

  • title (string) – plot title

  • x_label (string) – x-/y-axis label

  • y_label (string) – x-/y-axis label

  • cbar_label (string) – color bar label

  • out_path (string) – output file path

  • n_grid (int, optional, default=1000) – number of hex grid points

  • verbose (bool, optional, default=False) – verbose output if True

get_ticks(loc, N, new_min, new_max)[source]

Get ticks.

Return formatted axis ticks for plots.

Parameters:
  • loc (array of floats) – original tick locations

  • N (number of pixels (in origina coordinates))

  • new_min (float) – new coordinate minimum

  • new_max (float) – new coordinate maximum

Returns:

  • loc_new (array of floats) – new tick locations

  • labels_new (array of strings) – new tick labels

plot_map(m, ra, dec, min_x, max_x, min_y, max_y, Nx, Ny, title, out_path, vlim=None, grid=True, clusters=None, map_cut_coords=None, dpi=100, colorbar=True)[source]

Plot Map.

Plots 2D map.

Parameters:
  • m (2D array of float) – map

  • ra (array of float) – coordinates, for axis ticks

  • dec (array of float) – coordinates, for axis ticks

  • title (string) – plot title

  • out_path (string) – output file path

  • vlim (array(2) of float, optional, default=None) – limits of map values, if not given compute from map

  • grid (bool, optional) – if True (default) plot grid lines

  • clusters – dictionary of cluster information, optional, default=None

plot_map_stacked(kappa, title, radius, output_path, vlim=None)[source]

Plot Map Stacked.

Plot stacked convergence map.

Parameters:
  • kappa (image) – map values

  • title (string) – plot title

  • output_path (string) – figure output file path

  • vlim (array(2) of float, optional, default=None) – map limits; min and max of kappa if not given

Returns:

map limits

Return type:

array(2) of float

plot_binned_one(ax, quantity, bin_edges_x, bin_edges_y, vmin=None, vmax=None, title=None, xlabel=None, ylabel=None)[source]
plot_binned(quantities, key, bin_edges_x, bin_edges_y, title_base, vmin=None, vmax=None, xlabel=None, ylabel=None)[source]
hsp_map_logical_or(maps, verbose=False)[source]

Hsp Map Logical Or.

Logical AND of HealSparseMaps.

plot_area_mask(ra, dec, zoom, mask=None)[source]

Plot Area Mask.

Create sky plot of objects.

Parameters:
  • ra (list) – R.A. coordinates

  • dec (list) – Dec. coordinates

  • zoom (TBD)

  • mask (TBD, optional)

sky_plots(dat, masks, labels, zoom_ra, zoom_dec)[source]

Sky Plots.

Plot sky regions with different masks.

Parameters:
  • masks (list) – masks to be applied

  • labels (dict) – labels for masks

  • zoom_ra (list) – min and max R.A. for zoom-in plot

  • zoom_dec (list) – min and max Dec. for zoom-in plot