The SKIRT project
advanced radiative transfer for astrophysics
FrameInstrument Class Reference

#include <FrameInstrument.hpp>

Inheritance diagram for FrameInstrument:

Public Member Functions

double centerX () const
double centerY () const
void detect (PhotonPacket *pp) override
double fieldOfViewX () const
double fieldOfViewY () const
int numPixelsX () const
int numPixelsY () const
Public Member Functions inherited from DistantInstrument
double azimuth () const
Direction bfkobs (const Position &bfr) const override
Direction bfky (const Position &bfr) const override
void determineSameObserverAsPreceding (const Instrument *precedingInstrument) override
double distance () const
double inclination () const
double roll () const
Public Member Functions inherited from Instrument
void flush ()
string instrumentName () const
const WavelengthGridinstrumentWavelengthGrid () const
bool isSameObserverAsPreceding () const
string itemName () const override
int numScatteringLevels () const
bool recordComponents () const
bool recordPolarization () const
bool recordStatistics () const
WavelengthGridwavelengthGrid () const
void write ()
Public Member Functions inherited from SimulationItem
template<class T>
T * find (bool setup=true) const
template<class T>
T * interface (int levels=-999999, bool setup=true) const
void setup ()
string typeAndName () const
Public Member Functions inherited from Item
 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 ItemgetItemProperty (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)
Itemoperator= (const Item &)=delete
Itemparent () 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

 FrameInstrument ()
void setupSelfBefore () override
Protected Member Functions inherited from DistantInstrument
 DistantInstrument ()
Protected Member Functions inherited from Instrument
 Instrument ()
 ~Instrument ()
FluxRecorderinstrumentFluxRecorder ()
void setSameObserverAsPreceding ()
void setupSelfAfter () override
void setupSelfBefore () override
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Private Member Functions

int pixelOnDetector (const PhotonPacket *pp) const

Private Attributes

double _centerX
double _centerY
double _cosomega
double _cosphi
double _costheta
double _fieldOfViewX
double _fieldOfViewY
int _numPixelsX
int _numPixelsY
int _Nxp
int _Nyp
double _sinomega
double _sinphi
double _sintheta
double _xpmin
double _xpsiz
double _ypmin
double _ypsiz

Friends

class ItemRegistry

Detailed Description

A FrameInstrument object represents a distant instrument that records the surface brightness in every pixel of a given frame for each wavelength, and outputs an IFU data cube in a FITS file.

The instrument allows configuring the field of view and number of pixels in both directions of the observer plane. Photon packets arriving from a point that parallel projects outside of the field of view are ignored.

Constructor & Destructor Documentation

◆ FrameInstrument()

FrameInstrument::FrameInstrument ( )
inlineprotected

Default constructor for concrete Item subclass FrameInstrument: "a distant instrument that outputs the surface brightness in every pixel as a data cube".

Member Function Documentation

◆ centerX()

double FrameInstrument::centerX ( ) const
inline

This function returns the value of the discoverable double property centerX: "the center of the frame in the horizontal direction".

This property represents a physical quantity of type "length".

The default value for this property is given by the conditional value expression "0".

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.

◆ centerY()

double FrameInstrument::centerY ( ) const
inline

This function returns the value of the discoverable double property centerY: "the center of the frame in the vertical direction".

This property represents a physical quantity of type "length".

The default value for this property is given by the conditional value expression "0".

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.

◆ detect()

void FrameInstrument::detect ( PhotonPacket * pp)
overridevirtual

This function simulates the detection of a photon packet by the instrument. It determines the projected position of the photon packet's last interaction site on the instrument frame and then calls the detect() function of the FluxRecorder instance associated with this instrument.

Implements Instrument.

◆ fieldOfViewX()

double FrameInstrument::fieldOfViewX ( ) const
inline

This function returns the value of the discoverable double property fieldOfViewX: "the total field of view in the horizontal direction".

This property represents a physical quantity of type "length".

The minimum value for this property is "]0".

◆ fieldOfViewY()

double FrameInstrument::fieldOfViewY ( ) const
inline

This function returns the value of the discoverable double property fieldOfViewY: "the total field of view in the vertical direction".

This property represents a physical quantity of type "length".

The minimum value for this property is "]0".

◆ numPixelsX()

int FrameInstrument::numPixelsX ( ) const
inline

This function returns the value of the discoverable integer property numPixelsX: "the number of pixels in the horizontal direction".

The minimum value for this property is "1".

The maximum value for this property is "10000".

The default value for this property is given by the conditional value expression "250".

◆ numPixelsY()

int FrameInstrument::numPixelsY ( ) const
inline

This function returns the value of the discoverable integer property numPixelsY: "the number of pixels in the vertical direction".

The minimum value for this property is "1".

The maximum value for this property is "10000".

The default value for this property is given by the conditional value expression "250".

◆ pixelOnDetector()

int FrameInstrument::pixelOnDetector ( const PhotonPacket * pp) const
private

This private helper function returns the index of the spatial pixel on the detector that will be hit by a photon packet, or -1 if the photon packet does not hit the detector. Given the position \({\boldsymbol{x}}=(x,y,z)\) of the last emission or scattering event of the photon packet, the direction \({\boldsymbol{k}}_{\text{obs}} = (\theta,\varphi)\) towards the observer, and the roll angle \(\omega\) of the instrument, the impact coordinates \((x_{\text{p}},y_{\text{p}})\) are given by the following Euler-like transformation, where \(z_{\text{p}}\) is ignored:

\[ \begin{bmatrix}x_{\text{p}} \\ y_{\text{p}} \\ z_{\text{p}} \end{bmatrix} = \begin{bmatrix}\cos\omega & -\sin\omega & 0\\ \sin\omega & \cos\omega & 0\\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \cos\theta & 0 & -\sin\theta \\ 0 & 1 & 0 \\ \sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix}\cos\varphi & -\sin(-\varphi) & 0 \\ \sin(-\varphi) & \cos\varphi & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix}x\\y\\z \end{bmatrix} \]

In other words, the originating position is rotated about the Z-axis over the azimuth angle \(\varphi\) (with a minus sign because the observer is looking towards the center rather than along the specified direction), then rotated about the new Y-axis over the inclination angle \(\theta\), and finally rotated about the new Z-axis over the roll angle \(\omega\) reduced by 90 degrees (this constant transformation over -90 degrees is represented above as a separate matrix). The 90 degree correction on the roll angle is introduced so that it would be more natural to specify this angle; in most cases it can be left to its default value of 0. Given these impact coordinates, the pixel indices \(i\) and \(j\) are determined as

\[ \begin{split} i &= \frac{{\text{floor}}(x_{\text{p}}-x_{\text{min}})}{\Delta x} \\ j &= \frac{{\text{floor}}(y_{\text{p}}-y_{\text{max}})}{\Delta y} \end{split} \]

where \({\text{floor}}(z)\) is an operator that returns the largest integer that is not greater than \(y\). The spatial pixel number \(l\) is then determined as \(l=i+j\,N_x\), asuming \(i\) and \(j\) are indeed within the detector range.

◆ setupSelfBefore()

void FrameInstrument::setupSelfBefore ( )
overrideprotectedvirtual

This function configures the FluxRecorder instance associated with this instrument.

Reimplemented from DistantInstrument.

Reimplemented in FullInstrument.


The documentation for this class was generated from the following file: