magrittetorch.tools.plot
Contains plotting routines for visualizing the results of the simulation.
- magrittetorch.tools.plot.image_channel(model: Model, channels: list[int], figure_size: tuple[int, int], image_nr=-1, zoom=1.3, npix_x=200, npix_y=200, x_unit=Unit('AU'), v_unit=Unit('km / s'), x_ticks=None, y_ticks=None, method='nearest')
Creates a single image of channel maps plotted next to each other, with the line profile below.
- Parameters:
model (_type_) – The Magrittetorch model object.
channels (list[int]) – The channels to plot
figure_size (tuple[int, int]) – Number of columns, rows to use for channel maps. product should be equal to len(channels)
image_nr (int, optional) – Image number to plot. Defaults to -1.
zoom (float, optional) – Zoom level. Defaults to 1.3.
npix_x (int, optional) – Number of pixels in x direction. Defaults to 300.
npix_y (int, optional) – Number of pixels in y direction. Defaults to 300.
x_unit (_type_, optional) – Units for position coordinate. Defaults to units.au.
v_unit (_type_, optional) – Units for velocity coordinate. Defaults to units.km/units.s.
x_ticks (float, optional) – Ticks for x-axis in x_unit units. Default to ‘None’, in which case the automatic matplotlib ticks are used.
y_ticks (float, optional) – Ticks for y-axis in x_unit units. Default to ‘None’, in which case the automatic matplotlib ticks are used.
method (str, optional) – Interpolation method. Defaults to ‘nearest’.
- magrittetorch.tools.plot.image_mpl(model: Model, image_nr: int = -1, zoom: float = 1.3, npix_x: int = 256, npix_y: int = 256, x_unit: Unit = Unit('AU'), v_unit: Unit = Unit('km / s'), method: str = 'nearest')
Create plots of the channel maps of a synthetic observation (image) with matplotlib.
- Parameters:
model (object) – Magritte model object.
image_nr (int) – Number of the synthetic observation to plot. (Use -1 to indicate the last one.)
zoom (float) – Factor with which to zoom in on the middel of the image.
npix_x (int) – Number of pixels in the image in the horizontal (x) direction.
npix_y (int) – Number of pixels in the image in the vertical (y) direction.
x_unit (astropy.Unit object) – Unit of length for the horixontal (x) axis.
y_unit (astropy.Unit object) – Unit of length for the vertical (y) axis.
method (str) – Method to interpolate the scattered intensity data onto a regular image grid.
- Return type:
None
- magrittetorch.tools.plot.image_plotly(model: Model, image_nr: int = -1, zoom: float = 1.3, npix_x: int = 300, npix_y: int = 300, x_unit: Unit = Unit('AU'), v_unit: Unit = Unit('km / s'), method: str = 'nearest', width: float = 620, height: float = 540)
Create plots of the channel maps of a synthetic observation (image) with plotly.
- Parameters:
model (object) – Magritte model object.
image_nr (int) – Number of the synthetic observation to plot. (Use -1 to indicate the last one.)
zoom (float) – Factor with which to zoom in on the middel of the image.
npix_x (int) – Number of pixels in the image in the horizontal (x) direction.
npix_y (int) – Number of pixels in the image in the vertical (y) direction.
x_unit (astropy.units object) – Unit of length for the horixontal (x) axis.
y_unit (astropy.units object) – Unit of length for the vertical (y) axis.
method (str) – Method to interpolate the scattered intensity data onto a regular image grid.
width (float) – Width of the resulting figure.
height (float) – Height of the resulting figure.
- Return type:
None
- magrittetorch.tools.plot.save_fits(model: Model, filename: str | None = None, image_nr: int = -1, zoom: float = 1.3, npix_x: int = 256, npix_y: int = 256, method: str = 'nearest', dpc: float = 1.0, coord: str | None = None, f_rest: Quantity = 0.0, square: bool = False) None
Save channel maps of synthetic observation (image) as a fits file.
- Parameters:
model (object) – Magritte model object.
image_nr (int) – Number of the synthetic observation to plot. (Use -1 to indicate the last one.)
zoom (float) – Factor with which to zoom in on the middel of the image.
npix_x (int) – Number of pixels in the image in the horizontal (x) direction.
npix_y (int) – Number of pixels in the image in the vertical (y) direction.
method (str) – Method to interpolate the scattered intensity data onto a regular image grid.
dpc (float) – Distance of source in parsec.
coord (str) – Image centre coordinates.
f_rest (Quantity) – Rest frequency of the transition.
square (bool) – True if square pixels are required.
- Return type:
None