plot_mask#
- pyvisgrid.plotting.plot_mask(grid_data, mode: str = 'hist', crop: tuple[list[float | None]] = ([None, None], [None, None]), norm: str | Normalize = None, cmap: str | Colormap | None = None, plot_args: dict | None = None, fig_args: dict | None = None, save_to: str | PathLike | None = None, save_args: dict | None = None, fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]#
Plots the (u,v) mask (the binned visibilities) of the gridded interferometric image.
- Parameters:
- grid_datapyvisgrid.GridData
The gridded data from the
pyvisgrid.Gridder.gridmethod. This always represents the gridded visibilities of one Stokes component.- modestr, optional
The mode specifying which values of the mask should be plotted. Possible values are:
hist: Plots the number of (u,v) points which are sorted ineach pixel of the image in the (u,v) space.
abs/amp: Plots the absolute value of the gridded visibilities,meaning the magnitude of the complex numbers in Euler representation.
phase: Plots the phase angle of the gridded visibilities,meaning the angle in the exponent of the complex numbers in Euler representation.
real: Plots the real part of the gridded visibilities.imag: Plots the imaginary part of the gridded visibilities.
Default is
hist.- croptuple[list[float | None]], optional
The crop of the image. This has to have the format
([x_left, x_right], [y_left, y_right]), where the left and right values for each axis are the upper and lower limits of the axes which should be shown. IMPORTANT: If one supplies theplt.imshowanextentparameter via theplot_argsparameter, this will be the scale in which one has to give the crop! If not, the crop has to be in pixels.- normstr | matplotlib.colors.Normalize | None, optional
The name of the norm or a matplotlib norm. Possible values are:
log: Returns a logarithmic norm with clipping on (!), meaningvalues above the maximum will be mapped to the maximum and values below the minimum will be mapped to the minimum, thus avoiding the appearance of a colormaps ‘over’ and ‘under’ colors (e.g. in case of negative values). Depending on the use case this is desirable but in case that it is not, one can set the norm to
log_noclipor provide a custom norm.
log_noclip: Returns a logarithmic norm with clipping off.centered: Returns a linear norm which centered around zero.sqrt: Returns a power norm with exponent 0.5, meaning thesquare-root of the values.
- other: A value not declared above will be returned as is, meaning
that this could be any value which exists in matplotlib itself.
Default is
None, meaning no norm will be applied.- cmap: str | matplotlib.colors.Colormap | None, optional
The colormap to be used for the plot. Default is
None, meaning the colormap will be default to a value fitting for the chosen mode.- plot_argsdict, optional
The additional arguments passed to the scatter plot. Default is
{"color":"royalblue"}.- fig_argsdict | None, optional
The additional arguments passed to the figure. If a figure object is given in the
figparameter, this value will be discarded. Default isNone.- save_tostr | PathLike | None, optional
The name of the file to save the plot to. Default is
None, meaning the plot won’t be saved.- save_argsdict | None, optional
The additional arguments passed to the
fig.savefigcall. Default is{"bbox_inches":"tight"}.- figmatplotlib.figure.Figure | None, optional
A custom figure object. If set to
None, theaxparameter also has to beNone! Default isNone.- axmatplotlib.axes.Axes | None, optional
A custom axes object. If set to
None, thefigparameter also has to beNone! Default isNone.
- Returns:
- figmatplotlib.figure.Figure
The figure object.
- axmatplotlib.axes.Axes
The axes object.