#include <Instrument.hpp>
Public Member Functions | |
virtual Direction | bfkobs (const Position &bfr) const =0 |
virtual Direction | bfky (const Position &bfr) const =0 |
virtual void | detect (PhotonPacket *pp)=0 |
virtual void | determineSameObserverAsPreceding (const Instrument *precedingInstrument)=0 |
void | flush () |
string | instrumentName () const |
const WavelengthGrid * | instrumentWavelengthGrid () const |
bool | isSameObserverAsPreceding () const |
string | itemName () const override |
int | numScatteringLevels () const |
bool | recordComponents () const |
bool | recordPolarization () const |
bool | recordStatistics () const |
WavelengthGrid * | wavelengthGrid () const |
void | write () |
![]() | |
template<class T > | |
T * | find (bool setup=true) const |
template<class T > | |
T * | interface (int levels=-999999, bool setup=true) const |
virtual string | itemName () const |
void | setup () |
string | typeAndName () const |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
Protected Member Functions | |
Instrument () | |
~Instrument () | |
FluxRecorder * | instrumentFluxRecorder () |
void | setSameObserverAsPreceding () |
void | setupSelfAfter () override |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = Instrument |
Private Attributes | |
string | _instrumentName |
const WavelengthGrid * | _instrumentWavelengthGrid |
bool | _isSameObserverAsPreceding |
int | _numScatteringLevels |
bool | _recordComponents |
FluxRecorder * | _recorder |
bool | _recordPolarization |
bool | _recordStatistics |
WavelengthGrid * | _wavelengthGrid |
Friends | |
class | ItemRegistry |
Instrument is an abstract class representing instruments to collect the photon packets during a Monte Carlo simulation. Subclasses implement instruments that can vary in type of projection (e.g. parallel or perspective) and in what is recorded (e.g. SED or full integral field data cube). This top-level abstract class offers a generic interface for receiving photon packets from the simulation. It also includes facilities for configuring user properties that are common to all instruments, such as which flux contributions need to be recorded. A wavelength grid is established either by specifying a grid for this instrument specifically, or by defaulting to the common grid specified for the instrument system.
Properties of sub-types of this type are listed in user interfaces somewhere in between the properties of this type.
|
inlineprotected |
Default constructor for abstract Item subclass Instrument : "an instrument" .
|
protected |
The destructor releases the FluxRecorder instance for this instrument.
This function returns the direction towards the observer, expressed in model coordinates, given the photon packet's launching position. The implementation must be provided in a subclass.
Implemented in AllSkyInstrument, DistantInstrument, HEALPixSkyInstrument, and PerspectiveInstrument.
This function returns the direction along the positive y-axis of the instrument frame, expressed in model coordinates, given the photon packet's launching position. The implementation must be provided in a subclass.
Implemented in AllSkyInstrument, DistantInstrument, HEALPixSkyInstrument, and PerspectiveInstrument.
|
pure virtual |
This function simulates the detection of a photon packet by the instrument. Its implementation must be provided in a subclass.
Implemented in AllSkyInstrument, FrameInstrument, HEALPixSkyInstrument, PerspectiveInstrument, and SEDInstrument.
|
pure virtual |
This function determines whether the specified instrument has the same observer type, position and viewing direction as the receiving instrument, and if so, calls the setSameObserverAsPreceding() function to remember the fact. The function is invoked by the InstrumentSystem during setup. The implementation must be provided in a subclass.
Implemented in AllSkyInstrument, DistantInstrument, HEALPixSkyInstrument, and PerspectiveInstrument.
void Instrument::flush | ( | ) |
This function flushes any information buffered by the detect() function. It simply calls the corresponding function of the FluxRecorder instance associated with this instrument.
|
inlineprotected |
This function returns the FluxRecorder instance associated with this instrument. This function is intended for use in subclasses only.
|
inline |
This function returns the value of the discoverable string property instrumentName : "the name for this instrument" .
|
inline |
This function returns the wavelength grid for the instrument as determined during setup, i.e. either the grid specified for this instrument or the default grid specified for the instrument system. After setup has completed, the function never returns a nulltpr because setupSelfBefore() throws a fatal error if neither of these grids are specified.
|
inline |
This function returns true if the receiving instrument has the same observer type, position and viewing direction as the preceding instrument in the instrument system. This information is determined and cached by the determineSameObserverAsPreceding() function, which is called by the InstrumentSystem during setup.
|
overridevirtual |
This function returns the instrument name as human-readable name for the simulation item, so that it can be used in log messages to identify the instrument and differentiate it from other instruments.
Reimplemented from SimulationItem.
|
inline |
This function returns the value of the discoverable integer property numScatteringLevels : "the number of individually recorded scattering levels" .
The minimum value for this property is "0" .
The maximum value for this property is "99" .
The default value for this property is given by the conditional value expression "0" .
This property is relevant only if the Boolean expression "recordComponents" evaluates to true after replacing the names by true or false depending on their presence.
This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
|
inline |
This function returns the value of the discoverable Boolean property recordComponents : "record flux components separately" .
The default value for this property is given by the conditional value expression "false" .
|
inline |
This function returns the value of the discoverable Boolean property recordPolarization : "record polarization (Stokes vector elements)" .
The default value for this property is given by the conditional value expression "false" .
This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
|
inline |
This function returns the value of the discoverable Boolean property recordStatistics : "record information for calculating statistical properties" .
The default value for this property is given by the conditional value expression "false" .
This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
|
inlineprotected |
This function sets the "isSameObserverAsPreceding" flag to true. By default (i.e. if this function is never invoked) the flag is set to false. This function is intended for use from the determineSameObserverAsPreceding() function implementation in subclasses.
|
overrideprotectedvirtual |
This function finalizes the configuration of FluxRecorder instance for this instrument.
Reimplemented from SimulationItem.
|
overrideprotectedvirtual |
This function performs setup for the instrument. It establishes the wavelength grid for the instrument: if a grid is specified for the instrument, that grid is used. If not, the default wavelength grid specified for the instrument system is used instead. If neither of these grids are specified, the function throws a fatal error.
The function also creates and partially configures the FluxRecorder instance for this instrument, passing it the values of the user properties offered by this class and some extra information on the simulation. The setupSelfBefore() function of each subclass is expected to augment the configuration by calling the includeFluxDensity() and/or includeSurfaceBrightness() functions.
Reimplemented from SimulationItem.
Reimplemented in PerspectiveInstrument, and SEDInstrument.
|
inline |
This function returns the value of the discoverable item property wavelengthGrid : "the wavelength grid for this instrument" .
This property is relevant only if the Boolean expression "Panchromatic" evaluates to true after replacing the names by true or false depending on their presence.
This property is required only if the Boolean expression "!DefaultInstrumentWavelengthGrid" evaluates to true after replacing the names by true or false depending on their presence.
This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
void Instrument::write | ( | ) |
This function calibrates the instrument and outputs the recorded contents to a set of files. It simply calls the corresponding function of the FluxRecorder instance associated with this instrument.