The SKIRT project
advanced radiative transfer for astrophysics
AllSkyProjection Class Referenceabstract

#include <AllSkyProjection.hpp>

Inheritance diagram for AllSkyProjection:

Public Member Functions

virtual void fromGlobeToRectangle (double longitude, double latitude, double &x, double &y) const =0
virtual bool fromRectangleToGlobe (double x, double y, double &longitude, double &latitude) const =0
bool fromRectangleToSphere (double x, double y, double &inclination, double &azimuth) const
void fromSphereToRectangle (double inclination, double azimuth, double &x, double &y) const
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

 AllSkyProjection ()
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
virtual void setupSelfAfter ()
virtual void setupSelfBefore ()
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Friends

class ItemRegistry

Detailed Description

AllSkyProjection is an abstract class representing projections that map an arbitrary direction on the unit sphere to a point in a rectangular frame, and vice versa. This base class defines an interface for use by client classes, and each subclass implements a specific projection.

All-sky projections are usually based on geographic map projections designed in the context of charting the earth. Different coordinate conventions are used in each field, and unfortunately the standard notation confusingly uses the same symbols to mean something different. To avoid this confusion, we use the quantity names rather than mathematical symbols in the discussion below, and for the argument names in the functions of this class.

We effectively define three coordinate systems:

  • Rectangular coordinates (x,y) where x and y each range from -1 to 1 (even if the rectangle is usually represented two times wider than tall. Some portion near the corners is usually unused by the transformation.
  • Spherical coordinates (inclination,azimuth) identical to the coordinates used elsewhere in SKIRT, for example as returned by the Direction class. Inclination ranges from 0 to \(\pi\), and azimuth from \(-\pi\) to \(\pi\) (relative to the x-axis).
  • Geographical coordinates (longitude, latitude) with Greenwich/equatorial reference. Longitude ranges from \(-\pi\) to \(\pi\), and latitude from \(-\pi/2\) to \(\pi/2\)

Including an east-west flip because an all-sky projection looks from inside the sphere, while a geographical map looks from outside of the sphere, conversion from spherical to geographical coordinates reads:

  • longitude = -azimuth
  • latitude = \(\pi/2\) - inclination

Projection properties

Projecting a sphere to a rectangle necessarily introduces distortions to distance, angle, shape, and/or area. To properly work with the SKIRT instrument flux calibration, an all-sky projection must be preserve area ("equal area"), while it may and probably will distort distance, angle and shape. Furthermore, in the rectangular coordinates defined above, the portion of the rectangle that maps to the sphere (the "used" portion) must be a circle with radius one.

Constructor & Destructor Documentation

◆ AllSkyProjection()

AllSkyProjection::AllSkyProjection ( )
inlineprotected

Default constructor for abstract Item subclass AllSkyProjection: "an all-sky projection".

Member Function Documentation

◆ fromGlobeToRectangle()

virtual void AllSkyProjection::fromGlobeToRectangle ( double longitude,
double latitude,
double & x,
double & y ) const
pure virtual

Performs the forward transformation from geographical to rectangular coordinates. The implementation must be provided in a subclass.

Implemented in HammerAitoffProjection, and MollweideProjection.

◆ fromRectangleToGlobe()

virtual bool AllSkyProjection::fromRectangleToGlobe ( double x,
double y,
double & longitude,
double & latitude ) const
pure virtual

Performs the backward transformation from rectangular to geographical coordinates. If the specified rectangular coordinate values are outside of the possible range for this transform, the function returns false and the value of the output variables is undefined. The implementation must be provided in a subclass.

Implemented in HammerAitoffProjection, and MollweideProjection.

◆ fromRectangleToSphere()

bool AllSkyProjection::fromRectangleToSphere ( double x,
double y,
double & inclination,
double & azimuth ) const

Performs the backward transformation from rectangular to spherical coordinates. If the specified rectangular coordinate values are outside of the possible range for this transform, the function returns false and the value of the output variables is undefined. This function is implemented here in the base class; it calls fromRectangleToGlobe() and adjusts the resulting coordinates.

◆ fromSphereToRectangle()

void AllSkyProjection::fromSphereToRectangle ( double inclination,
double azimuth,
double & x,
double & y ) const

Performs the forward transformation from spherical to rectangular coordinates. This function is implemented here in the base class; it calls fromGlobeToRectangle() with adjusted coordinates.


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