The SKIRT project
advanced radiative transfer for astrophysics
ReadFits3DGeometry Class Reference

#include <ReadFits3DGeometry.hpp>

Inheritance diagram for ReadFits3DGeometry:

Public Member Functions

double density (Position bfr) const override
string filename () const
Position generatePosition () const override
double pixelScale () const
double SigmaX () const override
double SigmaY () const override
double SigmaZ () const override
Public Member Functions inherited from GenGeometry
int dimension () const override
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
virtual string itemName () 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

 ReadFits3DGeometry ()
void setupSelfBefore () override
Protected Member Functions inherited from GenGeometry
 GenGeometry ()
Protected Member Functions inherited from Geometry
 Geometry ()
Randomrandom () const
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
virtual void setupSelfAfter ()
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Private Attributes

Array _datacube
string _filename
int _nx
int _ny
int _nz
double _pixelScale
double _xmin
Array _Xv
double _ymin
double _zmin

Friends

class ItemRegistry

Detailed Description

The ReadFits3DGeometry class is a subclass of the GenGeometry class, and describes an arbitrary 3D geometry for a single component read from a FITS file datacube. The model geometry is defined by two parameters: the input filename and the pixel scale (i.e. the physical length per pixel). The geometry is automatically centered on the origin.

The input geometry should be provided as a 3D datacube, i.e. an ndarray with shape (nx, ny, nz), stored in an HDU of the FITS input file. The order of axes is x, y, z and the header corresponding to this data array resembles:

NAXIS   =                    3 / number of array dimensions
NAXIS1  =                   nx
NAXIS2  =                   ny
NAXIS3  =                   nz

with nx, ny and nz the number of cells in each spatial dimension. The input filename should include the ".fits" filename extension. By default, the first HDU with nonempty data is used. Using the data from another HDU in the provided file is possible by specifying this HDU name between square brackets after the input filename, for example: "geometry.fits[USETHISHDU]".

This item type is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

Constructor & Destructor Documentation

◆ ReadFits3DGeometry()

ReadFits3DGeometry::ReadFits3DGeometry ( )
inlineprotected

Default constructor for concrete Item subclass ReadFits3DGeometry: "a geometry read from a 3D FITS file".

Member Function Documentation

◆ density()

double ReadFits3DGeometry::density ( Position bfr) const
overridevirtual

This function returns the density \(\rho(x,y,z)\) at the position (x,y,z).

Implements Geometry.

◆ filename()

string ReadFits3DGeometry::filename ( ) const
inline

This function returns the value of the discoverable string property filename: "the filename of the datacube".

◆ generatePosition()

Position ReadFits3DGeometry::generatePosition ( ) const
overridevirtual

This function generates a random position \((x,y,z)\) from the geometry, by drawing a random point from the appropriate probability density distribution function. The \((x,y,z)\) coordinates are derived from the normalized cumulative distribution vector.

Implements Geometry.

◆ pixelScale()

double ReadFits3DGeometry::pixelScale ( ) const
inline

This function returns the value of the discoverable double property pixelScale: "the pixel scale for the datacube (i.e. the physical length per pixel)".

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

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

◆ setupSelfBefore()

void ReadFits3DGeometry::setupSelfBefore ( )
overrideprotectedvirtual

This function reads in the .fits datacube. A vector with the normalized cumulative distribution in each spaxel is computed, satisfying the condition that the total mass equals 1.

Reimplemented from Geometry.

◆ SigmaX()

double ReadFits3DGeometry::SigmaX ( ) const
overridevirtual

This function returns the X-axis surface density, i.e. the integration of the density along the entire X-axis,

\[ \Sigma_X = \int_{-\infty}^\infty \rho(x,0,0) \, \text{d} x \]

Implements Geometry.

◆ SigmaY()

double ReadFits3DGeometry::SigmaY ( ) const
overridevirtual

This function returns the Y-axis surface density, i.e. the integration of the density along the entire Y-axis,

\[ \Sigma_Y = \int_{-\infty}^\infty \rho(0,y,0) \, \text{d} y \]

Implements Geometry.

◆ SigmaZ()

double ReadFits3DGeometry::SigmaZ ( ) const
overridevirtual

This function returns the Z-axis surface density, i.e. the integration of the density along the entire Z-axis,

\[ \Sigma_Z = \int_{-\infty}^\infty \rho(0,0,z) \, \text{d} z \]

Implements Geometry.


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