#include <AllSkyProjection.hpp>
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 |
![]() | |
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 | |
AllSkyProjection () | |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = AllSkyProjection |
Friends | |
class | ItemRegistry |
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:
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:
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.
|
inlineprotected |
Default constructor for abstract Item subclass AllSkyProjection : "an all-sky projection" .
|
pure virtual |
Performs the forward transformation from geographical to rectangular coordinates. The implementation must be provided in a subclass.
Implemented in HammerAitoffProjection, and MollweideProjection.
|
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.
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.
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.