RefractionExtinction.hpp | RefractionExtinction.hpp | |||
---|---|---|---|---|

skipping to change at line 58 | skipping to change at line 58 | |||

//! Define the extinction strategy for rendering underground objects (useful when ground is not rendered) | //! Define the extinction strategy for rendering underground objects (useful when ground is not rendered) | |||

enum UndergroundExtinctionMode { | enum UndergroundExtinctionMode { | |||

UndergroundExtinctionZero = 0, //!< Zero extinction: stars visible in full brightness | UndergroundExtinctionZero = 0, //!< Zero extinction: stars visible in full brightness | |||

UndergroundExtinctionMax = 1, //!< Maximum extinction: coe f 42, i.e practically invisible | UndergroundExtinctionMax = 1, //!< Maximum extinction: coe f 42, i.e practically invisible | |||

UndergroundExtinctionMirror = 2 //!< Mirror the extinction f or the same altutide above the ground. | UndergroundExtinctionMirror = 2 //!< Mirror the extinction f or the same altutide above the ground. | |||

}; | }; | |||

Extinction(); | Extinction(); | |||

//! Compute extinction effect for arrays of size @param num position vectors and magnitudes. | //! Compute extinction effect for arrays of size @param num position vectors and magnitudes. | |||

//! @param altAzPos are the NORMALIZED (!!) (geometrical) star posit ion vectors, and their z components sin(apparent_altitude). | //! @param altAzPos are the NORMALIZED (!!) (geometrical) star posit ion vectors, and their z components sin(geometric_altitude). | |||

//! This call must therefore be done before application of Refractio n if atmospheric effects are on. | //! This call must therefore be done before application of Refractio n if atmospheric effects are on. | |||

//! Note that forward/backward are no absolute reverse operations! | //! Note that forward/backward are no absolute reverse operations! | |||

void forward(const Vec3d& altAzPos, float* mag) const | void forward(const Vec3d& altAzPos, float* mag) const | |||

{ | { | |||

Q_ASSERT(std::fabs(altAzPos.length()-1.f)<0.001f); | Q_ASSERT(std::fabs(altAzPos.length()-1.f)<0.001f); | |||

*mag += airmass(altAzPos[2], false) * ext_coeff; | *mag += airmass(altAzPos[2], false) * ext_coeff; | |||

} | } | |||

void forward(const Vec3f& altAzPos, float* mag) const | void forward(const Vec3f& altAzPos, float* mag) const | |||

{ | { | |||

Q_ASSERT(std::fabs(altAzPos.length()-1.f)<0.001f); | Q_ASSERT(std::fabs(altAzPos.length()-1.f)<0.001f); | |||

*mag += airmass(altAzPos[2], false) * ext_coeff; | *mag += airmass(altAzPos[2], false) * ext_coeff; | |||

} | } | |||

//! Compute inverse extinction effect for arrays of size @param num position vectors and magnitudes. | //! Compute inverse extinction effect for arrays of size @param num position vectors and magnitudes. | |||

//! @param altAzPos are the NORMALIZED (!!) (geometrical) star posit ion vectors, and their z components sin(apparent_altitude). | //! @param altAzPos are the NORMALIZED (!!) (geometrical) star posit ion vectors, and their z components sin(geometric_altitude). | |||

//! Note that forward/backward are no absolute reverse operations! | //! Note that forward/backward are no absolute reverse operations! | |||

void backward(const Vec3d& altAzPos, float* mag) const | void backward(const Vec3d& altAzPos, float* mag) const | |||

{ | { | |||

*mag -= airmass(altAzPos[2], false) * ext_coeff; | *mag -= airmass(altAzPos[2], false) * ext_coeff; | |||

} | } | |||

void backward(const Vec3f& altAzPos, float* mag) const | void backward(const Vec3f& altAzPos, float* mag) const | |||

{ | { | |||

*mag -= airmass(altAzPos[2], false) * ext_coeff; | *mag -= airmass(altAzPos[2], false) * ext_coeff; | |||

} | } | |||

skipping to change at line 99 | skipping to change at line 99 | |||

float getExtinctionCoefficient() const {return ext_coeff;} | float getExtinctionCoefficient() const {return ext_coeff;} | |||

void setUndergroundExtinctionMode(UndergroundExtinctionMode mode) {u ndergroundExtinctionMode=mode;} | void setUndergroundExtinctionMode(UndergroundExtinctionMode mode) {u ndergroundExtinctionMode=mode;} | |||

UndergroundExtinctionMode getUndergroundExtinctionMode() const {retu rn undergroundExtinctionMode;} | UndergroundExtinctionMode getUndergroundExtinctionMode() const {retu rn undergroundExtinctionMode;} | |||

private: | private: | |||

//! airmass computation for @param cosZ = cosine of zenith angle z ( =sin(altitude)!). | //! airmass computation for @param cosZ = cosine of zenith angle z ( =sin(altitude)!). | |||

//! The default (@param apparent_z = true) is computing airmass from observed altitude, following Rozenberg (1966) [X(90)~40]. | //! The default (@param apparent_z = true) is computing airmass from observed altitude, following Rozenberg (1966) [X(90)~40]. | |||

