The SKIRT project
advanced radiative transfer for astrophysics
Functions
pts.visual.plotvectorcuts Namespace Reference

Plot planar cuts or projections for a vector quantity from a SKIRT simulation. More...

Functions

def plotVectorCuts (simulation, probeTypes, binSize=(32, 32), *outDirPath=None, outFileName=None, outFilePath=None, figSize=(6, 6), interactive=None)
 This function creates plots of the planar cuts or projections for a vector quantity produced by one of the relevant probes in a SKIRT simulation. More...
 

Detailed Description

Plot planar cuts or projections for a vector quantity from a SKIRT simulation.

The function in this module creates plots of the planar cuts or projections for a vector quantity produced by one of the relevant probes in a SKIRT simulation.

Function Documentation

◆ plotVectorCuts()

def pts.visual.plotvectorcuts.plotVectorCuts (   simulation,
  probeTypes,
  binSize = (32,32),
outDirPath = None,
  outFileName = None,
  outFilePath = None,
  figSize = (6,6),
  interactive = None 
)

This function creates plots of the planar cuts or projections for a vector quantity produced by one of the relevant probes in a SKIRT simulation.

Specifically, the function accepts a single Simulation instance and it assumes that the simulation includes one or more instances of one or more of the probe types listed in probeTypes, with an associated probe form that produces a planar cut (DefaultCutsForm, PlanarCutsForm) or planar projection (ParallelProjectionForm, AllSkyProjectionForm). If this is not the case, the function does nothing.

The figure displays an arrow for each bin of Nx by Ny pixels. The bin size can be specified as an argument. The orientation and length of the arrow indicate respectively the direction and magnitude of the vector projected on the image plane and averaged over the bin. The color of the arrow scales with the vector component orthogonal to the image plane, also averaged over the bin. Vectors pointing away from the observer and are red-ish and vectors pointing towards the observer and are blue-ish.

By default, the figures are saved in the simulation output directory with a filename that includes the simulation prefix, the probe name, and the medium component or type indicator, and has the ".pdf" filename extension. This can be overridden with the out* arguments as described for the pts.utils.savePath() function. In interactive mode (see the pts.utils.interactive() function), the figures are not saved and are left open for display in notebooks.

The function takes the following arguments:

  • simulation: the Simulation instance for which to plot the vector quantity.
  • probeTypes: a sequence of strings with probe types (SKIRT class names) for which to plot the vector quantity.
  • binSize: the number of pixels in each bin, in horizontal and vertical directions; default is 32 x 32 pixels.
  • outDirPath: string or Pathlib.Path object that overrides the output directory.
  • outFileName: string or Pathlib.Path object that overrides the output file name.
  • outFilePath: string or Pathlib.Path object that overrides the output file path.
  • figSize: the horizontal and vertical size of the output figure in inch; default is 6x6 inch.
  • interactive: whether to leave figures open (True) or save them to file (False).