#include <Analyzer.hpp>
Public Methods | |
Analyzer () | |
Constructor (do nothing). | |
~Analyzer () | |
Destructor (do nothing). | |
ApproxRaytracer::const_iterator | getApertureStop (const ApproxRaytracer &inAxialRay) const |
Get the aperture stop of a system using the axial y-nu trace. More... | |
ApproxRaytracer::iterator | getApertureStop (ApproxRaytracer &inAxialRay) const |
Get the aperture stop of a system using the axial y-nu trace. More... | |
ApproxRaytracer::const_iterator | getFieldStop (const ApproxRaytracer &inChiefRay) const |
Get the field stop of a system using the chief y-nu trace. More... | |
ApproxRaytracer::iterator | getFieldStop (ApproxRaytracer &inAxialRay) const |
Get the field stop of a system using the chief y-nu trace. More... | |
Pupil | getEntrancePupil (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay) const |
Get the entrance pupil of a system using the axial and chief y-nu trace. More... | |
Pupil | getExitPupil (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay) const |
Get the exit pupil of a system using the chief y-nu trace. More... | |
double | getMagnification (const ApproxRaytracer &inChiefRay) const |
Get the magnification of a system using the chief y-nu trace. More... | |
double | evaluateLastCurvature (const ApproxRaytracer &inMarginalRay) const |
Evaluation the last curvature of the optical system using the marginal y-nu trace. More... | |
bool | traceChiefRay (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, ApproxRaytracer &outChiefRay, long double inCY0=1.0, long double inCU0=0.0) const |
Trace an chief ray using an axial raytrace. More... | |
bool | traceMarginalRay (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay, ApproxRaytracer &outMarginalRay) const |
Trace a marginal ray using an axial raytrace. More... |
LOSR::Analyzer is an high level tool to analyze optical systems. It provides different methods that analyze optical system using approximative raytrace tables, such marginal and chief ray.
|
Evaluation the last curvature of the optical system using the marginal y-nu trace. This method evaluate the value of the curvature of the last surface before the image space to get a clean image exactly on the image space. This mean that all the rays that are starting on the same point on the object will be on the point on the image (using approximative raytracing).
00187 { 00188 #ifndef NDEBUG 00189 if(inMarginalRay.size()<2) throw LOSR_RuntimeErrorM("Marginal ray must have at least two entries!"); 00190 #endif // NDEBUG 00191 ApproxRaytracer::const_iterator lIterJ = inMarginalRay.end()-1; 00192 ApproxRaytracer::const_iterator lIterJM1 = inMarginalRay.end()-2; 00193 return ( (lIterJ->mY * lIterJ->mN) + (lIterJM1->mNU * lIterJ->mT) ) / 00194 ( lIterJ->mT * lIterJ->mY * (lIterJ->mN- lIterJM1->mN) ); 00195 } |
|
Get the aperture stop of a system using the axial y-nu trace.
00081 { 00082 const ApproxRaytracer& lConstAxialRay = inAxialRay; 00083 ApproxRaytracer::const_iterator lConstApertureStop = getApertureStop(lConstAxialRay); 00084 return inAxialRay.begin() + ( lConstApertureStop - inAxialRay.begin() ); 00085 } |
|
Get the aperture stop of a system using the axial y-nu trace.
00055 { 00056 #ifndef NDEBUG 00057 if(inAxialRay.size() < 3) throw LOSR_RuntimeErrorM("The axial ray must have at least 3 surfaces!"); 00058 #endif // NDEBUG 00059 ApproxRaytracer::const_iterator lApertureStop = inAxialRay.begin()+1; 00060 double lMinimumRatio = DBL_MAX; 00061 for(ApproxRaytracer::const_iterator i = (inAxialRay.begin()+1); i != (inAxialRay.end()-2); i++) { 00062 if( (i->mR != 0) && (i->mY != 0) ) { 00063 double lRatio = fabs(i->mR / i->mY); 00064 if(lRatio < lMinimumRatio) { 00065 lMinimumRatio = lRatio; 00066 lApertureStop = i; 00067 } 00068 } 00069 } 00070 return lApertureStop; 00071 } |
|
Get the entrance pupil of a system using the axial and chief y-nu trace.
00123 { 00124 #ifndef NDEBUG 00125 if(inChiefRay.size() < 2) throw LOSR_RuntimeErrorM("Chief ray must have at least two entry!"); 00126 if(inAxialRay.size() != inChiefRay.size()) 00127 throw LOSR_RuntimeErrorM("Axial ray and chief ray are not of the same size!"); 00128 #endif // NDEBUG 00129 ApproxRaytracer::const_iterator lApStopChief = 00130 inChiefRay.begin() + (inApertureStop - inAxialRay.begin()); 00131 Pupil lPupil; 00132 lPupil.mM = lApStopChief->mU / inChiefRay.front().mU; 00133 lPupil.mR = lApStopChief->mR * lPupil.mM; 00134 lPupil.mT = inChiefRay.front().mT - ( inChiefRay[1].mY / inChiefRay.front().mU ); 00135 return lPupil; 00136 } |
|
Get the exit pupil of a system using the chief y-nu trace.
00148 { 00149 #ifndef NDEBUG 00150 if(inChiefRay.size() < 2) throw LOSR_RuntimeErrorM("Chief ray must have at least two entry!"); 00151 if(inAxialRay.size() != inChiefRay.size()) 00152 throw LOSR_RuntimeErrorM("Axial ray and chief ray are not of the same size!"); 00153 #endif // NDEBUG 00154 ApproxRaytracer::const_iterator lApStopChief = 00155 inChiefRay.begin() + (inApertureStop - inAxialRay.begin()); 00156 Pupil lPupil; 00157 lPupil.mM = lApStopChief->mU / inChiefRay.back().mU; 00158 lPupil.mR = lApStopChief->mR * lPupil.mM; 00159 lPupil.mT = (inChiefRay.end()-2)->mT + ( (inChiefRay.end()-2)->mY / (inChiefRay.end()-2)->mU ); 00160 return lPupil; 00161 } |
|
Get the field stop of a system using the chief y-nu trace.
00107 { 00108 const ApproxRaytracer& lConstChiefRay = inChiefRay; 00109 ApproxRaytracer::const_iterator lConstFieldStop = getFieldStop(lConstChiefRay); 00110 return inChiefRay.begin() + ( lConstFieldStop - inChiefRay.begin() ); 00111 } |
|
Get the field stop of a system using the chief y-nu trace.
00094 { 00095 // The algorithm is the same than getting the aperture stop. Only the names are differents! 00096 return getApertureStop(inChiefRay); 00097 } |
|
Get the magnification of a system using the chief y-nu trace.
00171 { 00172 return inChiefRay.back().mY / inChiefRay.front().mY; 00173 } |
|
Trace an chief ray using an axial raytrace. Note that one value of the inCY0 and inCU0 are used to calculate the optical invariant.
00211 { 00212 outChiefRay = inAxialRay; 00213 ApproxRaytracer::iterator lApStopChief = 00214 outChiefRay.begin() + (inApertureStop - inAxialRay.begin()); 00215 00216 // Evaluation the optical invariant to get the desired position at the object. 00217 long double lI = ( inCY0 * outChiefRay.front().mN * outChiefRay.front().mU ) - 00218 ( outChiefRay.front().mY * outChiefRay.front().mN * inCU0 ); 00219 long double lCU = -lI / ( lApStopChief->mY * lApStopChief->mN ); 00220 00221 // Doing chief ray trace y-nu du chief ray 00222 return outChiefRay.trace(lApStopChief,0.0,lCU); 00223 } |
|
Trace a marginal ray using an axial raytrace.
00236 { 00237 outMarginalRay = inAxialRay; 00238 Pupil lEntrancePupil = getEntrancePupil(inAxialRay,inApertureStop,inChiefRay); 00239 long double lU0 = lEntrancePupil.mR / lEntrancePupil.mT; 00240 return outMarginalRay.trace(outMarginalRay.begin(),0.0,lU0); 00241 } |