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

Plot data from a SKIRT stored table file. More...

Functions

def plotStoredTableCurve (tableFilePath, horAxis=0, verAxis=0, *axis0=None, axis1=None, axis2=None, axis3=None, axis4=None, outDirPath=None, outFileName=None, outFilePath=None, figSize=(8, 6), interactive=None)
 This function creates a plot of a particular 1D curve from the data in a specified SKIRT stored table file. More...
 
def plotStoredTableInteractive (tableFilePath, *figSize=(8, 6))
 This function creates an interactive plot of a 1D curve from the data in a specified SKIRT stored table file. More...
 

Detailed Description

Plot data from a SKIRT stored table file.

This module offer functions to create plots from the data in a SKIRT stored table file.

Function Documentation

◆ plotStoredTableCurve()

def pts.visual.plotstoredtable.plotStoredTableCurve (   tableFilePath,
  horAxis = 0,
  verAxis = 0,
axis0 = None,
  axis1 = None,
  axis2 = None,
  axis3 = None,
  axis4 = None,
  outDirPath = None,
  outFileName = None,
  outFilePath = None,
  figSize = (8, 6),
  interactive = None 
)

This function creates a plot of a particular 1D curve from the data in a specified SKIRT stored table file.

The function accepts the following optional arguments to configure the plot:

  • horAxis: zero-based index of the table axis on the horizontal plot axis (default = 0)
  • verAxis: zero-based index of the table quantity on the vertical plot axis (default = 0)
  • axis0, axis1, axis2, axis3, axis4: ordinate value for the table axis with the indicated zero-based index (default = arithmetic or geometric mean of the axis range; ignored for axes not in the table)

Thus, by default, the script plots the first table quantity as a function of the first table axis, with half-way values for the other axes, if any.

The table file path is interpreted as described for the pts.utils.absPath() function. By default, the figure is saved as FigStoredTable.pdf in the current directory. 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 figure is not saved and it is left open so that is displayed in notebooks.

◆ plotStoredTableInteractive()

def pts.visual.plotstoredtable.plotStoredTableInteractive (   tableFilePath,
figSize = (8, 6) 
)

This function creates an interactive plot of a 1D curve from the data in a specified SKIRT stored table file.

It is intended for use from a notebook environment such as the one offered by Jupyter notebook. The stored table file path and the figure size are passed as arguments to this function. Other aspects of the plot, such as what to show on the horizontal and vertical axis, can be configured interactively via a user interface created through the ipywidgets package using the metadata in the stored table file.

The table file path is interpreted as described for the pts.utils.absPath() function. The generated figure is not saved and is left open so that is displayed in notebooks.

The function returns the stored table dictionary loaded by pts.storedtable.io.readStoredTable so that the interactive user can inspect its contents in further detail if desired.