VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sigsimPhong.h
Go to the documentation of this file.
1 
2 /* 1998 JRM Technologies, Inc.*/
3 
4 
5 
6 
7 /***********************************
8 Copyright JRM Enterprises, Inc. 1998
9 All rights reserved.
10 
11 This code is the intellectual property of JRM Enterprises, Inc.
12 It may not be used or released as source or compiled binary form
13 without the prior written consent of JRM Enterprises, Inc.
14 ***********************************/
15 
16 #ifndef _SIGSIMPHONG_H_
17 #define _SIGSIMPHONG_H_
18 
19 #include "JRMlibrary.h"
20 #include "SigSimDefines.h"
21 #include "sigsim.h"
22 #include "sigsimDLLstub.h"
23 
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 
31 
32  /* ============================ EOIR-BAND ROUTINES ==================================== */
33 
34  // FillPhongParms() checks to see if Phong parameters (params[8-11]) have been set already (contain >0 values). If any are not, sets them using JRM SigSim BRDF values (params[1-3]).
35  // FillPhongParms is optional if the material table already has canonical Phong model parameter arrays set, and required otherwise. It translates DHR, %spec, etc. to Phong A,D,S,Shine.
36  // FillPhongParms() inputs a nmatls-element MATL_PROP_TABLE array which is assumed to contain valid spectral BRDF parameters in the SigSim Modified Phong Model format.
37  // It then converts these parameters (for each wavelength) into canonical Phong Model format (ambient, diffuse, specular, shininess) and writes them back to the mp_table.
38  // Also band-averages DHR to determine AND OVERWRITE material solar absorptivity and Lambertian emissivity on disk, if necessary.
39  // Inputs: sigsim_data_dir = string giving path to the main data directory.
40  // nmatls = number of entries in mp_table array.
41  // mp_table = array of MATL_PROP_TABLEs for which Phong parameters, absorptivities, and Lambertian emissivities should be calculated.
42  // Outputs: Modified material files if discrepancies in solar absorptivity or Lambertian emissivity are found.
43  // Returns: SIGSIM_MEMORY_ALLOCATION_ERROR if internal wavelength and DHR arrays cannot be allocated.
44  // SIGSIM_FILE_NOT_FOUND if a material file cannot be rewritten.
45  // SIGSIM_SUCCESS upon successful completion.
46  SIGSIM_API int FillPhongParms(char *sigsim_data_dir, long nmatls, MATL_PROP_TABLE *mp_table);
48 
49 
51  // Ltotal() calculates Reflected Radiance into View direction based on an illuminating Radiance of the form
52  // L_in = Edif/PI + Edir * delta-function(Vdir) = Ldif + Ldir. That is, a flux density Edif assumed purely isotropic plus
53  // a flux density Edir assumed purely directional in a Cartesian sense (plane wave) in direction -Vdir.
54  // The relevant inputs for specifying the incoming flux are then Edif, Edir, and the source VECTOR Vdir.
55  // Now, for a given ARBITRARY incoming direction, the differential amount of flux density (per solid angle)
56  // which hits a unit area dA on the surface (whose normal is the VECTOR Norm, also an input) and which is
57  // reflected into a solid angle at VECTOR View is dOmega cos(theta) L_in * Rho(Omega, View), which then
58  // must be integrated over all possible incoming angles dOmega, where Rho is the BRDF, specified by the following
59  // inputs: DHR, pct_spec (w.r.t DHR), width of specular lobe, and the ref_angle at which Rho was measured.
60  // The result of the integration (and this subroutine) is thus the radiance Ltotal into the View direction,
61  // that is, the flux density per unit solid angle into a solid angle at View. If one further assumes that the
62  // light within this cone is emitted as a plane wave, i.e. purely directionally (or will be assumed so by the
63  // sensor), then one can take the output of this subroutine as a flux density Etotal * delta-function(View).
64  // Note that incoming and outgoing flux densities are with respect to areas normal to the direction of propagation,
65  // as is the convention.
66  //
67  // The BRDF we assume here is of the following form:
68  // Rho = Kdif/PI + Kspec*max[cos(PHI),0]^Shine/cos(theta_i),
69  // where Kdif and Kspec are constants, theta_i is the incoming angle w.r.t Norm, and PHI is the angle between
70  // the viewing direction View and the Mirror angle (the angle of outgoing light assuming pure specular reflection).
71  // This BRDF is consistent with (but not provably following uniquely from) the Phong Model, as it leads to the
72  // Phong result Ltotal = Ldif Kamb + Ldir ( Kdif*max[cos(theta_i),0] + Kspec*max[cos(PHI),0]^Shine ), where Shine
73  // is the specular lobe parameter given by 128*( 1 - lobe_width/(2PI) ). Kamb gives the fractional contribution
74  // from the incoming diffuse light.
75  //double Ltotal(VECTOR View, VECTOR Norm, double Ldir, VECTOR Vdir, double Ldif, double DHR, double ref_angle, double pct_spec, double lobe);
76  //double Ltotal2(VECTOR View, VECTOR Norm, double Ldir, VECTOR Vdir, double Ldif, double Kamb, double Kdif, double Kspec, double Shine);
77 
78 
79  double specint_mc(double theta_r, double shine, int m);
80 
81 
82  // Converts SigSim BRDF params (DHR, theta_fix, pct_spec, lobedeg) to Phong params (Kamb, Kdif, Kspec, Shine).
83  // FIXEDANGLE : If TRUE, uses original Phong prescription (builds lobeintegral into Kspec, limits Shine<128). Otherwise uses new prescription which evaluates lobeint and K's at runtime.
84  // DHR [unitless] : hemispherical reflectivity
85  // thetafix_deg [deg]: angle at which DHR was measured
86  // pct_spec [%] : Percent Specularity
87  // lobedeg [deg]: Lobe width
88  // b [unitless] : For angle-dependent (hemispherical) output, set b=0. Otherwise Phong params will be angle-independent.
89  // Kamb [unitless] : ambient reflectivity
90  // Kdif [unitless] : diffuse reflectivity
91  // Kspec [unitless]: specular reflectivity
92  // Shine [unitless]: specular lobe exponent
93  SIGSIM_API int SigSimBRDF2Phong(jrmbool FIXEDANGLE, double DHR, double thetafix_deg, double b, double pct_spec, double lobedeg, double* Shine, double* Kamb, double* Kdif, double *Kspec);
94 
95 
96  // Converts Sandford Robertson BRDF params (b, width, difref, hemiemit, xmit) to SigSim BRDF params (DHR, pct_spec, lobedeg), given theta_fix angle at which DHR is to be quoted.
97  // b = Grazing-angle parameter [unitless]
98  // w = Lobe width parameter [unitless]
99  // pd = diffuse reflectivity [unitless]
100  // e = emissivity [unitless]
101  // t = transmissivity [unitless]
102  SIGSIM_API int SR2SigSimBRDF(double theta_fix, double difref, double hemiemit, double xmit, double b, double width, double *pct_spec, double *lobe, double *DHR);
103 
104 
105 
106  SIGSIM_API double ShinyFromLobeWidth(jrmbool FIXEDANGLE, double lobe); // [deg] to [unitless]
107  SIGSIM_API double LobeWidthFromShiny(jrmbool FIXEDANGLE, double shiny); // [unitless] to [deg]
108  SIGSIM_API double Total2HemisphericalReflectivity(double param, double b, double thetarad, jrmbool USEOMG);
109  SIGSIM_API double Hemispherical2TotalReflectivity(double param, double b, double thetarad, jrmbool USEOMG);
110 
111 
112  // SSReflection : Performs SigSim Phong reflection integral.
113  // DHR [unitless] = Directional Hemispherical Reflectivity (angle-dependent)
114  // thetafix_deg [deg] = zenith angle at which DHR measured
115  // pct_spec [%] = percent specular
116  // lobe [deg] = width [0-180] of specular lobe.
117  // b = SR grazing angle parameter (OK if unknown : set = 0)
118  // reflect_dir = vector from surface toward viewing direction
119  // surfnorm = surface normal direction
120  // direct_dir = vector from surface toward direct light incident direction
121  // LDirect = direct light true radiance
122  // dOmegaDirect [sr] = direct light apparent solid angle
123  // ambsym_dir = vector from surface toward axis of symmetry of ambient light contribution
124  // Lambient = ambient light true radiance
125  // Output = true radiance seen by observer
126  SIGSIM_API double SSReflection( VECTOR reflect_dir, VECTOR surfnorm,
127  VECTOR direct_dir, double LDirect, double dOmegaDirect,
128  VECTOR ambsym_dir, double LAmbient,
129  double b, double DHR, double thetafix_deg, double pct_spec, double lobedeg);
130 
131 
132  // PhongReflection : Performs Phong Reflection equation. Energy conserving.
133  // Phong input params assumed angle-independent (total) unless b=0.
134  // ka = ambient reflectivity
135  // kd = diffuse reflectivity
136  // ks = specular reflectivity
137  // n = shininess exponent
138  // reflect_dir = vector from surface toward viewing direction
139  // surfnorm = surface normal direction
140  // direct_dir = vector from surface toward direct light incident direction
141  // LDirect = direct light true radiance
142  // dOmegaDirect [sr] = direct light apparent solid angle
143  // ambsym_dir = vector from surface toward axis of symmetry of ambient light contribution
144  // Lambient = ambient light true radiance
145  // Output = true radiance seen by observer
146  SIGSIM_API double PhongReflection(VECTOR reflect_dir, VECTOR surfnorm,
147  VECTOR direct_dir, double LDirect, double dOmegaDirect,
148  VECTOR ambsym_dir, double LAmbient,
149  double b, double ka, double kd, double ks, double n);
150 
151  // OriginalPhongReflection : Performs Original Phong Reflection equation. (Not energy conserving except trivially at angleDHR).
152  // Phong input params assumed angle-dependent at mp_table->angleDHR.
153  // kA = ambient reflectivity
154  // kD = diffuse reflectivity
155  // kS = specular reflectivity
156  // N = shininess exponent
157  // reflect_dir = vector from surface toward viewing direction
158  // surfnorm = surface normal direction
159  // direct_dir = vector from surface toward direct light incident direction
160  // LDirect = direct light true radiance
161  // dOmegaDirect [sr] = direct light apparent solid angle
162  // ambsym_dir = vector from surface toward axis of symmetry of ambient light contribution
163  // Lambient = ambient light true radiance
164  // Output = true radiance seen by observer
165  SIGSIM_API double OriginalPhongReflection(VECTOR reflect_dir, VECTOR surfnorm,
166  VECTOR direct_dir, double LDirect, double dOmegaDirect,
167  VECTOR ambsym_dir, double LAmbient,
168  double kA, double kD, double kS, double N);
169 
170 
171  // SRg(theta ,b)
172  //
173  // description: g(theta,b) function for Sandford Robertson BRDF. GPU capable
174  //
175  // params: theta = angle [rad]
176  // b - Geometric parameter governing reflectance at grazing angles
177  //
178  // returns: result of function
179  //
180  SIGSIM_API double SRg(double theta, double b);
181 
182 
183  // SRG(b)
184  //
185  // description: G(b) function for Sandford Robertson BRDF.
186  //
187  // param: b - Geometric parameter governing reflectance at grazing angles
188  //
189  // returns: result of function
190  //
191  SIGSIM_API double SRG(double b);
192 
193 
194  // SRh(alpha, width)
195  //
196  // description: Rh(alpha, width) function for Sandford Robertson BRDF.
197  //
198  // params: alpha - glint angle defined by acos(dot_product(g,n)), where n is the surface normal and g is the normalized version of
199  // (i+o)/sqrt(2*(1-dot_product(i,o))), where i is the vector to source (incident) and o is vector to eye (reflected).
200  // width - Geometric parameter governing the width of the specular lobe
201  //
202  // returns: result of function
203  //
204  SIGSIM_API double SRh(double alpha, double width);
205 
206 
207  // SRH(theta, width)
208  //
209  // description: H(theta, width) function for Sandford Robertson BRDF. GPU capable
210  //
211  // params: theta - angle [rad]
212  // width - Geometric parameter governing the width of the specular lobe
213  //
214  SIGSIM_API double SRH(double theta, double width);
215 
217  // SRDHR(theta, b, hemiemit, xmit) [unitless]
218  //
219  // description: DHR(theta, b, hemiemit, xmit) function for Sandford Robertson BRDF. GPU capable
220  //
221  // params: theta - angle [rad]
222  // b - Geometric parameter governing reflectance at grazing angles
223  // hemiemit - Total angle-independent emittance
224  // xmit - Total angle-independent transmittance
225  //
226  //
227  // returns: Angle-dependent hemispheric DHR (or HDR) reflectance seen at angle theta.
228  //
229  SIGSIM_API double SRDHR(double theta, double b, double hemiemit, double xmit);
230 
232  // SREmis(theta, b, DHR, xmit) [unitless]
233  //
234  // description: hemiemit(theta, b, DHR, xmit) inverse function for Sandford Robertson BRDF. GPU capable
235  //
236  // params: theta - angle at which DHR measured [rad]
237  // b - Geometric parameter governing reflectance at grazing angles
238  // DHR - Hemispheric angle-dependent reflectance
239  // xmit - Total angle-independent transmittance
240  //
241  // returns: Total angle-independent emittance
242  //
243  SIGSIM_API double SREmis(double theta, double b, double DHR, double xmit);
244 
246  // SRDifRef(theta, b, DHR, pctspec) [unitless]
247  //
248  // description: difref(theta, b, DHR, pctspec) inverse function for Sandford Robertson BRDF. GPU capable
249  //
250  // params: theta - angle at which DHR measured [rad]
251  // b - Geometric parameter governing reflectance at grazing angles
252  // DHR - Hemispheric angle-dependent reflectance
253  // pctspec - percent specularity
254  //
255  // returns: Total angle-independent diffuse reflectance
256  //
257  SIGSIM_API double SRDifRef(double theta, double b, double DHR, double pctspec);
258 
260  // SRXmit(theta, b, DHR, hemiemit) [unitless]
261  //
262  // description: xmit(theta, b, DHR, hemiemit) inverse function for Sandford Robertson BRDF. GPU capable
263  //
264  // params: theta - angle at which DHR measured [rad]
265  // b - Geometric parameter governing reflectance at grazing angles
266  // DHR - Hemispheric angle-dependent reflectance
267  // hemiemit - Total angle-independent emittance
268  //
269  //
270  // returns: Total angle-independent transmittance
271  //
272  SIGSIM_API double SRXmit(double theta, double b, double DHR, double hemiemit);
273 
275  // SRPctSpec(theta, b, hemiemit, difref) [%]
276  //
277  // description: %specular(theta, b, hemiemit, difref, xmit) function for Sandford Robertson BRDF. GPU capable
278  //
279  // params: theta - angle [rad]
280  // b - Geometric parameter governing reflectance at grazing angles
281  // hemiemit - Total angle-independent emittance
282  // difref = Total angle-independent diffuse reflectance
283  // xmit = Total angle-independent transmittance
284  //
285  // returns: Percent specularity [%]
286  //
287  SIGSIM_API double SRPctSpec(double theta, double b, double hemiemit, double difref, double xmit);
288 
290  // SRShiny(width) [unitless]
291  //
292  // description: shininess(width) function for Sandford Robertson BRDF. GPU capable
293  //
294  // params: width - Geometric parameter governing the width of the specular lobe
295  //
296  SIGSIM_API double SRShiny(double width);
297 
299  // SRWidth(shiny) [unitless]
300  //
301  // description: Converts Phong Shininess to Sandford Robertson width.
302  //
303  // params: shiny - Phong parameter governing the width of the specular lobe
304  //
305  double SRWidth(double shiny);
306 
307  // SRReflection: Performs SR Reflection equation.
308  // SR input params assumed angle-independent (total).
309  // b = Grazing-angle parameter
310  // w = Lobe width parameter
311  // pd = diffuse reflectivity
312  // e = emissivity
313  // t = transmissivity
314  // reflect_dir = vector from surface toward viewing direction
315  // surfnorm = surface normal direction
316  // direct_dir = vector from surface toward direct light incident direction
317  // LDirect = direct light true radiance
318  // dOmegaDirect [sr] = direct light apparent solid angle
319  // ambsym_dir = vector from surface toward axis of symmetry of ambient light contribution
320  // Lambient = ambient light true radiance
321  // Output = true radiance seen by observer
322  SIGSIM_API double SRReflection( VECTOR reflect_dir, VECTOR surfnorm,
323  VECTOR direct_dir, double LDirect, double dOmegaDirect,
324  VECTOR ambsym_dir, double LAmbient,
325  double b, double w, double pd, double e, double t);
326 
328  // SRWidth2BeckmannWidth [unitless]
329  //
330  // description: Converts SR lobe width (w) to Beckmann width (m)
331  //
332  // params: w : parameter governing the width of the specular lobe
333  // params: costheta : cosine of angle of measurement (expected: costheta > LOLIM)
334  //
335  SIGSIM_API double SRWidth2BeckmannWidth(double w, double costheta);
336 
337 
338  // BKh(alpha, width)
339  //
340  // description: Rh(alpha, width) function for Beckmann BRDF.
341  //
342  // params: alpha - glint angle defined by acos(dot_product(g,n)), where n is the surface normal and g is the normalized version of
343  // (i+o)/sqrt(2*(1-dot_product(i,o))), where i is the vector to source (incident) and o is vector to eye (reflected).
344  // width - Geometric parameter governing the width of the specular lobe
345  //
346  // returns: result of function
347  //
348  SIGSIM_API double BKh(double alpha, double width);
349 
350 
351  // BKH(theta, width)
352  //
353  // description: H(theta) function for Beckmann BRDF. GPU capable
354  //
355  // params: theta - angle [rad]
356  //
357  SIGSIM_API double BKH(double theta);
358 
359 
360  // BKReflection : Performs Beckmann Reflection equation.
361  // BK input params assumed angle-independent (total).
362  // b = Grazing-angle parameter
363  // m = Lobe width parameter
364  // pd = diffuse reflectivity
365  // e = emissivity
366  // t = transmissivity
367  // reflect_dir = vector from surface toward viewing direction
368  // surfnorm = surface normal direction
369  // direct_dir = vector from surface toward direct light incident direction
370  // LDirect = direct light true radiance
371  // dOmegaDirect [sr] = direct light apparent solid angle
372  // ambsym_dir = vector from surface toward axis of symmetry of ambient light contribution
373  // Lambient = ambient light true radiance
374  // Output = true radiance seen by observer
375  SIGSIM_API double BKReflection ( VECTOR reflect_dir, VECTOR surfnorm,
376  VECTOR direct_dir, double LDirect, double dOmegaDirect,
377  VECTOR ambsym_dir, double LAmbient,
378  double b, double m, double pd, double e, double t);
379 
380 
381  // ReadSpectrumFromMATL_PROP_TABLE Reads a spectrum from mp_table (only records with specified reflecttype and polarization) into {spectrum, yout).
382  // Allocates spectrum and yout. BE SURE TO USE Free_SPECTRAL_DOMAIN_Arrays and Free_Double_Array to free this memory!
383  SIGSIM_API int ReadSpectrumFromMATL_PROP_TABLE(MATL_PROP_TABLE *mp_table, int param, enum ReflectType reflecttype, enum Polarization polarization, SPECTRAL_DOMAIN *spectrum, double **yout);
384 
385  // WARNING : Fill_MATL_PROP_TABLE_IOSpectrum deletes the current IO spectrum from the mp_table, and replaces it with an unpolarized spectrum given by {lambda,DHR,pctspec,lobewidth}.
386  // nspecrecs is the number of elements in these input arrays (assumed the same)
387  // The Sandford Robertson and Standard Phong parameters are set to -1, so it is recommended that one run FillPhongParams() after this routine.
388  SIGSIM_API int Fill_MATL_PROP_TABLE_IOSpectrum(MATL_PROP_TABLE *mp_table, double *lambda, double *DHR, double *pctspec, double *lobewidth, long nspecrecs);
389 
390  // ------------------- DUAL-FACTOR INTENSITY MODULATION CODE (CF2006) ---------------------------------------------- //
391 
392  // FindSDASystem calculates the coordinate system defined by the RGB directions of incident specular and diffuse pseuoradiances {Ls, Ld}.
393  // See "Dual-factor Intensity Modulation" JRM whitepaper (Chris Fink 061008).
394  //
395  // --- Inputs ---
396  // Ls = Specular at-surface incident pseudoradiance [units immaterial] in 3 bands (usually RGB)
397  // Ld = Diffuse (=ambient) at-surface incident pseudoradiance [units immaterial but same as Ls] in 3 bands (usually RGB)
398  // costheta = [unitless] cosine of angle between surface normal and direction to specular incident pseudoradiance
399  // shadow = [unitless] fraction of specular incident pseudoradiance that is unshadowed. Note 0=fully shadowed, 1=unshadowed.
400  // --- Outputs ---
401  // (*shat) = Direction of Ls. ( = X-direction)
402  // (*dhat) = Direction of projection of Ld perpendicular to Ls ( = Y-direction)
403  // (*ahat) = Direction out-of-plane of {Ls, Ld} ( = Z-direction)
404  // (*dmag) = magnitude of projection of Ld perpendicular to Ls
405  // (*M) = rotation matrix defined by transpose of {shat, dhat, ahat}. Converts RGB-system vectors to SDA-system representation.
406  SIGSIM_API void FindSDASystem(VECTOR Ls, VECTOR Ld, double costheta, double shadow, VECTOR *shat, VECTOR *dhat, VECTOR *ahat, double *dmag, rotmatrix *M);
407 
408  // IntensityModulation calculates three parameters related to the difference in at-surface response between a pixel RGB value and its approximated Phong-model material prediction.
409  // See "Dual-factor Intensity Modulation" JRM whitepaper (Chris Fink 061008).
410  // NOTE : Requires output of FindSDASystem as input.
411  //
412  // --- Inputs ---
413  // Ls = Specular at-surface incident pseudoradiance [units immaterial] in 3 bands (usually RGB)
414  // Ld = Diffuse (=ambient) at-surface incident pseudoradiance [units immaterial but same as Ls] in 3 bands (usually RGB)
415  // costheta = [unitless] cosine of angle between surface normal and direction to specular incident pseudoradiance
416  // shadow = [unitless] fraction of specular incident pseudoradiance that is unshadowed. Note 0=fully shadowed, 1=unshadowed.
417  // DHR = [unitless] material DHR value in 3 bands (usually RGB bands).
418  // Predict = Predicted at-surface reflected material radiance [units same as Ls and Ld] in 3 bands (usually RGB)
419  // Pixel = At-surface reflected material radiance from image pixel [units same as Ls and Ld] in 3 bands (usually RGB)
420  // shat = Direction of Ls. ( = X-direction)
421  // dhat = Direction of projection of Ld perpendicular to Ls ( = Y-direction)
422  // ahat = Direction out-of-plane of {Ls, Ld} ( = Z-direction)
423  // dmag = magnitude of projection of Ld perpendicular to Ls
424  // M = rotation matrix defined by transpose of {shat, dhat, ahat}. Converts RGB-system vectors to SDA-system representation.
425  // --- Outputs ---
426  // (*drsin) = [unitless] |dr| sin(theta_delta) = magnitude of DHR reflectance difference in plane of Ls and Ld
427  // (*phi) = [radians] angle of DHR reflectance difference in {Ls, Ld} plane measured from Ls.
428  // (*dshadow) = [unitless] Difference in shadowing fraction between pixel and prediction.
429  SIGSIM_API int IntensityModulation(VECTOR Ls, VECTOR Ld, double costheta, double shadow, VECTOR shat, VECTOR dhat, VECTOR ahat, double dmag, rotmatrix M, VECTOR DHR, VECTOR Predict, VECTOR Pixel, double *drsin, double *phi, double *dshadow);
430 
431  // IntensityModulationPixelResponse calculates the approximate Phong-model pixel response in the dual-factor intensity modulation algorithm.
432  // See "Dual-factor Intensity Modulation" JRM whitepaper (Chris Fink 061008).
433  // NOTE : Requires output of FindSDASystem and IntensityModulation as input.
434  //
435  // --- Inputs ---
436  // Ls = Specular at-surface incident pseudoradiance [units immaterial] in 3 bands (usually RGB)
437  // Ld = Diffuse (=ambient) at-surface incident pseudoradiance [units immaterial but same as Ls] in 3 bands (usually RGB)
438  // costheta = [unitless] cosine of angle between surface normal and direction to specular incident pseudoradiance
439  // shadow = [unitless] fraction of specular incident pseudoradiance that is unshadowed. Note 0=fully shadowed, 1=unshadowed.
440  // M = rotation matrix defined by transpose of {shat, dhat, ahat}. Converts RGB-system vectors to SDA-system representation.
441  // DHR = [unitless] material DHR value in 3 bands (usually RGB bands).
442  // drsin = [unitless] |dr| sin(theta_delta) = magnitude of DHR reflectance difference in plane of Ls and Ld
443  // phi = [radians] angle of DHR reflectance difference in {Ls, Ld} plane measured from Ls.
444  // dshadow = [unitless] Difference in shadowing fraction between pixel and prediction.
445  // --- Outputs ---
446  // (*PixelPredict) = Predicted at-surface reflected image pixel radiance [units same as Ls and Ld] in 3 bands (usually RGB)
447  SIGSIM_API int IntensityModulationPixelResponse(VECTOR Ls, VECTOR Ld, double costheta, double shadow, rotmatrix M, VECTOR DHR, double drsin, double phi, double dshadow, VECTOR *PixelPredict, double *Rtraceave);
448 
449 
450  /* ======================== RF-BAND ROUTINES ================================== */
451 
452  double Tsigma0(double Zenith, double P1, double P2, double P3, double P4, double P5, double P6);
453  double TSTDDev(double Zenith, double M1, double M2, double M3);
454 
455 
456  int BandAveragedArealRCS(MATL_PROP_TABLE mp_table, BAND band, double Zenith, enum Polarization PL, double *RCS, double *STD);
457  int BandAveragedUlabyParams(MATL_PROP_TABLE mp_table, BAND band, enum Polarization PL, double *P1, double *P2, double *P3, double *P4, double *P5, double *P6, double *M1, double *M2, double *M3);
458  int BAND_UlabyParams(MATL_PROP_TABLE mp_table, BAND band, enum Polarization PL, double *P1, double *P2, double *P3, double *P4, double *P5, double *P6, double *M1, double *M2, double *M3);
460 
461 
462  // BAND_TerrainRCS() provides Ulaby-Dobson terrain RCS returns for a given zenith angle and waveband:
463  // Inputs: band = desired waveband
464  // Zenith angle [rad]
465  // mp_table = relevant MATL_PROP_TABLE whose top layer contains spectral RCS data
466  // Uses : mp_table.{nspecrecs, reflectflag[i]=rf, polarflag[i]==PL, mp_table.lambda_um[i], param{1-9}[i]}.
467  // Outputs: *RCS = mean unpolarized terrain radar cross section (sigma_0) [dB] for the specified waveband and angle.
468  // *STD = standard deviation of the RCS value [dB] for the specified waveband and angle.
469  // Assumes: mp_table.lambda_um values are at beginning of bins, and are in increasing order for a given polarization.
470  // Returns: SIGSIM_DATA_NOT_FOUND if there exist no spectral records in mp_table for which (mp_table.reflectflag[i]==rf)&&(mp_table.polarflag[i]==PL)&&(lambda>mp_table.lambda_um[i]).
471  // SIGSIM_SUCCESS upon successful completion.
472  SIGSIM_API int BAND_TerrainRCS(MATL_PROP_TABLE mp_table, BAND band, double Zenith, enum Polarization PL, double *RCS, double *STD);
473  SIGSIM_API int test_BAND_TerrainRCS(MATL_PROP_TABLE mp_table, BAND band, double Zenith, enum Polarization PL, double *RCS, double *STD);
474 
475  // TerrainRCS() provides Ulaby-Dobson terrain RCS returns for a given zenith angle and wavelength:
476  // Inputs: lambda [um] = desired wavelength
477  // Zenith angle [rad]
478  // mp_table = relevant MATL_PROP_TABLE whose top layer contains spectral RCS data
479  // Uses : mp_table.{nspecrecs, reflectflag[i]=rf, polarflag[i]==PL, mp_table.lambda_um[i], param{1-9}[i]}.
480  // Outputs: *RCS = mean unpolarized terrain radar cross section (sigma_0) [dB] for the specified wavelength and angle.
481  // *STD = standard deviation of the RCS value [dB] for the specified wavelength and angle.
482  // Assumes: mp_table.lambda_um values are at beginning of bins, and are in increasing order for a given polarization.
483  // Returns: SIGSIM_DATA_NOT_FOUND if there exist no spectral records in mp_table for which (mp_table.reflectflag[i]==rf)&&(mp_table.polarflag[i]==PL)&&(lambda>mp_table.lambda_um[i]).
484  // SIGSIM_SUCCESS upon successful completion.
485  SIGSIM_API int TerrainRCS(MATL_PROP_TABLE mp_table, double lambda, double Zenith, enum Polarization PL, double *RCS, double *STD);
486 
487  // TerrainRCS_Polynomial() provides Ulaby-Dobson terrain RCS parameters for a given wavelength:
488  // Inputs: lambda [um] = desired wavelength
489  // mp_table = relevant MATL_PROP_TABLE whose top layer contains spectral RCS data
490  // PL = polarization state (use "un" for average of all polarization states).
491  // Uses : mp_table.{nspecrecs, reflectflag[i]=rf, polarflag[i]==PL, mp_table.lambda_um[i], param{1-9}[i]}.
492  // Outputs: Coefficients of polynomial RCS = RCS0 + RCS1 * sin(Zenith) + RCS2 * sin^2(Zenith) + RCS3 * sin^3(Zenith)
493  // Coefficients of polynomial STD = STD0 + STD1 * sin(Zenith) + STD2 * sin^2(Zenith)
494  // Assumes: mp_table.lambda_um values are at beginning of bins, and are in increasing order for a given polarization.
495  // Returns: SIGSIM_DATA_NOT_FOUND if there exist no spectral records in mp_table for which (mp_table.reflectflag[i]==rf)&&(mp_table.polarflag[i]==PL)&&(lambda>mp_table.lambda_um[i]).
496  // SIGSIM_SUCCESS upon successful completion.
497  SIGSIM_API int TerrainRCS_Polynomial(MATL_PROP_TABLE mp_table, double lambda, enum Polarization PL, double *RCS0, double *RCS1, double *RCS2, double *RCS3, double *STD0, double *STD1, double *STD2);
498 
499  int BAND_TerrainRCS_Polynomial(MATL_PROP_TABLE mp_table, BAND band, enum Polarization PL, double *RCS0, double *RCS1, double *RCS2, double *RCS3, double *STD0, double *STD1, double *STD2);
500 
501 
502 
503 #ifdef __cplusplus
504 }
505 #endif
506 
507 #endif // _SIGSIMPHONG_H_
508 


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)