//! if (@param apparent_z = false), we have geometrical altitude and compute airmass from that, | //! if (@param apparent_z = false), we have geometrical altitude and compute airmass from that, | |||

//! following Young: Air mass and refraction. Applied Optics 33(6), pp.1108-1110, 1994. [X(90)~32]. | //! following Young: Air mass and refraction. Applied Optics 33(6), pp.1108-1110, 1994. [X(90)~32]. | |||

//! A problem ist that refraction depends on air pressure and temper ature, but Young's formula assumes T=15C, p=1013.25mbar. | //! A problem is that refraction depends on air pressure and tempera ture, but Young's formula assumes T=15C, p=1013.25mbar. | |||

//! So, it seems better to compute refraction first, and then use th e Rozenberg formula here. | //! So, it seems better to compute refraction first, and then use th e Rozenberg formula here. | |||

//! Rozenberg is infinite at Z=92.17 deg, Young at Z=93.6 deg, so th is function RETURNS SUBHORIZONTAL_AIRMASS BELOW -2 DEGREES! | //! Rozenberg is infinite at Z=92.17 deg, Young at Z=93.6 deg, so th is function RETURNS SUBHORIZONTAL_AIRMASS BELOW -2 DEGREES! | |||

float airmass(float cosZ, const bool apparent_z=true) const; | float airmass(float cosZ, const bool apparent_z=true) const; | |||

//! k, magnitudes/airmass, in [0.00, ... 1.00], (default 0.20). | //! k, magnitudes/airmass, in [0.00, ... 1.00], (default 0.20). | |||

float ext_coeff; | float ext_coeff; | |||

//! Define what we are going to do for underground stars when ground is not rendered | //! Define what we are going to do for underground stars when ground is not rendered | |||

UndergroundExtinctionMode undergroundExtinctionMode; | UndergroundExtinctionMode undergroundExtinctionMode; | |||

}; | }; | |||

//! @class Refraction | //! @class Refraction | |||

//! This class performs refraction computations, following literature from atmospheric optics and astronomy. | //! This class performs refraction computations, following literature from atmospheric optics and astronomy. | |||

//! Refraction solutions can only be aproximate, given the turbulent, unpre dictable real atmosphere. | //! Refraction solutions can only be approximate, given the turbulent, unpr edictable real atmosphere. | |||

//! Typical horizons do not go down below -1, so strange effects (distortio n) between -2 and -5 should be covered. | //! Typical horizons do not go down below -1, so strange effects (distortio n) between -2 and -5 should be covered. | |||

//! Note that forward/backward are no absolute reverse operations! | //! Note that forward/backward are no absolute reverse operations! | |||

//! All the computations should be in effect | //! All the computations should be in effect | |||

//! (1) only if atmosphere effects are true | //! (1) only if atmosphere effects are true | |||

//! (2) only for celestial objects, never for landscape images | //! (2) only for celestial objects, never for landscape images | |||

//! (3) only for terrestrial locations, not on Moon/Mars/Saturn etc | //! (3) only for terrestrial locations, not on Moon/Mars/Saturn etc | |||

class Refraction: public StelProjector::ModelViewTranform | class Refraction: public StelProjector::ModelViewTranform | |||

{ | { | |||

public: | public: | |||

skipping to change at line 179 | skipping to change at line 179 | |||

void updatePrecomputed(); | void updatePrecomputed(); | |||

void innerRefractionForward(Vec3d& altAzPos) const; | void innerRefractionForward(Vec3d& altAzPos) const; | |||

void innerRefractionBackward(Vec3d& altAzPos) const; | void innerRefractionBackward(Vec3d& altAzPos) const; | |||

//! These 3 Atmosphere parameters can be controlled by GUI. | //! These 3 Atmosphere parameters can be controlled by GUI. | |||

//! Pressure[mbar] (1013) | //! Pressure[mbar] (1013) | |||

float pressure; | float pressure; | |||

//! Temperature[Celsius deg] (10). | //! Temperature[Celsius deg] (10). | |||

float temperature; | float temperature; | |||

////! Numerator of refraction formula, to be cached for speed. | ||||

//7float press_temp_corr_Saemundson; | ||||

//! Correction factor for refraction formula, to be cached for speed . | //! Correction factor for refraction formula, to be cached for speed . | |||

double press_temp_corr; | float press_temp_corr; | |||

//! Used to pretransform coordinates into AltAz frame. | //! Used to pretransform coordinates into AltAz frame. | |||

Mat4d preTransfoMat; | Mat4d preTransfoMat; | |||

Mat4d invertPreTransfoMat; | Mat4d invertPreTransfoMat; | |||

Mat4f preTransfoMatf; | Mat4f preTransfoMatf; | |||

Mat4f invertPreTransfoMatf; | Mat4f invertPreTransfoMatf; | |||

//! Used to postransform refracted coordinates from AltAz to view. | //! Used to postransform refracted coordinates from AltAz to view. | |||

Mat4d postTransfoMat; | Mat4d postTransfoMat; | |||

Mat4d invertPostTransfoMat; | Mat4d invertPostTransfoMat; | |||

End of changes. 6 change blocks. | ||||

7 lines changed or deleted | | 5 lines changed or added | ||

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |