USGS

Isis 3.0 Object Programmers' Reference

Home

Lambert.cpp
00001 #include <cmath>
00002 #include "Lambert.h"
00003 
00004 namespace Isis {
00005   double Lambert::PhotoModelAlgorithm(double phase, double incidence,
00006                                       double emission) {
00007     static double pht_lambert;
00008     double incrad;
00009     double munot;
00010 
00011     static double old_phase = -9999;
00012     static double old_incidence = -9999;
00013     static double old_emission= -9999;
00014 
00015     if (old_phase == phase && old_incidence == incidence && old_emission == emission) {
00016       return pht_lambert;
00017     }
00018 
00019     old_phase = phase;
00020     old_incidence = incidence;
00021     old_emission = emission;
00022 
00023     incrad = incidence * Isis::PI / 180.0;
00024     munot = cos(incrad);
00025 
00026     if(munot <= 0.0 || incidence == 90.0) {
00027       pht_lambert = 0.0;
00028     }
00029     else {
00030       pht_lambert = munot;
00031     }
00032 
00033     return pht_lambert;
00034   }
00035 }
00036 
00037 extern "C" Isis::PhotoModel *LambertPlugin(Isis::Pvl &pvl) {
00038   return new Isis::Lambert(pvl);
00039 }