Array to Image (lexi.array_to_image)
- lexi_xray.lexi.array_to_image(input_array=None, key=None, x_range=None, y_range=None, x_lim=None, y_lim=None, start_time=None, stop_time=None, ra_res=None, dec_res=None, time_integrate=None, cmap=None, cmin=None, v_min=None, v_max=None, norm=matplotlib.colors.LogNorm, norm_type='log', aspect='equal', figure_title=None, show_colorbar=True, cbar_label=None, cbar_orientation='vertical', show_axes=True, display=False, figure_size=None, figure_format='png', figure_font_size=12, save=False, save_path=None, save_name=None, dpi=300, dark_mode=False, verbose=False, display_time=False)[source]
Convert a 2D array to an image.
Parameters
- ra_resfloat, optional
Right ascension resolution in degrees. Default is None.
- dec_resfloat, optional
Declination resolution in degrees. Default is None.
- time_integrateint or float, optional
Integration time in seconds. Default is None.
- input_arraynp.ndarray
2D array to convert to an image.
- x_rangelist, optional
Range of the x-axis. Default is None.
- y_rangelist, optional
Range of the y-axis. Default is None.
- x_limlist, optional
Limits of the x-axis. Default is None.
- y_limlist, optional
Limits of the y-axis. Default is None.
- v_minfloat, optional
Minimum value of the colorbar. If None, then the minimum value of the input array is used. Default is None.
- v_maxfloat, optional
Maximum value of the colorbar. If None, then the maximum value of the input array is used. Default is None.
- cmapstr, optional
Colormap to use. By default, based on the key being plotted it is set to the following: - exposure_maps: ‘cividis’ - sky_backgrounds: ‘inferno’ - lexi_images: ‘plasma’ - something else: ‘viridis’ Default is ‘viridis’. Other options include ‘plasma’, ‘inferno’, ‘magma’, ‘cividis’. See https://matplotlib.org/stable/tutorials/colors/colormaps.html for more options.
- normmpl.colors.Normalize, optional
Normalization to use for the colorbar colors. Default is None.
- norm_typestr, optional
Normalization type to use. Options are ‘linear’ or ‘log’. Default is ‘linear’.
- aspectstr, optional
Aspect ratio to use. Default is ‘equal’.
- figure_titlestr, optional
Title of the figure. Default is None.
- show_colorbarbool, optional
If True, then show the colorbar. Default is True.
- cbar_labelstr, optional
Label of the colorbar. Default is None.
- cbar_orientationstr, optional
Orientation of the colorbar. Options are ‘vertical’ or ‘horizontal’. Default is ‘vertical’.
- show_axesbool, optional
If True, then show the axes. Default is True.
- displaybool, optional
If True, then display the figure. Default is False.
- figure_sizetuple, optional
Size of the figure. Default is None.
- figure_formatstr, optional
Format of the figure. Default is ‘png’.
- figure_font_sizefloat, optional
Font size of the figure. Default is 12.
- savebool, optional
If True, then save the figure. Default is False.
- save_pathstr, optional
Path to save the figure to. Default is None.
- save_namestr, optional
Name of the figure to save. Default is None.
- display_timebool, optional
Display the start and end time of the image. Default is False.
Returns
- figmatplotlib.figure.Figure
Figure object.
- axmatplotlib.axes._subplots.AxesSubplot
Axes object.