An instance of the Simulation class represents all input and output files related to a single performed SKIRT simulation. More...
Public Member Functions | |
def | __init__ (self, prefix="", *skiFilePath=None, inDirPath=None, outDirPath="", process=None) |
The constructor accepts the following arguments: More... | |
def | __getattr__ (self, attrname) |
This function allows invoking any SkiFile function directly on a simulation object. More... | |
def | inDirPath (self) |
This function returns the absolute path to the input directory of the simulation, or None if it is unknown. More... | |
def | inFilePath (self, name) |
This function returns the absolute path for a simulation input file, given the file's name, or None if the input directory path is unknown. More... | |
def | instruments (self) |
This function returns a list of Instrument instances for each of the instruments in the simulation, in their order of appearance in the ski file. More... | |
def | isRunning (self) |
This function returns True if the simulation instance has been created from an asynchronous Skirt.execute() invocation (with "wait=False") and the asynchronous process is still executing. More... | |
def | logFilePath (self) |
This function returns the absolute path for the simulation log file. More... | |
def | logFilePaths (self) |
This function returns a list of absolute filepaths for all log files produced by the simulation, including the master log file and any log files produced by parallel (MPI) processes. More... | |
def | outDirPath (self) |
This function returns the absolute path to the output directory of the simulation. More... | |
def | outFilePath (self, partialname) |
This function returns the absolute path for a simulation output file, given the file's partial name (the partial name does not include the prefix and the subsequent underscore). More... | |
def | parameters (self) |
This function returns a SkiFile object representing the parameter file for this simulation. More... | |
def | prefix (self) |
This function returns the prefix for the simulation, which is used for all output file names. More... | |
def | probes (self, probeType=None, formType=None) |
This function returns a list of Probe instances for each of the probes in the simulation, in their order of appearance in the ski file. More... | |
def | skiFilePath (self) |
This function returns the absolute file path of the input ski file for which the simulation was performed (not the parameters.xml file generated by SKIRT), or None if it is unknown. More... | |
def | status (self) |
This function returns the status of the simulation, based on its process completion state (if available) and the contents of its log file, as one of the following strings: More... | |
Private Attributes | |
_inDirPath | |
_outDirPath | |
_parameters | |
_prefix | |
_process | |
_running | |
_skiFilePath | |
An instance of the Simulation class represents all input and output files related to a single performed SKIRT simulation.
To create an instance of the class, one specifies the name of the ski file (used as prefix for all output filenames) plus directory paths for the input and output files. The methods of the class allow retrieving all kinds of information about the simulation results.
The code in this class uses ad-hoc knowledge about SKIRT's data formats and naming schemes; for example:
def pts.simulation.simulation.Simulation.__init__ | ( | self, | |
prefix = "" , |
|||
* | skiFilePath = None , |
||
inDirPath = None , |
|||
outDirPath = "" , |
|||
process = None |
|||
) |
The constructor accepts the following arguments:
.ski filename extension) and which has been used as a prefix for all output file names. If the prefix argument is empty or missing, the skiFilePath argument must be provided so that the prefix can be automatically derived from the (stem of the name of) the specified ski file.parameters.xml
file generated by SKIRT). This argument is optional, but if it is omitted, the prefix argument must be present and non-empty.All paths described above are interpreted as described for the pts.utils.absPath() function.
def pts.simulation.simulation.Simulation.__getattr__ | ( | self, | |
attrname | |||
) |
This function allows invoking any SkiFile function directly on a simulation object.
For example, self.instrumentNames() is automatically translated to self.parameters().instrumentNames().
def pts.simulation.simulation.Simulation.inDirPath | ( | self | ) |
This function returns the absolute path to the input directory of the simulation, or None if it is unknown.
def pts.simulation.simulation.Simulation.inFilePath | ( | self, | |
name | |||
) |
This function returns the absolute path for a simulation input file, given the file's name, or None if the input directory path is unknown.
def pts.simulation.simulation.Simulation.instruments | ( | self | ) |
This function returns a list of Instrument instances for each of the instruments in the simulation, in their order of appearance in the ski file.
def pts.simulation.simulation.Simulation.isRunning | ( | self | ) |
This function returns True if the simulation instance has been created from an asynchronous Skirt.execute() invocation (with "wait=False") and the asynchronous process is still executing.
Otherwise, the function returns False. Note that this is not always exactly the same as the result of "status() == 'Running'".
def pts.simulation.simulation.Simulation.logFilePath | ( | self | ) |
This function returns the absolute path for the simulation log file.
def pts.simulation.simulation.Simulation.logFilePaths | ( | self | ) |
This function returns a list of absolute filepaths for all log files produced by the simulation, including the master log file and any log files produced by parallel (MPI) processes.
The list includes only paths for log files that actually exist, and the paths are listed in order of process rank.
def pts.simulation.simulation.Simulation.outDirPath | ( | self | ) |
This function returns the absolute path to the output directory of the simulation.
def pts.simulation.simulation.Simulation.outFilePath | ( | self, | |
partialname | |||
) |
This function returns the absolute path for a simulation output file, given the file's partial name (the partial name does not include the prefix and the subsequent underscore).
def pts.simulation.simulation.Simulation.parameters | ( | self | ) |
This function returns a SkiFile object representing the parameter file for this simulation.
def pts.simulation.simulation.Simulation.prefix | ( | self | ) |
This function returns the prefix for the simulation, which is used for all output file names.
def pts.simulation.simulation.Simulation.probes | ( | self, | |
probeType = None , |
|||
formType = None |
|||
) |
This function returns a list of Probe instances for each of the probes in the simulation, in their order of appearance in the ski file.
The list can be limited to probes of the specified type(s) and/or with the specified assocated form type(s).
def pts.simulation.simulation.Simulation.skiFilePath | ( | self | ) |
This function returns the absolute file path of the input ski file for which the simulation was performed (not the parameters.xml
file generated by SKIRT), or None if it is unknown.
def pts.simulation.simulation.Simulation.status | ( | self | ) |
This function returns the status of the simulation, based on its process completion state (if available) and the contents of its log file, as one of the following strings: