magritte.plot module

magritte.plot.image_channel(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 Magritte 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’.

magritte.plot.image_mpl(model, image_nr=- 1, zoom=1.3, npix_x=300, npix_y=300, x_unit=Unit('AU'), v_unit=Unit('km / s'), method='nearest', save_fig=True)

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

  • save_fig (bool) – Whether to save the output figure.

Return type

None

magritte.plot.image_plotly(model, image_nr=- 1, zoom=1.3, npix_x=300, npix_y=300, x_unit=Unit('AU'), v_unit=Unit('km / s'), method='nearest', width=620, height=540, save_fig=True)

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.

  • save_fig (bool) – Whether to save the output figure.

Return type

None

magritte.plot.plot_number_densities_1D(model, xscale='log', yscale='log')

Plot the number densities of all species in the model (in 1D, radially).

Parameters
  • model (object) – Magritte model object.

  • xscale (str) – Scale of the xaxis (“linear”, “log”, “symlog”, “logit”, …)

  • yscale (str) – Scale of the yaxis (“linear”, “log”, “symlog”, “logit”, …)

Return type

None

magritte.plot.plot_populations_1D(model, lev_max=7, xscale='log', yscale='log')

Plot the relative populations in the model (in 1D, radially).

Parameters
  • model (object) – Magritte model object.

  • lev_max (int) – Number of levels to plot.

  • xscale (str) – Scale of the xaxis (“linear”, “log”, “symlog”, “logit”, …)

  • yscale (str) – Scale of the yaxis (“linear”, “log”, “symlog”, “logit”, …)

Return type

None

magritte.plot.plot_temperature_1D(model, xscale='log', yscale='linear')

Plot the temperature profile of the model (in 1D, radially).

Parameters
  • model (object) – Magritte model object.

  • xscale (str) – Scale of the xaxis (“linear”, “log”, “symlog”, “logit”, …)

  • yscale (str) – Scale of the yaxis (“linear”, “log”, “symlog”, “logit”, …)

Return type

None

magritte.plot.plot_turbulence_1D(model, xscale='log', yscale='linear')

Plot the (micro) turbulence profile of the model (in 1D, radially).

Parameters
  • model (object) – Magritte model object.

  • xscale (str) – Scale of the xaxis (“linear”, “log”, “symlog”, “logit”, …)

  • yscale (str) – Scale of the yaxis (“linear”, “log”, “symlog”, “logit”, …)

Return type

None

magritte.plot.plot_velocity_1D(model, xscale='log', yscale='linear')

Plot the velocity profile of the model (in 1D, radially).

Parameters
  • model (object) – Magritte model object.

  • xscale (str) – Scale of the xaxis (“linear”, “log”, “symlog”, “logit”, …)

  • yscale (str) – Scale of the yaxis (“linear”, “log”, “symlog”, “logit”, …)

Return type

None