plot_dirty_image#

pyvisgrid.plotting.plot_dirty_image(grid_data, mode: str = 'real', ax_unit: str | Unit = 'pixel', center_pos: tuple[float] | None = None, norm: str | Normalize = None, colorbar_shrink: float = 1, cmap: str | Colormap = 'inferno', 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) dirty image, meaning the 2d Fourier transform of the gridded visibilities.

Parameters:
grid_datapyvisgrid.GridData

The gridded data from the pyvisgrid.Gridder.grid method. This always represents the gridded visibilities of one Stokes component.

modestr, optional

The mode specifying which values of the dirty image should be plotted. Possible values are:

  • real: Plots the real part of the dirty image.

  • imag: Plots the imaginary part of the dirty image.

  • abs: Plot the absolute value of the dirty image.

Default is real.

ax_unit: str | astropy.units.Unit, optional

The unit in which to show the ticks of the x and y-axes in. The y-axis is the Declination (DEC) and the x-axis is the Right Ascension (RA). The latter one is defined as increasing from left to right! The unit has to be given as a string or an astropy.units.Unit. The string must correspond to the string representation of an astropy.units.Unit.

Valid units are either pixel or angle units like arcsec, degree etc. Default is pixel.

center_pos: tuple | None, optional

The coordinate center of the image. The coordinates have to be given in the unit defined in the parameter ax_unit above. If ax_unit is set to pixel this parameter is ignored. Default is None, meaning the coordinates of the axes will be given as relative.

normstr | matplotlib.colors.Normalize | None, optional

The name of the norm or a matplotlib norm. Possible string values are:

  • log: Returns a logarithmic norm with clipping on (!), meaning

    values 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_noclip or 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 the

    square-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.

colorbar_shrink: float, optional

The shrink parameter of the colorbar. This can be needed if the plot is included as a subplot to adjust the size of the colorbar. Default is 1, meaning original scale.

cmap: str | matplotlib.colors.Colormap, optional

The colormap to be used for the plot. Default is 'inferno'.

plot_argsdict | None, optional

The additional arguments passed to the scatter plot. Default is None.

fig_argsdict | None, optional

The additional arguments passed to the figure. If a figure object is given in the fig parameter, this value will be discarded. Default is None.

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.savefig call. Default is {"bbox_inches":"tight"}.

figmatplotlib.figure.Figure | None, optional

A custom figure object. If set to None, the ax parameter also has to be None! Default is None.

axmatplotlib.axes.Axes | None, optional

A custom axes object. If set to None, the fig parameter also has to be None! Default is None.

Returns:
figmatplotlib.figure.Figure

The figure object.

axmatplotlib.axes.Axes

The axes object.