6 #define MIN(x,y) (((x) < (y)) ? (x) : (y)) 7 #define MAX(x,y) (((x) > (y)) ? (x) : (y)) 10 MoonAlbedo::MoonAlbedo(Pvl &pvl, PhotoModel &pmodel) :
11 NormModel(pvl, pmodel) {
12 PvlGroup &algo = pvl.findObject(
"NormalizationModel")
20 SetNormWl(p_normWavelength);
27 if(algo.hasKeyword(
"D")) {
31 if(algo.hasKeyword(
"Wl")) {
32 SetNormWl(algo[
"Wl"]);
35 if(algo.hasKeyword(
"E")) {
40 p_normE = -0.3575 * p_normWl - 0.0607;
47 if(algo.hasKeyword(
"F")) {
51 if(algo.hasKeyword(
"G2")) {
52 SetNormG2(algo[
"G2"]);
56 p_normG2 = -0.9585 * p_normWl + 0.98;
63 if(algo.hasKeyword(
"Xmul")) {
64 SetNormXmul(algo[
"Xmul"]);
67 if(algo.hasKeyword(
"H")) {
71 if(algo.hasKeyword(
"Bsh1")) {
72 SetNormBsh1(algo[
"Bsh1"]);
75 p_normBsh1 = 19.89 - 59.58 * p_normWl + 59.86 * pow(p_normWl, 2) -
76 20.09 * pow(p_normWl, 3);
77 if(p_normBsh1 < 0.0) {
82 if(algo.hasKeyword(
"Xb1")) {
83 SetNormXb1(algo[
"Xb1"]);
86 if(algo.hasKeyword(
"Xb2")) {
87 SetNormXb2(algo[
"Xb2"]);
92 p_normF1 = 1.0 - p_normF;
93 double g1 = p_normD * 0.1 + p_normE;
94 double g1sq = g1 * g1;
95 p_normG2sq = p_normG2 * p_normG2;
96 double c30 = cos(30.0 *
Isis::PI / 180.0);
97 if(1.0 + g1sq + 2.0 * g1 *c30 <= 0.0) {
98 std::string msg =
"Error while initializing Buratti function";
101 double pg130 = p_normF1 * (1.0 - g1sq) / (pow((1.0 + g1sq + 2.0 * g1 * c30), 1.5));
102 if(1.0 + p_normG2sq + 2.0 * p_normG2 *c30 <= 0.0) {
103 std::string msg =
"Error while initializing Buratti function";
106 double pg230 = p_normF * (1.0 - p_normG2sq) / (pow((1.0 + p_normG2sq + 2.0 * p_normG2 * c30), 1.5));
107 if(p_normBsh1 < 0.0) p_normBsh1 = 0.0;
108 if(1.0 + tan(15.0 *
Isis::PI / 180.0) / p_normH == 0.0) {
109 std::string msg =
"Error while initializing Buratti function";
112 double bshad30 = 1.0 + p_normBsh1 / (1.0 + tan(15.0 *
Isis::PI / 180.0) / p_normH);
113 p_normPg30 = (pg130 + pg230) * bshad30;
114 p_normBc1 = p_normXb1 + p_normXb2 * p_normWl;
115 p_normFbc3 = 1.0 + p_normBc1 * 2.0;
116 if(p_normFbc3 == 0.0) {
117 std::string msg =
"Error while initializing Buratti function";
120 p_normC3 = cos(2.0 *
Isis::PI / 180.0);
121 if(1.0 + p_normG2sq + 2.0 * p_normG2 *p_normC3 <= 0.0) {
122 std::string msg =
"Error while initializing Buratti function";
125 p_normPg32 = p_normF * (1.0 - p_normG2sq) / (pow((1.0 + p_normG2sq + 2.0 * p_normG2 * p_normC3), 1.5));
126 if(1.0 + tan(
Isis::PI / 180.0) / p_normH == 0.0) {
127 std::string msg =
"Error while initializing Buratti function";
130 p_normBshad3 = 1.0 + p_normBsh1 / (1.0 + tan(
Isis::PI / 180.0) / p_normH);
133 void MoonAlbedo::NormModelAlgorithm(
double phase,
double incidence,
double emission,
134 double demincidence,
double dememission,
double dn,
135 double &albedo,
double &mult,
double &base) {
149 a = GetPhotoModel()->
CalcSurfAlbedo(phase, demincidence, dememission);
152 cosa = cos(phase *
Isis::PI / 180.0);
153 if(1.0 + p_normG2sq + 2.0 * p_normG2 *cosa <= 0.0) {
157 pg2 = p_normF * (1.0 - p_normG2sq) / (pow((1.0 + p_normG2sq + 2.0 * p_normG2 * cosa), 1.5));
158 if(1.0 + tan(phase * .5 *
Isis::PI / 180.0) / p_normH == 0.0) {
162 bshad = 1.0 + p_normBsh1 / (1.0 + tan(phase * .5 *
Isis::PI / 180.0) / p_normH);
166 for(
int i = 0; i < 6; i++) {
167 g1 = p_normD * albedo + p_normE;
169 if(1.0 + g1sq + 2.0 * g1 *cosa <= 0.0) {
173 pg1 = p_normF1 * (1.0 - g1sq) / (pow((1.0 + g1sq + 2.0 * g1 * cosa), 1.5));
174 pg = (pg1 + pg2) * bshad;
176 fbc = 1.0 + p_normBc1 * phase;
177 if(1.0 + g1sq + 2.0 * g1 *p_normC3 <= 0.0) {
181 pg31 = p_normF1 * (1.0 - g1sq) / (pow((1.0 + g1sq + 2.0 * g1 * p_normC3), 1.5));
182 pg3 = (pg31 + p_normPg32) * p_normBshad3;
183 pg = fbc * (pg3 / p_normFbc3);
189 albedo = r * a * p_normPg30 / pg;
274 std::string msg =
"Invalid value of normalization h [" +
291 std::string msg =
"Invalid value of normalization bsh1 [" +
void SetNormWl(const double wl)
Set the albedo dependent phase function normalization parameter.
double CalcSurfAlbedo(double pha, double inc, double ema)
Calculate the surface brightness using photometric angle information.
void SetNormXmul(const double xmul)
Set the albedo dependent phase function normalization parameter.
void SetNormD(const double d)
Set parameters needed for albedo dependent phase function normalization for the Moon.
const double PI
The mathematical constant PI.
void SetNormXb1(const double xb1)
Set the albedo dependent phase function normalization parameter.
void SetNormBsh1(const double bsh1)
Set the albedo dependent phase function normalization parameter.
#define _FILEINFO_
Macro for the filename and line number.
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 SetNormF(const double f)
Set the albedo dependent phase function normalization parameter.
Container for cube-like labels.
void SetNormG2(const double g2)
Set the albedo dependent phase function normalization parameter.
void SetNormE(const double e)
Set the albedo dependent phase function normalization parameter.
void SetNormXb2(const double xb2)
Set the albedo dependent phase function normalization parameter.
void SetNormH(const double h)
Set the albedo dependent phase function normalization parameter.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
Albedo dependent phase function normalization for the Moon.