solpolpy.plotting#

Functions#

plot_collection(collection[, figsize, show_colorbar, ...])

Plot a solpolpy NDCollection input or output.

get_colormap_str(→ str)

Retrieve a color map name from an input FITS file.

generate_rgb_image(collection[, enhancement_method, ...])

Generate an RGB color image from an NDCollection based on Patel et al. 2023 Res. Notes AAS 7 241.

Module Contents#

solpolpy.plotting.plot_collection(collection, figsize=(8, 8), show_colorbar=False, lat_ticks=None, lon_ticks=None, major_formatter='dd', xlabel='HP Longitude', ylabel='HP Latitude', vmin=None, vmax=None, cmap='Greys_r', ignore_alpha=True, fontsize=18, **kwargs)[source]#

Plot a solpolpy NDCollection input or output.

Parameters:
  • collection (NDCollection, ndarray, or 3D color_image.) – collection to visualize

  • figsize (Tuple[float, float]) – figure size according to Matplotlib

  • show_colorbar (bool) – whether to show a colorbar

  • lat_ticks (Optional[np.ndarray]) – if provided, shows as the tick marks for latitude. default values used otherwise.

  • lon_ticks (Optional[np.ndarray]) – if provided, shows as the tick marks for longitude. default values used otherwise.

  • major_formatter (str) – the formatter for major tickmarks as specified by Matplotlib

  • xlabel (str) – label for plot x axes

  • ylabel (str) – label for plot y axes

  • vmin (float, list of floats, or None) – minimum values of the plots. if a list is provided, they are applied left to right to each plot

  • vmax (float, list of floats, or None) – maximum values of the plots. if a list is provided, they are applied left to right to each plot

  • cmap (str or Matplotlib colormap) – a Matplotlib accepted colormap or colormap string

  • ignore_alpha (bool) – whether to plot the alpha array. defaults to True as it is not normally helpful to visualize.

  • fontsize (int) – font size for some aspects of the plot

  • **kwargs (Additional imshow keyword arguments.) – Extra parameters to pass to imshow().

Returns:

the plotted figure and axes are returned for any additional edits

Return type:

Matplotlib figure and axes

solpolpy.plotting.get_colormap_str(meta: astropy.io.fits.Header) str[source]#

Retrieve a color map name from an input FITS file.

Parameters:

meta (fits.Header) – header of the data

Returns:

name of appropriate colormap

Return type:

str

solpolpy.plotting.generate_rgb_image(collection, enhancement_method='nrgf', mask_params=None, enhancement_params=None)[source]#

Generate an RGB color image from an NDCollection based on Patel et al. 2023 Res. Notes AAS 7 241.

Parameters:#

collectionNDCollection

A collection of NDCube objects containing solar data.

enhancement_methodstr

The radial enhancement method to use. Can be ‘intensity_enhance’, ‘nrgf’, ‘fnrgf’, ‘rhef’, or ‘none’. Default is ‘nrgf’.

mask_paramsdict, optional

Dictionary of masking parameters for inner and outer radius. Default values are used if not provided. Example: - {‘inner_radius’: 3, ‘outer_radius’: 32}

enhancement_params: dict, optional

Dictionary of parameters specific to enhancement method above. Example (check sunkit_image.radial for further parameters information): - For ‘intensity_enhance’: {‘scale’: 1, ‘degree’: 1} - For ‘nrgf’: {‘inner_radius’: 1, ‘outer_radius’: 32, ‘mask_radius’: 6} - For ‘fnrgf’: {‘order’: 3, ‘number_angular_segment’: 130} - For ‘rhef’: {‘supsilon’: 0.35, ‘fill’: np.nan} - Empty or None for ‘none’.

Returns:#

np.ndarray

Generated color image with RGB channels.