Array to Image (lexi.lexi.array_to_image)
--
-
- -lexi.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='viridis', cmin=None, v_min=None, v_max=None, norm=matplotlib.colors.LogNorm, norm_type='log', aspect='auto', figure_title=None, show_colorbar=True, cbar_label=None, cbar_orientation='vertical', show_axes=True, display=False, figure_size=(10, 10), figure_format='png', figure_font_size=12, save=False, save_path=None, save_name=None, dpi=300, dark_mode=False, verbose=False) -
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. Default is ‘viridis’.
-
-- 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 ‘auto’.
-
-- 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 (10, 10).
-
-- 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.
-
-
- -Returns
--
-
- figmatplotlib.figure.Figure
Figure object.
-
-- axmatplotlib.axes._subplots.AxesSubplot
Axes object.
-
-
- -Example Usage
-The following demonstrates how to use the array_to_image function:
-------from lexi.lexi import array_to_image -import numpy as np -import matplotlib.pyplot as plt - -# Create a 2D array -input_array = np.random.rand(100, 100) - -# Print the shape of the input array -# The shape should be (100, 100) -print(input_array.shape) -
----(100, 100) -