UpdateableColorScale

giant.coverage.visualizer:

class giant.coverage.visualizer.UpdateableColorScale(collection, color_data, cmap='hot', location='bottom', integer=True, fig=None, ax=None, xbounds=(-180, 180), ybounds=(-90, 90), zbounds=None, xlabel='longitude, degrees', ylabel='latitude, degrees', zlabel=None, title='dop', absolute_max=100, projection=None, nan_to_inf=True, slider=True, show_cbar=True)[source]

Bases: object

This class is used to create a color scale to respresent different numerical data assigned to facets on either a 2D or 3D visualization of a target body.

Parameters:
  • collection – A collection of facets on the target body’s surface that are used to visualize the target’s surface in the plot

  • color_data – An np.array containing a value for each facet, which will be used to determine which color the facet will be shaded on the plot based on where it falls on the color scale. Note that any values above the maximum of the color scale will take on the maximal color, and similarly, any values below the minimum of the color scale will take on the minimal color

  • cmap – An optional string representing a color gradient to use for mapping to values to the color scale

  • location – An optional string representing the location of the interactive slider

  • integer – An optional flag to force the threshold value on the slider to be rounded to the nearest integer

  • fig – An optional pre-existing figure to provide as a destination for the color scale to be applied

  • ax – An optional pre-existing axes to provide as a destination for the color scale to be applied

  • xbounds – An optional tuple containing bounds for x-values to show in the plot

  • ybounds – An optional tuple containing bounds for y-values to show in the plot

  • zbounds – An optional tuple containing bounds for z-values to show in the plot

  • xlabel – An optional string representing a label for the x-axis to show in the plot

  • ylabel – An optional string representing a label for the y-axis to show in the plot

  • zlabel – An optional string representing a label for the z-axis to show in the plot

  • title – An optional string to set as the title of the plot

  • absolute_max – An optional number to provide as the highest value the color bar (and slider) can display. If the absolute_max exceeds the largest value in the color_data, the color bar (and slider) will be limited to that largest value.

  • nan_to_inf – An optional flag to convert np.nan values to np.inf in the color_data for consistent plotting results

  • projection – An optional string representing a matplotlib projection type

  • slider – An optional flag to display an interactive slider in the figure. The value of the slider represents the maximum value of the color scale

  • show_cbar – An optional flag to display the color bar representing the numerical value associated with each color in the plot