9 Topo::Topo(Pvl &pvl, PhotoModel &pmodel) : NormModel(pvl, pmodel) {
10 PvlGroup &algorithm = pvl.findObject(
"NormalizationModel").findGroup(
"Algorithm",
Pvl::Traverse);
18 if(algorithm.hasKeyword(
"Incref")) {
19 SetNormIncref(algorithm[
"Incref"]);
22 if(algorithm.hasKeyword(
"Pharef")) {
23 SetNormPharef(algorithm[
"Pharef"]);
25 p_normPharef = p_normIncref;
28 if(algorithm.hasKeyword(
"Emaref")) {
29 SetNormEmaref(algorithm[
"Emaref"]);
32 if(algorithm.hasKeyword(
"Thresh")) {
33 SetNormThresh(algorithm[
"Thresh"]);
36 if(algorithm.hasKeyword(
"Albedo")) {
37 SetNormAlbedo(algorithm[
"Albedo"]);
41 void Topo::NormModelAlgorithm(
double phase,
double incidence,
double emission,
42 double demincidence,
double dememission,
double dn,
43 double &albedo,
double &mult,
double &base) {
45 static double pprimeref;
46 static double psurfref;
51 static double old_phase = -9999;
52 static double old_incidence = -9999;
53 static double old_emission = -9999;
54 static double old_demincidence = -9999;
55 static double old_dememission = -9999;
57 if (old_phase != phase || old_incidence != incidence || old_emission != emission ||
58 old_demincidence != demincidence || old_dememission != dememission) {
64 std::string msg =
"Divide by zero error";
68 rhobar = p_normAlbedo / psurf0;
71 psurfref = GetPhotoModel()->
CalcSurfAlbedo(p_normPharef, p_normIncref, p_normEmaref);
72 pprimeref = GetPhotoModel()->
PhtTopder(p_normPharef, p_normIncref, p_normEmaref);
76 psurf = GetPhotoModel()->
CalcSurfAlbedo(phase, demincidence, dememission);
77 pprime = GetPhotoModel()->
PhtTopder(phase, demincidence, dememission);
80 old_incidence = incidence;
81 old_emission = emission;
82 old_demincidence = demincidence;
83 old_dememission = dememission;
86 if(psurf * pprimeref > pprime * p_normThresh) {
91 std::string msg =
"Divide by zero error";
95 albedo = dn * rhobar * (psurf * pprimeref) / pprime +
96 rhobar * psurfref - rhobar * (psurf * pprimeref) / pprime;
111 if(pharef < 0.0 || pharef >= 180.0) {
112 std::string msg =
"Invalid value of normalization pharef [" +
117 p_normPharef = pharef;
130 if(incref < 0.0 || incref >= 90.0) {
131 std::string msg =
"Invalid value of normalization incref [" +
136 p_normIncref = incref;
149 if(emaref < 0.0 || emaref >= 90.0) {
150 std::string msg =
"Invalid value of normalization emaref [" +
155 p_normEmaref = emaref;
167 p_normAlbedo = albedo;
176 p_normThresh = thresh;
void SetNormAlbedo(const double albedo)
Set the normalization function parameter.
double CalcSurfAlbedo(double pha, double inc, double ema)
Calculate the surface brightness using photometric angle information.
double PhtTopder(double phase, double incidence, double emission)
Obtain topographic derivative of an arbitrary photometric function.
#define _FILEINFO_
Macro for the filename and line number.
void SetNormThresh(const double thresh)
Set the normalization function parameter.
A type of error that could only have occurred due to a mistake on the user's part (e...
A type of error that cannot be classified as any of the other error types.
void SetNormEmaref(const double emaref)
Set the normalization function parameter.
Topographic derivative of an arbitrary photometric function.
Container for cube-like labels.
void SetNormPharef(const double pharef)
Set the normalization function parameter.
void SetNormIncref(const double incref)
Set the normalization function parameter.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
virtual void SetStandardConditions(bool standard)
Sets whether standard conditions will be used.