Ploting Functions

Description of plotting functions

Plot Functions

Collection of plotting functions

LUCI.LuciPlotting.check_units(unit)

This function checks to see that the unit provided is in the available options :param unit: User supplied unit

Returns:

Nothing if the user provides an appropriate unit Else it will throw an error

LUCI.LuciPlotting.plot_fit(axis, spectrum, fit, ax=None, units='cm-1', output_name=None, fig_size=(10, 8), dark=False, **kwargs)

Plot Spectrum and fit with Luci format. If output name is supplied, the plot will be saved :param axis: X axis of spectrum (1d numpy array) :param spectrum: Y axis of spectrum (1d numpy array) :param fit: Fit vector (1d numpy array) :param ax: Current axis (defaults to None) :param units: Wavelength units (e.x. ‘cm’) :param output_name: Path to output file (default None) :param fig_size: Size of figure (default (10,8)) :param dark: Boolean to turn on dark mode (default False)

LUCI.LuciPlotting.plot_map(quantity_map, quantity_name, output_dir='', header=None, object_name='', filter_name='', clims=None, fig_size=(10, 8), dark=False, **kwargs)

Function to plot fit map. The three options are ‘flux’, ‘velocity’, and ‘broadening’. The flux map is automatically scaled by log10. The velocity and broadening are not. The plot is saved here: output_dir+’/’+quantity_name+’_map.png’

Parameters:
  • quantity_map – 2d numpy array from fit

  • quantity_name – Name of quantity (e.x. ‘flux’)

  • output_dir – Path (absolute or partial) to output directory

  • header – Header information for plot

  • clims – List containing lower and upper limits of colorbar (e.x. [-500, 500])

  • fig_size – Size of figure (default (10,8))

  • dark – Boolean to turn on dark mode (default False)

Example

We can plot the flux assuming a min and max value of 1e-18 and 1e-16.

>>> lplt.plot_map(flux_map[:,:,0], 'flux', output_dir=cube_dir, header=cube.header, object_name=object_name, filter_name=filter_name, clims=[-18, -16])

Similarly, we can plot the velocity and broadening:

>>> lplt.plot_map(vel_map[:,:,0], 'veloity', output_dir=cube_dir, header=cube.header, object_name=object_name, filter_name=filter_name, clims=[-200, -200])
>>> lplt.plot_map(broad_map[:,:,0], 'broadening', output_dir=cube_dir, header=cube.header, object_name=object_name, filter_name=filter_name, clims=[10, 50])
LUCI.LuciPlotting.plot_map_no_coords(quantity_map, quantity_name, object_name='', filter_name='', output_dir='', clims=None, fig_size=(10, 8), dark=False, **kwargs)

Function to plot fit map. The four options are ‘flux’, ‘velocity’, ‘broadening’, and ‘zscore’. The flux map is automatically scaled by log10. The velocity and broadening are not. The plot is saved here: output_dir+’/’+quantity_name+’_map.png’

Parameters:
  • quantity_map – 2d numpy array from fit

  • quantity_name – Name of quantity (e.x. ‘flux’)

  • output_dir – Path (absolute or partial) to output directory

  • clims – List containing lower and upper limits of colorbar (e.x. [-500, 500])

  • fig_size – Size of figure (default (10,8))

  • dark – Boolean to turn on dark mode (default False)

Example

We can plot the flux.

>>> lplt.plot_map(flux_map[:,:,0], 'flux')
LUCI.LuciPlotting.plot_spectrum(axis, spectrum, ax=None, units='cm-1', output_name=None, fig_size=(10, 8), dark=False, **kwargs)

Plot Spectrum with Luci format. If output name is supplied, the plot will be saved :param axis: X axis of spectrum (1d numpy array) :param spectrum: Y axis of spectrum (1d numpy array) :param units: Wavelength units (e.x. ‘cm’) :param output_name: Path to output file (default None) :param fig_size: Size of figure (default (10,8)) :param dark: Boolean to turn on dark mode (default False)

LUCI.LuciPlotting.set_style(dark)

Set style as light or dark