This class serves as an abstract base class for the Instrument and Probe classes. More...
Public Member Functions | |
def | __init__ (self, simulation, xpath) |
The constructor accepts the Simulation instance in which this entity resides, and the xpath of the entity in the ski file for the simulation. More... | |
def | getBoolAttribute (self, attribute) |
This function returns the value of the specified entity attribute as a Boolean value. More... | |
def | getFloatAttribute (self, attribute) |
This function returns the value of the specified entity attribute as a floating point number representing a dimensionless quantity. More... | |
def | getIntAttribute (self, attribute) |
This function returns the value of the specified entity attribute as an integer number. More... | |
def | getQuantityAttribute (self, attribute) |
This function returns the value of the specified entity attribute as an astropy scalar quantity with given units. More... | |
def | getQuantityListAttribute (self, attribute) |
This function returns the value of the specified entity attribute as an astropy quantity array with given units, assuming comma-separated values in the attribute value. More... | |
def | getStringAttribute (self, attribute) |
This function returns the value of the specified entity attribute as a string. More... | |
def | outFilePaths (self, fileType=None) |
This function returns a list of absolute paths to the output files associated with this entity. More... | |
def | prefix (self) |
This function returns the prefix for the simulation with which this entity is associated. More... | |
def | type (self) |
This function returns the type of the entity, i.e. More... | |
def | wavelengthBinWidths (self) |
This function returns an astropy quantity array containing the wavelength bin widths of the wavelength grid associated with this entity, or raises an error if this information cannot be obtained. More... | |
def | wavelengthIndices (self, wavelengths) |
This function uses the wavelengths() function to load the characteristic wavelengths of the wavelength grid associated with this entity, and then determines the zero-based grid index corresponding to (i.e. More... | |
def | wavelengths (self) |
This function returns an astropy quantity array containing the characteristic wavelengths of the wavelength grid associated with this entity, or raises an error if this information cannot be obtained. More... | |
Private Attributes | |
_simulation | |
_xpath | |
This class serves as an abstract base class for the Instrument and Probe classes.
Instances of these classes can be spawned from a Simulation object to represent one of those entities and allow retrieving attributes. This base class implements some common functionality.
def pts.simulation.simulation._SimulationEntity.__init__ | ( | self, | |
simulation, | |||
xpath | |||
) |
The constructor accepts the Simulation instance in which this entity resides, and the xpath of the entity in the ski file for the simulation.
It is intended to be invoked only from within the constructor of a subclass.
Reimplemented in pts.simulation.simulation.Instrument, and pts.simulation.simulation.Probe.
def pts.simulation.simulation._SimulationEntity.getBoolAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as a Boolean value.
The string value is considered to represent True if it contains "true", "t", "yes", "y" or "1" (case insensitive), and False otherwise. If the entity does not have the specified attribute, an error is raised.
def pts.simulation.simulation._SimulationEntity.getFloatAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as a floating point number representing a dimensionless quantity.
If the entity does not have the specified attribute, an error is raised.
def pts.simulation.simulation._SimulationEntity.getIntAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as an integer number.
If the entity does not have the specified attribute, an error is raised.
def pts.simulation.simulation._SimulationEntity.getQuantityAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as an astropy scalar quantity with given units.
If the entity does not have the specified attribute, or if the attribute value does not include a unit string, an error is raised.
def pts.simulation.simulation._SimulationEntity.getQuantityListAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as an astropy quantity array with given units, assuming comma-separated values in the attribute value.
If the entity does not have the specified attribute, or if one of the attribute values does not include a unit string, an error is raised.
def pts.simulation.simulation._SimulationEntity.getStringAttribute | ( | self, | |
attribute | |||
) |
This function returns the value of the specified entity attribute as a string.
If the entity does not have the specified attribute, an error is raised.
def pts.simulation.simulation._SimulationEntity.outFilePaths | ( | self, | |
fileType = None |
|||
) |
This function returns a list of absolute paths to the output files associated with this entity.
If the fileType argument is present, the list is limited to files with a name with a final segment (i.e. the portion after the simulation prefix an entity name) that ends in the specified string. The returned list is sorted alphabetically on filename. The list may be empty.
def pts.simulation.simulation._SimulationEntity.prefix | ( | self | ) |
This function returns the prefix for the simulation with which this entity is associated.
The prefix is used as the initial segment of all output file names.
def pts.simulation.simulation._SimulationEntity.type | ( | self | ) |
This function returns the type of the entity, i.e.
the corresponding SKIRT class name, as a string.
def pts.simulation.simulation._SimulationEntity.wavelengthBinWidths | ( | self | ) |
This function returns an astropy quantity array containing the wavelength bin widths of the wavelength grid associated with this entity, or raises an error if this information cannot be obtained.
The function uses the following mechanisms for obtaining the wavelength bin widths, in the order listed, until one is successful.
If all mechanisms fail, an error is raised.
def pts.simulation.simulation._SimulationEntity.wavelengthIndices | ( | self, | |
wavelengths | |||
) |
This function uses the wavelengths() function to load the characteristic wavelengths of the wavelength grid associated with this entity, and then determines the zero-based grid index corresponding to (i.e.
with a characteristic wavelength nearest to) each of the wavelengths specified as an argument. The wavelengths argument must be an iterable of astropy quantities (including an astropy quantity array). The function returns an iterable of integers with the same length.
def pts.simulation.simulation._SimulationEntity.wavelengths | ( | self | ) |
This function returns an astropy quantity array containing the characteristic wavelengths of the wavelength grid associated with this entity, or raises an error if this information cannot be obtained.
The function uses the following mechanisms for obtaining the wavelength grid, in the order listed, until one is successful.
If all mechanisms fail, an error is raised.