ranch.io package
Submodules
ranch.io.io module
- ranch.io.io.plot_hist(input: Struct, bins: int | str = 'auto', ax: Axes | None = None, logx: bool = False, logy: bool = False, density: bool = False, color: str | None = None, xlim: tuple | None = None, ylim: tuple | None = None) Tuple[ndarray, ndarray, Axes][source]
TODO
- ranch.io.io.plot_hist2d(input1: ~ranch.structures.Struct, input2: ~ranch.structures.Struct, bins: int | tuple | str = 'auto', ax: ~matplotlib.axes._axes.Axes | None = None, logx: bool = False, logy: bool = False, logz: bool = False, density: bool = False, plot_identity: bool = False, cmap: str | ~matplotlib.colors.Colormap = <matplotlib.colors.LinearSegmentedColormap object>, scatter: bool = False, scatter_threshold: int = 1, zeros_to_nans: bool = True, xlim: tuple | None = None, ylim: tuple | None = None, vmin: float | None = None, vmax: float | None = None) Tuple[ndarray, Tuple[ndarray, ndarray], Axes][source]
Plot a 2-dimensional histogram of two structures of same shape input1 and input2.
- Parameters:
input1 (Cube | Map | Profile.) – Structure whose data will be plotted on the x axis.
input2 (Cube | Map | Profile.) – Structure whose data will be plotted on the y axis.
bins (int | tuple | str, optional.) – Number of bins. If it is an integer, then the same number of bins is used for each axis. If it is a tuple, then we assume that the format is (bins_x, bins_y). If bins is a string, then the number of bins is automatically computed (default: ‘auto’). For more information, refer to numpy.histogram_bin_edges.
ax (Axes, optional.) – Matplotlib axis to plot the histogram. If ax is None, then matplotlib.pyplot.gca() is used. Default: None.
logx (bool, optional.) – If True, then the x axis is plotted in log scale. Default: False.
logy (bool, optional.) – If True, then the y axis is plotted in log scale. Default: False.
logz (bool, optional.) – If True, then the colorbar is in log scale. Default: False.
density (bool, optional.) – If True, then the density is plotted. Else, the standard counting of samples by bin is plotted. Default: False.
plot_identity (bool, optional.) – If True, then the y=x line is plotted on the figure. Default: False.
cmap (str, optional) – Default: default_colormap.
scatter (bool, optional.) – If True, the samples that are less than 2 per bins are displayed individually (using matplotlib.pyplot.scatter) instead of being included in the histogram. Default: False.
scatter_threshold (int, optional.) – The minimum number of pixel by bins necessary to be plotted as an histogram and not as a scatter plot. Must be positive. Default: 1.
zeros_to_nans (bool, optional.) – If True, then the bins without samples are plotted as nan. Default: True.
xlim (tuple | None, optional.) – X axis limits for matplotlib.pyplot.xlim. Default: None.
ylim (tuple | None, optional.) – Y axis limits for matplotlib.pyplot.ylim. Default: None.
vmin (float, optional.) – Minimum value for colormap. Default: None.
vmax (float, optional.) – Maximum value for colormap. Default: None.
- Returns:
H (ndarray) – Matrix of 2-dimensional histogram.
edges (tuple of ndarray) – Tuple of x and y axis bins (xedges, yedges)
ax (Axes) – Matplotlib axis.
- ranch.io.io.plot_map(map: ~ranch.structures.Map, ax: ~matplotlib.axes._axes.Axes | None = None, label_unit: str = 'angle', no_logical=False, norm: ~matplotlib.colors.Normalize | None = None, cmap: str | ~matplotlib.colors.Colormap = <matplotlib.colors.LinearSegmentedColormap object>, vmin: float | None = None, vmax: float | None = None)[source]
Plots a map. Returns the figure axis and the colorbar.
- ranch.io.io.plot_pixel(cube: Cube, xy: tuple[int, float], unit: str = 'index', **kwargs)[source]
TODO
- ranch.io.io.plot_profile(profile: Profile, ax: Axes | None = None, label_unit: str = 'velocity', logy: bool = False, linestyle: str | None = 'solid', color: str | None = 'k', linewidth: float | None = 1.5, label: str | None = None)[source]
Plot a profile. Returns the figure axis.
- ranch.io.io.save_channel_plot(cube: Cube, z: int | float, filename: str, unit: str = 'index', path: str | None = None, **kwargs) None[source]
TODO
- ranch.io.io.save_hist(input: Struct, filename: str, path: str | None = None, **kwargs)[source]
TODO
- ranch.io.io.save_hist2d(input1: Struct, input2: Struct, filename: str, path: str | None = None, **kwargs)[source]
TODO
- ranch.io.io.save_map_plot(map: Map, filename: str, path: str | None = None, **kwargs) None[source]
TODO
- ranch.io.io.save_pixel_plot(cube: Cube, xy: tuple[int] | tuple[float], filename: str, unit: str = 'index', path: str | None = None, **kwargs) None[source]
TODO
- ranch.io.io.save_profile_plot(profile: Profile, filename: str, path: str | None = None, **kwargs) None[source]
TODO
- ranch.io.io.show_channel(cube: Cube, z: int | float, unit: str = 'index', **kwargs) None[source]
TODO