Iwave.cpp 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985
  1. extern "C" {
  2. #include <grass/gis.h>
  3. #include <grass/glocale.h>
  4. }
  5. #include "common.h"
  6. #include "Iwave.h"
  7. #ifdef WIN32
  8. #pragma warning(disable:4305) /* disable warning about initialization of a float by a double */
  9. #endif
  10. /* Adding new band filters (see also Iwave.h):
  11. *
  12. * Note: the spectral range ranges 250 to 4000 nm (see Iwave.h) which is
  13. * 4000-250=3750nm, and (4000-250)/1500=2.5. Hence, the resulting step
  14. * size is 2.5 nm in the ffu.s array.
  15. *
  16. * o bands are defined by their discrete filter function
  17. * o to compute a band position in the 1500 slots of ffu.s array, start
  18. * with 250nm using 2.5nm increments. The result is the starting index
  19. * for the spectral band.
  20. * o 1500 is the number of wavelength spectral description slots.
  21. * - a 'for' loop fills up the slots with 0
  22. * - then the ffu.s array is filled with each of the spectral bands data one after the other.
  23. * Example Lsat TM: (435-250) / 2.5 = 74
  24. * o add iwave value, also in Iwave.h
  25. * o add to GeomCond.cpp and GeomCond.h
  26. */
  27. /*
  28. spectral band of meteosat
  29. */
  30. void IWave::meteo()
  31. {
  32. static const float sr[305] = {
  33. .00, .00, .00, .01, .01, .01, .02,
  34. .02, .02, .02, .02, .02, .03, .03,
  35. .04, .04, .04, .05, .05, .05, .06,
  36. .06, .07, .07, .07, .08, .08, .09,
  37. .09, .10, .10, .10, .11, .11, .12,
  38. .12, .12, .13, .14, .14, .15, .15,
  39. .16, .16, .17, .17, .18, .18, .19,
  40. .20, .20, .21, .21, .22, .23, .24,
  41. .24, .25, .26, .27, .28, .28, .29,
  42. .30, .30, .31, .32, .33, .34, .35,
  43. .35, .36, .37, .38, .39, .40, .40,
  44. .41, .42, .43, .44, .45, .46, .48,
  45. .49, .50, .51, .52, .53, .55, .56,
  46. .57, .58, .60, .61, .62, .63, .64,
  47. .65, .65, .66, .67, .67, .68, .69,
  48. .69, .70, .71, .71, .72, .73, .73,
  49. .74, .76, .77, .78, .78, .79, .80,
  50. .81, .82, .83, .84, .85, .86, .87,
  51. .88, .89, .89, .91, .92, .93, .94,
  52. .95, .96, .96, .97, .98, .98, .99,
  53. .99, .99, .99, 1.00, 1.00, 1.00, 1.00,
  54. 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, .99,
  55. .99, .99, .99, .98, .98, .98, .98,
  56. .98, .97, .97, .97, .97, .97, .97,
  57. .97, .96, .96, .96, .96, .96, .96,
  58. .96, .96, .96, .96, .95, .95, .95,
  59. .94, .93, .93, .92, .92, .91, .90,
  60. .89, .89, .88, .88, .87, .86, .86,
  61. .85, .85, .84, .84, .83, .82, .82,
  62. .81, .80, .80, .79, .79, .78, .77,
  63. .77, .76, .76, .75, .75, .74, .74,
  64. .74, .73, .73, .72, .71, .70, .68,
  65. .67, .65, .64, .63, .62, .61, .60,
  66. .59, .58, .57, .56, .55, .54, .53,
  67. .52, .51, .50, .49, .49, .48, .47,
  68. .46, .45, .43, .42, .41, .40, .39,
  69. .38, .37, .36, .35, .34, .33, .31,
  70. .30, .29, .28, .28, .27, .25, .24,
  71. .23, .22, .21, .20, .19, .18, .17,
  72. .16, .15, .14, .13, .12, .11, .11,
  73. .10, .09, .08, .08, .08, .07, .06,
  74. .06, .05, .05, .05, .04, .04, .03,
  75. .03, .02, .02, .01, .01, .01, .01,
  76. .01, .00, .00, .00 };
  77. ffu.wlinf=0.3499999f;
  78. ffu.wlsup=1.11f;
  79. int i;
  80. for(i = 0; i < 40; i++) ffu.s[0] = 0;
  81. for(i = 0; i < 305; i++) ffu.s[40+i] = sr[i];
  82. for(i = 345; i < 1501; i++) ffu.s[i] = 0;
  83. }
  84. void IWave::goes_east()
  85. {
  86. /* spectral band of goes east */
  87. static const float sr[165] = {
  88. .00, .00, .00, .01, .01, .03, .05,
  89. .09, .13, .22, .30, .38, .46, .52,
  90. .58, .63, .68, .70, .73, .75, .77,
  91. .79, .81, .82, .84, .85, .86, .87,
  92. .88, .89, .90, .91, .92, .93, .93,
  93. .94, .95, .96, .96, .97, .98, .99,
  94. .99, .99, .98, .98, .97, .97, .96,
  95. .95, .95, .94, .94, .93, .93, .92,
  96. .92, .91, .91, .91, .91, .91, .91,
  97. .91, .91, .91, .91, .90, .89, .88,
  98. .88, .86, .84, .83, .81, .79, .77,
  99. .75, .73, .71, .69, .69, .68, .67,
  100. .66, .65, .64, .63, .61, .60, .59,
  101. .57, .56, .54, .52, .50, .49, .47,
  102. .46, .44, .43, .41, .40, .38, .36,
  103. .35, .33, .32, .30, .29, .28, .27,
  104. .26, .25, .23, .22, .21, .20, .19,
  105. .18, .17, .16, .15, .14, .13, .12,
  106. .11, .10, .10, .09, .08, .08, .07,
  107. .06, .06, .05, .05, .04, .04, .03,
  108. .03, .03, .02, .02, .02, .02, .01,
  109. .01, .01, .01, .01, .00, .00, .00,
  110. .00, .00, .00, .00, .00, .00, .00,
  111. .00, .00, .00, .00 };
  112. ffu.wlinf = 0.49f;
  113. ffu.wlsup = 0.8999999f;
  114. int i = 0;
  115. for(i = 0; i < 96; i++) ffu.s[i] = 0;
  116. for(i = 0; i < 165; i++) ffu.s[96+i] = sr[i];
  117. for(i = 261; i < 1501; i++) ffu.s[i] = 0;
  118. }
  119. void IWave::goes_west()
  120. {
  121. /* spectral band of goes west */
  122. static const float sr[165] = {
  123. .00, .00, .00, .00, .00, .01, .02,
  124. .04, .06, .12, .18, .30, .41, .51,
  125. .61, .69, .77, .83, .89, .91, .93,
  126. .94, .96, .96, .97, .98, .99, .99,
  127. .99, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
  128. .99, .99, .99, .98, .98, .97, .97,
  129. .96, .96, .96, .95, .95, .95, .94,
  130. .94, .93, .92, .91, .90, .89, .88,
  131. .87, .86, .85, .84, .83, .82, .81,
  132. .80, .80, .79, .78, .77, .76, .75,
  133. .74, .73, .72, .70, .69, .67, .66,
  134. .64, .63, .61, .59, .58, .56, .55,
  135. .54, .52, .51, .50, .49, .48, .46,
  136. .45, .44, .43, .41, .40, .38, .37,
  137. .36, .34, .33, .32, .31, .29, .28,
  138. .27, .26, .24, .23, .22, .21, .20,
  139. .19, .18, .17, .17, .16, .15, .14,
  140. .14, .13, .12, .12, .11, .10, .09,
  141. .09, .08, .08, .07, .07, .07, .06,
  142. .06, .05, .05, .05, .04, .04, .03,
  143. .03, .03, .03, .02, .02, .02, .02,
  144. .02, .01, .01, .01, .01, .01, .01,
  145. .01, .00, .00, .00, .00, .00, .00,
  146. .00, .00, .00, .00 };
  147. ffu.wlinf = 0.49f;
  148. ffu.wlsup = 0.8999999f;
  149. int i = 0;
  150. for(i = 0; i < 96; i++) ffu.s[i] = 0;
  151. for(i = 0; i < 165; i++) ffu.s[96+i] = sr[i];
  152. for(i = 261; i < 1501; i++) ffu.s[i] = 0;
  153. }
  154. void IWave::avhrr(int iwa)
  155. {
  156. /* 1st spectral band of avhrr (noaa 6) */
  157. static const float sr1[80] = {
  158. .0000, .0178, .0355, .0533, .0710, .1655, .2600, .3545,
  159. .4490, .5215, .5940, .6665, .7390, .7575, .7760, .7945,
  160. .8130, .8113, .8095, .8078, .8060, .8201, .8343, .8484,
  161. .8625, .8766, .8908, .9049, .9190, .9291, .9393, .9494,
  162. .9595, .9696, .9798, .9899, 1.000, .9996, .9992, .9989,
  163. .9985, .9981, .9977, .9974, .9970, .9596, .9222, .8849,
  164. .8475, .8101, .7727, .7354, .6980, .6047, .5115, .4182,
  165. .3250, .2767, .2285, .1802, .1320, .1127, .0935, .0742,
  166. .0550, .0480, .0410, .0340, .0270, .0235, .0200, .0165,
  167. .0130, .0115, .0100, .0085, .0070, .0052, .0035, .0017
  168. };
  169. /* 2nd spectral band of avhrr (noaa 6) */
  170. static const float sr2[173] = {
  171. .0000, .0020, .0040, .0060, .0080, .0710, .1340, .1970,
  172. .2600, .3492, .4385, .5277, .6170, .6678, .7185, .7693,
  173. .8200, .8435, .8670, .8905, .9140, .9212, .9285, .9358,
  174. .9430, .9415, .9400, .9385, .9370, .9520, .9670, .9820,
  175. .9970, .9977, .9985, .9992, 1.000, .9813, .9625, .9438,
  176. .9250, .9148, .9045, .8943, .8840, .8751, .8663, .8574,
  177. .8485, .8396, .8307, .8219, .8130, .8100, .8070, .8040,
  178. .8010, .7980, .7950, .7920, .7890, .7878, .7865, .7853,
  179. .7840, .7828, .7815, .7803, .7790, .7751, .7713, .7674,
  180. .7635, .7596, .7558, .7519, .7480, .7464, .7448, .7431,
  181. .7415, .7399, .7383, .7366, .7350, .7225, .7100, .6975,
  182. .6850, .6783, .6715, .6648, .6580, .6515, .6450, .6385,
  183. .6320, .6270, .6220, .6170, .6120, .6093, .6065, .6038,
  184. .6010, .5993, .5975, .5958, .5940, .5910, .5880, .5850,
  185. .5820, .5720, .5620, .5520, .5420, .5243, .5065, .4887,
  186. .4710, .4402, .4095, .3787, .3480, .3155, .2830, .2505,
  187. .2180, .1935, .1690, .1445, .1200, .1055, .0910, .0765,
  188. .0620, .0540, .0460, .0380, .0300, .0257, .0215, .0172,
  189. .0130, .0112, .0095, .0077, .0060, .0053, .0045, .0038,
  190. .0030, .0025, .0020, .0015, .0010, .0010, .0010, .0010,
  191. .0010, .0009, .0007, .0006, .0005, .0004, .0004, .0003,
  192. .0002, .0002, .0001, .0001, .0000
  193. };
  194. /* 1st spectral band of avhrr (noaa 7) */
  195. static const float sr3[121] = {
  196. .0000, .0008, .0016, .0024, .0032, .0032, .0031, .0030,
  197. .0030, .0029, .0029, .0028, .0028, .0027, .0027, .0026,
  198. .0025, .0031, .0036, .0042, .0047, .0288, .0529, .0769,
  199. .1010, .1943, .2875, .3808, .4740, .5363, .5985, .6608,
  200. .7230, .7390, .7550, .7710, .7870, .7838, .7805, .7773,
  201. .7740, .7788, .7835, .7883, .7930, .8100, .8270, .8440,
  202. .8610, .8958, .9305, .9653,1.0000, .9860, .9720, .9580,
  203. .9440, .9435, .9430, .9425, .9420, .9442, .9465, .9487,
  204. .9510, .9575, .9640, .9705, .9770, .9135, .8500, .7865,
  205. .7230, .6285, .5340, .4395, .3450, .2955, .2460, .1965,
  206. .1470, .1280, .1090, .0900, .0710, .0638, .0565, .0493,
  207. .0420, .0383, .0345, .0307, .0270, .0245, .0220, .0195,
  208. .0170, .0158, .0145, .0132, .0120, .0114, .0107, .0101,
  209. .0095, .0096, .0098, .0099, .0100, .0103, .0105, .0108,
  210. .0110, .0100, .0090, .0080, .0070, .0052, .0035, .0017,
  211. .0000
  212. };
  213. /* 2nd spectral band of avhrr (noaa 7) */
  214. static const float sr4[213] = {
  215. .0000, .0018, .0035, .0053, .0070, .0068, .0065, .0063,
  216. .0060, .0058, .0055, .0052, .0050, .0050, .0050, .0050,
  217. .0050, .0060, .0070, .0080, .0090, .0320, .0550, .0780,
  218. .1010, .1788, .2565, .3343, .4120, .4922, .5725, .6527,
  219. .7330, .7765, .8200, .8635, .9070, .9218, .9365, .9513,
  220. .9660, .9725, .9790, .9855, .9920, .9940, .9960, .9980,
  221. 1.0000, .9962,.9925, .9887, .9850, .9870, .9890, .9910,
  222. .9930, .9763, .9595, .9428, .9260, .9298, .9335, .9373,
  223. .9410, .9373, .9335, .9298, .9260, .9120, .8980, .8840,
  224. .8700, .8700, .8700, .8700, .8700, .8703, .8705, .8708,
  225. .8710, .8708, .8705, .8703, .8700, .8715, .8730, .8745,
  226. .8760, .8740, .8720, .8700, .8680, .8690, .8700, .8710,
  227. .8720, .8687, .8655, .8623, .8590, .8555, .8520, .8485,
  228. .8450, .8428, .8405, .8383, .8360, .8328, .8295, .8263,
  229. .8230, .8145, .8060, .7975, .7890, .7872, .7855, .7838,
  230. .7820, .7790, .7760, .7730, .7700, .7682, .7665, .7648,
  231. .7630, .7545, .7460, .7375, .7290, .6987, .6685, .6382,
  232. .6080, .5623, .5165, .4707, .4250, .3812, .3375, .2937/
  233. .2500, .2215, .1930, .1645, .1360, .1202, .1045, .0887,
  234. .0730, .0647, .0565, .0482, .0400, .0357, .0315, .0272,
  235. .0230, .0207, .0185, .0162, .0140, .0125, .0110, .0095,
  236. .0080, .0075, .0070, .0065, .0060, .0055, .0050, .0045,
  237. .0040, .0039, .0038, .0037, .0036, .0036, .0037, .0037,
  238. .0037, .0035, .0034, .0032, .0031, .0029, .0028, .0026,
  239. .0025, .0025, .0024, .0024, .0023, .0023, .0022, .0022,
  240. .0021, .0021, .0021, .0020, .0020, .0019, .0019, .0018,
  241. .0018, .0013, .0009, .0004, .0000
  242. };
  243. /* 1st spectral band of avhrr (noaa 8) */
  244. static const float sr5[189] = {
  245. .0000, .0012, .0024, .0036, .0048, .0223, .0399, .0574,
  246. .0749, .1633, .2517, .3400, .4284, .4937, .5590, .6243,
  247. .6896, .7135, .7375, .7614, .7853, .7833, .7813, .7793,
  248. .7773, .7774, .7775, .7776, .7777, .7922, .8067, .8211,
  249. .8356, .8566, .8777, .8987, .9197, .9332, .9468, .9603,
  250. .9739, .9674, .9609, .9545, .9480, .9507, .9534, .9561,
  251. .9588, .9691, .9794, .9897,1.0000, .9692, .9385, .9077,
  252. .8770, .7775, .6779, .5784, .4789, .4108, .3428, .2747,
  253. .2067, .1782, .1497, .1213, .0928, .0820, .0712, .0604,
  254. .0496, .0425, .0355, .0284, .0214, .0208, .0202, .0196,
  255. .0190, .0167, .0145, .0122, .0100, .0095, .0090, .0085,
  256. .0080, .0083, .0086, .0089, .0092, .0094, .0097, .0100,
  257. .0103, .0100, .0096, .0093, .0090, .0086, .0083, .0079,
  258. .0076, .0082, .0087, .0093, .0099, .0104, .0110, .0115,
  259. .0121, .0114, .0108, .0101, .0094, .0088, .0081, .0075,
  260. .0068, .0074, .0079, .0085, .0091, .0097, .0102, .0108,
  261. .0114, .0115, .0115, .0116, .0117, .0118, .0119, .0119,
  262. .0120, .0136, .0152, .0167, .0183, .0204, .0224, .0245,
  263. .0265, .0295, .0324, .0354, .0384, .0419, .0453, .0488,
  264. .0522, .0514, .0507, .0499, .0491, .0467, .0443, .0420,
  265. .0396, .0348, .0299, .0251, .0203, .0183, .0164, .0144,
  266. .0125, .0118, .0110, .0103, .0095, .0083, .0071, .0060,
  267. .0048, .0041, .0035, .0028, .0022, .0022, .0021, .0021,
  268. .0021, .0016, .0010, .0005, .0000
  269. };
  270. /* 2nd spectral band of avhrr (noaa 8) */
  271. static const float sr6[177] = {
  272. .0000, .0095, .0190, .0285, .0381, .0476, .0571, .0666,
  273. .0761, .1559, .2358, .3156, .3954, .4855, .5756, .6658,
  274. .7559, .7966, .8373, .8779, .9186, .9332, .9478, .9624,
  275. .9770, .9814, .9858, .9902, .9946, .9959, .9973, .9986,
  276. 1.0000, .9965, .9930, .9896, .9861, .9796, .9731, .9666,
  277. .9601, .9518, .9435, .9351, .9268, .9171, .9073, .8976,
  278. .8879, .8791, .8703, .8615, .8527, .8439, .8351, .8263,
  279. .8175, .8140, .8104, .8068, .8033, .7997, .7962, .7926,
  280. .7891, .7871, .7850, .7830, .7810, .7790, .7769, .7749,
  281. .7729, .7711, .7694, .7677, .7659, .7642, .7624, .7607,
  282. .7589, .7558, .7528, .7497, .7466, .7436, .7405, .7375,
  283. .7344, .7282, .7220, .7158, .7096, .7034, .6972, .6910,
  284. .6848, .6781, .6713, .6646, .6579, .6511, .6444, .6376,
  285. .6309, .6265, .6221, .6177, .6133, .6088, .6044, .6000,
  286. .5956, .5888, .5820, .5752, .5684, .5616, .5548, .5480,
  287. .5412, .5159, .4906, .4653, .4400, .4147, .3894, .3641,
  288. .3388, .3061, .2734, .2408, .2081, .1851, .1621, .1392,
  289. .1162, .1023, .0884, .0745, .0606, .0532, .0458, .0384/
  290. .0310, .0271, .0231, .0192, .0153, .0134, .0115, .0096,
  291. .0077, .0071, .0065, .0059, .0053, .0046, .0040, .0034,
  292. .0028, .0026, .0024, .0023, .0021, .0019, .0017, .0016,
  293. .0014, .0012, .0010, .0009, .0007, .0005, .0003, .0002,
  294. .0000
  295. };
  296. /* 1st spectral band of avhrr (noaa 9) */
  297. static const float sr7[113] = {
  298. .0000, .0001, .0003, .0004, .0006, .0040, .0074, .0108,
  299. .0142, .0622, .1101, .1581, .2060, .2810, .3561, .4311,
  300. .5061, .5500, .5940, .6379, .6818, .7127, .7437, .7746,
  301. .8055, .8122, .8190, .8170, .8150, .8063, .7975, .7887,
  302. .7800, .7881, .7962, .8044, .8125, .8335, .8544, .8753,
  303. .8963, .9000, .9037, .9074, .9111, .8899, .8688, .8476,
  304. .8265, .8198, .8130, .8110, .8090, .8277, .8464, .8650,
  305. .8837, .9128, .9419, .9709,1.0000, .9678, .9356, .9035,
  306. .8713, .7712, .6711, .5711, .4710, .4067, .3424, .2782,
  307. .2139, .1849, .1559, .1269, .0979, .0861, .0743, .0625,
  308. .0507, .0454, .0400, .0347, .0294, .0266, .0238, .0210,
  309. .0182, .0170, .0157, .0145, .0133, .0124, .0115, .0107,
  310. .0098, .0092, .0086, .0080, .0074, .0071, .0069, .0066,
  311. .0063, .0062, .0061, .0061, .0060, .0045, .0030, .0015,
  312. .0000
  313. };
  314. /* 2nd spectral band of avhrr (noaa 9) */
  315. static const float sr8[197] = {
  316. .0000, .0011, .0022, .0033, .0044, .0207, .0369, .0532,
  317. .0694, .1410, .2127, .2843, .3559, .4388, .5217, .6047,
  318. .6876, .7304, .7731, .8159, .8586, .8782, .8977, .9173,
  319. .9369, .9491, .9614, .9736, .9859, .9894, .9930, .9965,
  320. 1.0000, .9956, .9912, .9869, .9825, .9699, .9574, .9448,
  321. .9323, .9243, .9163, .9083, .9003, .8971, .8939, .8907,
  322. .8875, .8881, .8887, .8893, .8899, .8931, .8963, .8994,
  323. .9026, .9046, .9067, .9087, .9108, .9114, .9120, .9126,
  324. .9132, .9065, .8997, .8930, .8863, .8807, .8750, .8694,
  325. .8638, .8605, .8571, .8538, .8504, .8532, .8560, .8588,
  326. .8616, .8644, .8672, .8701, .8729, .8749, .8770, .8790,
  327. .8811, .8766, .8721, .8677, .8632, .8502, .8372, .8242,
  328. .8112, .7959, .7806, .7653, .7500, .7423, .7347, .7270,
  329. .7193, .7166, .7138, .7111, .7084, .7169, .7255, .7340,
  330. .7425, .7382, .7338, .7295, .7251, .6819, .6387, .5955,
  331. .5523, .4922, .4321, .3721, .3120, .2722, .2325, .1927,
  332. .1529, .1336, .1144, .0951, .0759, .0673, .0586, .0500,
  333. .0414, .0370, .0327, .0283, .0240, .0217, .0195, .0172,
  334. .0150, .0139, .0128, .0118, .0107, .0099, .0090, .0082,
  335. .0074, .0070, .0066, .0061, .0057, .0054, .0051, .0049,
  336. .0046, .0044, .0042, .0041, .0039, .0037, .0036, .0034,
  337. .0033, .0032, .0031, .0030, .0029, .0028, .0027, .0026,
  338. .0025, .0025, .0025, .0024, .0024, .0023, .0022, .0021,
  339. .0020, .0019, .0018, .0018, .0017, .0016, .0015, .0015,
  340. .0014, .0010, .0007, .0003, .0000
  341. };
  342. /* 1st spectral band of avhrr (noaa 10) */
  343. static const float sr9[101] = {
  344. .0000, .0005, .0010, .0015, .0020, .0023, .0025, .0028,
  345. .0030, .0239, .0448, .0657, .0866, .1852, .2838, .3824,
  346. .4810, .5470, .6130, .6790, .7450, .7640, .7830, .8020,
  347. .8210, .8182, .8154, .8126, .8098, .8219, .8339, .8460,
  348. .8580, .8808, .9035, .9263, .9490, .9607, .9723, .9840,
  349. .9956, .9875, .9793, .9712, .9630, .9595, .9560, .9525,
  350. .9490, .9618, .9745, .9872,1.0000, .9980, .9960, .9940,
  351. .9920, .9013, .8105, .7197, .6290, .5400, .4510, .3620,
  352. .2730, .2315, .1900, .1485, .1070, .0935, .0800, .0665,
  353. .0530, .0468, .0405, .0343, .0280, .0255, .0230, .0205,
  354. .0180, .0165, .0150, .0135, .0120, .0110, .0100, .0090,
  355. .0080, .0070, .0061, .0051, .0042, .0034, .0026, .0018,
  356. .0010, .0007, .0005, .0002, .0000
  357. };
  358. /* 2nd spectral band of avhrr (noaa 10) */
  359. static const float sr10[237] = {
  360. .0000, .0006, .0012, .0018, .0024, .0030, .0036, .0042,
  361. .0048, .0049, .0049, .0050, .0051, .0051, .0052, .0052,
  362. .0053, .0053, .0054, .0054, .0055, .0055, .0056, .0056,
  363. .0057, .0054, .0050, .0047, .0044, .0041, .0037, .0034,
  364. .0031, .0031, .0032, .0032, .0033, .0033, .0033, .0034,
  365. .0034, .0239, .0445, .0650, .0855, .1561, .2267, .2974,
  366. .3680, .4508, .5335, .6163, .6990, .7430, .7870, .8310,
  367. .8750, .8918, .9085, .9253, .9420, .9510, .9600, .9690,
  368. .9780, .9835, .9890, .9945,1.0000, .9933, .9866, .9800,
  369. .9733, .9661, .9589, .9517, .9445, .9329, .9213, .9096,
  370. .8980, .8935, .8890, .8845, .8800, .8788, .8775, .8763,
  371. .8750, .8658, .8565, .8473, .8380, .8415, .8450, .8485,
  372. .8520, .8508, .8495, .8483, .8470, .8410, .8350, .8290,
  373. .8230, .8148, .8065, .7983, .7900, .7983, .8065, .8148,
  374. .8230, .8190, .8150, .8110, .8070, .7990, .7910, .7830,
  375. .7750, .7712, .7675, .7637, .7600, .7425, .7250, .7075,
  376. .6900, .6855, .6810, .6765, .6720, .6710, .6700, .6690,
  377. .6680, .6655, .6630, .6605, .6580, .6455, .6330, .6205,
  378. .6080, .5993, .5905, .5818, .5730, .5602, .5475, .5347,
  379. .5220, .4872, .4525, .4177, .3830, .3435, .3040, .2645,
  380. .2250, .2015, .1780, .1545, .1310, .1155, .1000, .0845,
  381. .0690, .0613, .0535, .0457, .0380, .0337, .0295, .0252,
  382. .0210, .0189, .0168, .0147, .0126, .0114, .0102, .0091,
  383. .0079, .0073, .0067, .0060, .0054, .0051, .0047, .0044,
  384. .0041, .0040, .0038, .0037, .0036, .0035, .0034, .0033,
  385. .0032, .0031, .0030, .0030, .0029, .0028, .0027, .0027,
  386. .0026, .0026, .0025, .0025, .0024, .0023, .0022, .0022,
  387. .0021, .0020, .0019, .0018, .0017, .0016, .0016, .0015,
  388. .0015, .0015, .0014, .0014, .0014, .0014, .0014, .0015,
  389. .0015, .0011, .0008, .0004, .0000
  390. };
  391. /* 1st spectral band of avhrr (noaa 11) */
  392. static const float sr11[113] = {
  393. .0000, .0033, .0065, .0098, .0130, .0500, .0870, .1240,
  394. .1610, .2385, .3160, .3935, .4710, .5150, .5590, .6030,
  395. .6470, .6768, .7065, .7363, .7660, .7745, .7830, .7915,
  396. .8000, .7918, .7835, .7753, .7670, .7747, .7825, .7903,
  397. .7980, .8215, .8450, .8685, .8920, .8907, .8895, .8882,
  398. .8870, .8702, .8535, .8367, .8200, .8110, .8020, .7930,
  399. .7840, .8050, .8260, .8470, .8680, .9010, .9340, .9670,
  400. 1.0000, .9562, .9125, .8687, .8250, .7192, .6135, .5077,
  401. .4020, .3467, .2915, .2362, .1810, .1568, .1325, .1083,
  402. .0840, .0735, .0630, .0525, .0420, .0380, .0340, .0300,
  403. .0260, .0242, .0225, .0207, .0190, .0180, .0170, .0160,
  404. .0150, .0137, .0125, .0112, .0100, .0087, .0075, .0062,
  405. .0050, .0052, .0055, .0057, .0060, .0060, .0060, .0060,
  406. .0060, .0060, .0060, .0060, .0060, .0045, .0030, .0015,
  407. .0000
  408. };
  409. /* 2nd spectral band of avhrr (noaa 11) */
  410. static const float sr12[209] = {
  411. .0000, .0005, .0010, .0015, .0020, .0025, .0030, .0035,
  412. .0040, .0039, .0037, .0036, .0035, .0034, .0032, .0031,
  413. .0030, .0029, .0028, .0026, .0025, .0024, .0023, .0021,
  414. .0020, .0020, .0020, .0020, .0020, .0020, .0020, .0020,
  415. .0020, .0028, .0035, .0043, .0050, .0173, .0295, .0418,
  416. .0540, .1150, .1760, .2370, .2980, .3822, .4665, .5507,
  417. .6350, .6865, .7380, .7895, .8410, .8623, .8835, .9048,
  418. .9260, .9415, .9570, .9725, .9880, .9910, .9940, .9970,
  419. 1.0000, .9925, .9850, .9775, .9700, .9600, .9500, .9400,
  420. .9300, .9193, .9085, .8978, .8870, .8770, .8670, .8570,
  421. .8470, .8478, .8485, .8493, .8500, .8518, .8535, .8553,
  422. .8570, .8602, .8635, .8668, .8700, .8673, .8645, .8618,
  423. .8590, .8505, .8420, .8335, .8250, .8183, .8115, .8047,
  424. .7980, .7983, .7985, .7988, .7990, .7935, .7880, .7825,
  425. .7770, .7835, .7900, .7965, .8030, .8075, .8120, .8165,
  426. .8210, .8108, .8005, .7903, .7800, .7767, .7735, .7703,
  427. .7670, .7473, .7275, .7077, .6880, .6755, .6630, .6505,
  428. .6380, .6350, .6320, .6290, .6260, .6345, .6430, .6515/
  429. .6600, .6695, .6790, .6885, .6980, .6790, .6600, .6410,
  430. .6220, .5645, .5070, .4495, .3920, .3420, .2920, .2420,
  431. .1920, .1667, .1415, .1162, .0910, .0795, .0680, .0565,
  432. .0450, .0411, .0372, .0334, .0295, .0256, .0217, .0179,
  433. .0140, .0129, .0117, .0106, .0095, .0084, .0072, .0061,
  434. .0050, .0048, .0045, .0043, .0040, .0038, .0035, .0033,
  435. .0030, .0029, .0027, .0026, .0025, .0024, .0022, .0021,
  436. .0020, .0017, .0015, .0012, .0010, .0007, .0005, .0002,
  437. .0000
  438. };
  439. /* 1st spectral band of avhrr (noaa 12) */
  440. static const float sr13[201] = {
  441. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  442. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  443. .0000, .0000, .0000, .0000, .0000, .0048, .0135, .0200,
  444. .0270, .1046, .2094, .3253, .4360, .5286, .6030, .6621,
  445. .7090, .7464, .7753, .7966, .8110, .8196, .8249, .8301,
  446. .8380, .8507, .8668, .8837, .8990, .9109, .9198, .9265,
  447. .9320, .9371, .9419, .9466, .9510, .9552, .9587, .9612,
  448. .9620, .9610, .9593, .9582, .9590, .9625, .9673, .9715,
  449. .9730, .9707, .9666, .9635, .9640, .9701, .9799, .9908,
  450. 1.0000, .9805, .9590, .9407, .9180, .8357, .7325, .6205,
  451. .5120, .4170, .3365, .2692, .2140, .1695, .1343, .1066,
  452. .0850, .0679, .0546, .0442, .0360, .0294, .0240, .0196,
  453. .0160, .0130, .0105, .0089, .0080, .0080, .0083, .0085,
  454. .0080, .0064, .0041, .0018, .0000, .0000, .0000, .0000,
  455. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  456. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  457. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  458. .0000, .0024, .0056, .0087, .0110, .0118, .0117, .0112,
  459. .0110, .0117, .0130, .0145, .0160, .0171, .0178, .0184,
  460. .0190, .0197, .0205, .0213, .0220, .0226, .0229, .0228,
  461. .0220, .0205, .0187, .0170, .0160, .0159, .0160, .0157,
  462. .0140, .0106, .0063, .0023, .0000, .0001, .0018, .0038,
  463. .0050, .0044, .0027, .0009, .0000, .0006, .0023, .0040,
  464. .0050, .0046, .0032, .0015, .0000, .0000, .0000, .0000,
  465. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  466. .0000
  467. };
  468. /* 2nd spectral band of avhrr (noaa 12) */
  469. static const float sr14[189] = {
  470. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  471. .0000, .0050, .0111, .0162, .0180, .0153, .0097, .0038,
  472. .0000, .0005, .0060, .0168, .0330, .0555, .0869, .1303,
  473. .1890, .2643, .3509, .4418, .5300, .6096, .6796, .7403,
  474. .7920, .8350, .8702, .8988, .9220, .9408, .9559, .9680,
  475. .9780, .9863, .9929, .9975,1.0000, .0115, .9987, .9958,
  476. .9920, .9876, .9821, .9748, .9650, .9522, .9370, .9203,
  477. .9030, .8858, .8694, .8543, .8410, .8299, .8207, .8129,
  478. .8060, .7997, .7943, .7902, .7880, .7879, .7893, .7916,
  479. .7940, .7959, .7971, .7972, .7960, .7935, .7900, .7860,
  480. .7820, .7783, .7747, .7704, .7650, .7582, .7506, .7433,
  481. .7370, .7326, .7299, .7288, .7290, .7303, .7323, .7350,
  482. .7380, .7411, .7441, .7468, .7490, .7504, .7510, .7505,
  483. .7490, .7463, .7421, .7365, .7290, .7197, .7086, .6960,
  484. .6820, .6670, .6518, .6371, .6240, .6131, .6043, .5973,
  485. .5920, .5881, .5857, .5849, .5860, .5889, .5929, .5969,
  486. .6000, .6011, .5986, .5905, .5750, .5508, .5186, .4792,
  487. .4340, .3842, .3326, .2822, .2360, .1964, .1633, .1357,
  488. .1130, .0943, .0789, .0664, .0560, .0473, .0400, .0339,
  489. .0290, .0250, .0217, .0191, .0170, .0152, .0137, .0123,
  490. .0110, .0098, .0086, .0077, .0070, .0066, .0063, .0059,
  491. .0050, .0035, .0019, .0005, .0000, .0006, .0019, .0033,
  492. .0040, .0036, .0025, .0011, .0000, .0000, .0000, .0000,
  493. .0000, .0000, .0000, .0000, .0000
  494. };
  495. /* 1st spectral band of avhrr (noaa 14) -from NOAA/POD Guide */
  496. static const float sr15[241] = {
  497. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  498. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  499. .0000, .0003, .0007, .0010, .0013, .0152, .0290, .0429,
  500. .0568, .1226, .1884, .2543, .3201, .3727, .4254, .4780,
  501. .5306, .5528, .5749, .5971, .6193, .6267, .6342, .6417,
  502. .6492, .6538, .6583, .6629, .6675, .6734, .6793, .6853,
  503. .6912, .6948, .6984, .7020, .7056, .7106, .7156, .7206,
  504. .7256, .7243, .7229, .7216, .7203, .7188, .7174, .7159,
  505. .7145, .7130, .7116, .7102, .7088, .7154, .7221, .7287,
  506. .7353, .7292, .7232, .7172, .7111, .6501, .5891, .5281,
  507. .4671, .4037, .3402, .2768, .2133, .1830, .1527, .1223,
  508. .0920, .0797, .0675, .0553, .0431, .0406, .0381, .0357,
  509. .0332, .0279, .0226, .0173, .0120, .0117, .0114, .0110,
  510. .0107, .0100, .0093, .0086, .0080, .0076, .0072, .0069,
  511. .0065, .0062, .0059, .0055, .0052, .0051, .0050, .0048,
  512. .0047, .0048, .0049, .0050, .0051, .0051, .0050, .0050,
  513. .0050, .0050, .0051, .0052, .0052, .0053, .0054, .0054,
  514. .0055, .0057, .0059, .0061, .0063, .0068, .0072, .0076,
  515. .0080, .0084, .0088, .0092, .0096, .0100, .0104, .0108,
  516. .0113, .0116, .0119, .0122, .0125, .0127, .0128, .0130,
  517. .0132, .0130, .0128, .0126, .0123, .0120, .0116, .0112,
  518. .0108, .0104, .0099, .0095, .0090, .0086, .0082, .0078,
  519. .0074, .0072, .0070, .0067, .0065, .0063, .0060, .0058,
  520. .0055, .0053, .0050, .0048, .0046, .0044, .0042, .0040,
  521. .0038, .0036, .0034, .0032, .0030, .0028, .0027, .0025,
  522. .0023, .0022, .0022, .0021, .0020, .0019, .0018, .0017,
  523. .0016, .0016, .0015, .0014, .0014, .0013, .0012, .0012,
  524. .0011, .0011, .0011, .0011, .0011, .0011, .0011, .0011,
  525. .0011, .0011, .0011, .0011, .0011, .0011, .0011, .0010,
  526. .0010, .0010, .0010, .0010, .0010, .0010, .0010, .0010,
  527. .0010
  528. };
  529. /* 2nd spectral band of avhrr (noaa 14) */
  530. static const float sr16[176] = {
  531. .0000,.0000,.0000,.0000,.0000,.0000,.0022,.0045,
  532. .0067,.0090,.0107,.0125,.0143,.0160,.0543,.0925,
  533. .1308,.1690,.2573,.3455,.4338,.5220,.5978,.6735,
  534. .7492,.8250,.8503,.8755,.9007,.9260,.9362,.9465,
  535. .9568,.9670,.9737,.9805,.9872,.9940,.9935,.9930,
  536. .9925,.9920,.9940,.9960,.9980,1.000,.9885,.9770,
  537. .9655,.9540,.9398,.9255,.9112,.8970,.8855,.8740,
  538. .8625,.8510,.8400,.8290,.8180,.8070,.8052,.8035,
  539. .8018,.8000,.8065,.8130,.8195,.8260,.8257,.8255,
  540. .8253,.8250,.8245,.8240,.8235,.8230,.8230,.8230,
  541. .8230,.8230,.8210,.8190,.8170,.8150,.8147,.8145,
  542. .8142,.8140,.8183,.8225,.8267,.8310,.8367,.8425,
  543. .8482,.8540,.8547,.8555,.8562,.8570,.8510,.8450,
  544. .8390,.8330,.8170,.8010,.7850,.7690,.7587,.7485,
  545. .7383,.7280,.7203,.7125,.7048,.6970,.6957,.6945,
  546. .6932,.6920,.6970,.7020,.7070,.7120,.7035,.6950,
  547. .6865,.6780,.6370,.5960,.5550,.5140,.4560,.3980,
  548. .3400,.2820,.2458,.2095,.1732,.1370,.1190,.1010,
  549. .0830,.0650,.0560,.0470,.0380,.0290,.0250,.0210,
  550. .0170,.0130,.0095,.0060,.0050,.0040,.0020,.0000,
  551. .0010,.0020,.0018,.0015,.0012,.0010,.0010,.0010,
  552. .0010,.0010,.0008,.0005,.0003,.0000,.0000,.0000
  553. };
  554. static const float wli[16] = { 0.55, 0.69, 0.5, 0.64, 0.54, 0.68, 0.53, 0.68, 0.53, 0.60, 0.54, 0.60, 0.50, 0.65, 0.50, 0.68 };
  555. static const float wls[16] = { 0.75, 1.12, 0.8, 1.17, 1.01, 1.12, 0.81, 1.17, 0.78, 1.19, 0.82, 1.12, 1.00, 1.12, 1.11, 1.10 };
  556. ffu.wlinf = (float)wli[iwa-1];
  557. ffu.wlsup = (float)wls[iwa-1];
  558. int i;
  559. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  560. switch(iwa)
  561. {
  562. case 1: for(i = 0; i < 80; i++) ffu.s[120+i] = sr1[i];
  563. break;
  564. case 2: for(i = 0; i < 173; i++) ffu.s[176+i] = sr2[i];
  565. break;
  566. case 3: for(i = 0; i < 121; i++) ffu.s[100+i] = sr3[i];
  567. break;
  568. case 4: for(i = 0; i < 213; i++) ffu.s[156+i] = sr4[i];
  569. break;
  570. case 5: for(i = 0; i < 189; i++) ffu.s[116+i] = sr5[i];
  571. break;
  572. case 6: for(i = 0; i < 177; i++) ffu.s[172+i] = sr6[i];
  573. break;
  574. case 7: for(i = 0; i < 113; i++) ffu.s[112+i] = sr7[i];
  575. break;
  576. case 8: for(i = 0; i < 197; i++) ffu.s[172+i] = sr8[i];
  577. break;
  578. case 9: for(i = 0; i < 101; i++) ffu.s[112+i] = sr9[i];
  579. break;
  580. case 10: for(i = 0; i < 237; i++) ffu.s[140+i] = sr10[i];
  581. break;
  582. case 11: for(i = 0; i < 113; i++) ffu.s[116+i] = sr11[i];
  583. break;
  584. case 12: for(i = 0; i < 209; i++) ffu.s[140+i] = sr12[i];
  585. break;
  586. case 13: for(i = 0; i < 201; i++) ffu.s[100+i] = sr13[i];
  587. break;
  588. case 14: for(i = 0; i < 189; i++) ffu.s[160+i] = sr14[i];
  589. break;
  590. case 15: for(i = 0; i < 241; i++) ffu.s[100+i] = sr15[i];
  591. break;
  592. case 16: for(i = 0; i < 176; i++) ffu.s[168+i] = sr16[i];
  593. }
  594. }
  595. void IWave::hrv(int iwa)
  596. {
  597. /* 1st spectral band of hrv1 */
  598. static const float sr1[73] = {
  599. .0010, .0023, .0035, .0048, .0060, .0492, .0925, .1357,
  600. .1790, .2598, .3405, .4213, .5020, .5575, .6130, .6685,
  601. .7240, .7588, .7935, .8283, .8630, .8900, .9170, .9440,
  602. .9710, .9782, .9855, .9927,1.0000, .9875, .9750, .9625,
  603. .9500, .9255, .9010, .8765, .8520, .8225, .7930, .7635,
  604. .7340, .7105, .6870, .6635, .6400, .5945, .5490, .5035,
  605. .4580, .3985, .3390, .2795, .2200, .1787, .1375, .0962,
  606. .0550, .0437, .0325, .0212, .0100, .0085, .0070, .0055,
  607. .0040, .0035, .0030, .0025, .0020, .0015, .0010, .0005,
  608. .0000
  609. };
  610. /* 2nd spectral band of hrv1 */
  611. static const float sr2[49] = {
  612. .0190, .0845, .1500, .2155, .2810, .3870, .4930, .5990,
  613. .7050, .7663, .8275, .8888, .9500, .9557, .9615, .9672,
  614. .9730, .9797, .9865, .9933,1.0000, .8445, .6890, .5335,
  615. .3780, .3152, .2525, .1897, .1270, .1067, .0865, .0662,
  616. .0460, .0395, .0330, .0265, .0200, .0172, .0145, .0117,
  617. .0090, .0080, .0070, .0060, .0050, .0045, .0040, .0035,
  618. .0030
  619. };
  620. /* 3rd spectral band of hrv1 */
  621. static const float sr3[81] = {
  622. .0010, .0033, .0055, .0078, .0100, .0238, .0375, .0513,
  623. .0650, .0953, .1255, .1558, .1860, .2470, .3080, .3690,
  624. .4300, .4918, .5535, .6153, .6770, .7222, .7675, .8127,
  625. .8580, .8825, .9070, .9315, .9560, .9670, .9780, .9890,
  626. 1.0000, .9915, .9830, .9745, .9660, .9557, .9455, .9352,
  627. .9250, .9112, .8975, .8837, .8700, .8777, .8855, .8932,
  628. .9010, .8342, .7675, .7007, .6340, .5600, .4860, .4120,
  629. .3380, .2875, .2370, .1865, .1360, .1130, .0900, .0670,
  630. .0440, .0360, .0280, .0200, .0120, .0108, .0095, .0083,
  631. .0070, .0067, .0065, .0062, .0060, .0047, .0035, .0022,
  632. .0010
  633. };
  634. /* panchromatic band of hrv1 */
  635. static const float sr4[129] = {
  636. .0000, .0013, .0025, .0038, .0050, .0322, .0595, .0867,
  637. .1140, .1723, .2305, .2888, .3470, .3748, .4025, .4303,
  638. .4580, .4750, .4920, .5090, .5260, .5538, .5815, .6093,
  639. .6370, .6575, .6780, .6985, .7190, .7228, .7265, .7303,
  640. .7340, .7370, .7400, .7430, .7460, .7595, .7730, .7865,
  641. .8000, .8163, .8325, .8488, .8650, .8767, .8885, .9003,
  642. .9120, .9137, .9155, .9172, .9190, .9245, .9300, .9355,
  643. .9410, .9387, .9365, .9342, .9320, .9373, .9425, .9478,
  644. .9530, .9575, .9620, .9665, .9710, .9783, .9855, .9928,
  645. 1.0000, .9898, .9795, .9693, .9590, .9450, .9310, .9170,
  646. .9030, .8780, .8530, .8280, .8030, .7770, .7510, .7250,
  647. .6990, .6820, .6650, .6480, .6310, .6235, .6160, .6085,
  648. .6010, .5535, .5060, .4585, .4110, .3620, .3130, .2640,
  649. .2150, .1825, .1500, .1175, .0850, .0720, .0590, .0460,
  650. .0330, .0282, .0235, .0187, .0140, .0120, .0100, .0080,
  651. .0060, .0055, .0050, .0045, .0040, .0035, .0030, .0025,
  652. .0020
  653. };
  654. /* 1st spectral band of hrv2 */
  655. static const float sr5[73] = {
  656. .0010, .0015, .0020, .0025, .0030, .0040, .0050, .0060,
  657. .0070, .0850, .1630, .2410, .3190, .3918, .4645, .5373,
  658. .6100, .6500, .6900, .7300, .7700, .7965, .8230, .8495,
  659. .8760, .8957, .9155, .9352, .9550, .9663, .9775, .9888,
  660. 1.0000, .9915, .9830, .9745, .9660, .9362, .9065, .8767,
  661. .8470, .8147, .7825, .7502, .7180, .6660, .6140, .5620,
  662. .5100, .4638, .4175, .3713, .3250, .2737, .2225, .1712,
  663. .1200, .1012, .0825, .0637, .0450, .0377, .0305, .0232,
  664. .0160, .0122, .0085, .0047, .0010, .0007, .0005, .0002,
  665. .0000
  666. };
  667. /* 2nd spectral band of hrv2 */
  668. static const float sr6[57] = {
  669. .0040, .0045, .0050, .0055, .0060, .0115, .0170, .0225,
  670. .0280, .0893, .1505, .2118, .2730, .3593, .4455, .5318,
  671. .6180, .6803, .7425, .8048, .8670, .9003, .9335, .9668,
  672. 1.0000, .9365, .8730, .8095, .7460, .6830, .6200, .5570,
  673. .4940, .4405, .3870, .3335, .2800, .2452, .2105, .1757,
  674. .1410, .1222, .1035, .0847, .0660, .0575, .0490, .0405,
  675. .0320, .0283, .0245, .0208, .0170, .0152, .0135, .0117,
  676. .0100
  677. };
  678. /* 3rd spectral band of hrv2 */
  679. static const float sr7[81] = {
  680. .0020, .0030, .0040, .0050, .0060, .0105, .0150, .0195,
  681. .0240, .0380, .0520, .0660, .0800, .1140, .1480, .1820,
  682. .2160, .2722, .3285, .3847, .4410, .5018, .5625, .6233,
  683. .6840, .7298, .7755, .8213, .8670, .8920, .9170, .9420,
  684. .9670, .9753, .9835, .9918,1.0000, .9967, .9935, .9902,
  685. .9870, .9793, .9715, .9638, .9560, .9500, .9440, .9380,
  686. .9320, .9047, .8775, .8502, .8230, .7665, .7100, .6535,
  687. .5970, .5305, .4640, .3975, .3310, .2850, .2390, .1930,
  688. .1470, .1250, .1030, .0810, .0590, .0497, .0405, .0312,
  689. .0220, .0185, .0150, .0115, .0080, .0062, .0045, .0027,
  690. .0010
  691. };
  692. /* panchromatic spectral band of hrv2 */
  693. static const float sr8[129] = {
  694. .0010, .0013, .0015, .0018, .0020, .0137, .0255, .0372,
  695. .0490, .0898, .1305, .1713, .2120, .2468, .2815, .3163,
  696. .3510, .3725, .3940, .4155, .4370, .4655, .4940, .5225,
  697. .5510, .5742, .5975, .6207, .6440, .6505, .6570, .6635,
  698. .6700, .6752, .6805, .6858, .6910, .7032, .7155, .7278,
  699. .7400, .7530, .7660, .7790, .7920, .8027, .8135, .8242,
  700. .8350, .8427, .8505, .8582, .8660, .8692, .8725, .8758,
  701. .8790, .8830, .8870, .8910, .8950, .9025, .9100, .9175,
  702. .9250, .9365, .9480, .9595, .9710, .9783, .9855, .9928,
  703. 1.0000, .9930, .9860, .9790, .9720, .9548, .9375, .9202,
  704. .9030, .8802, .8575, .8347, .8120, .7945, .7770, .7595,
  705. .7420, .7062, .6705, .6347, .5990, .5587, .5185, .4782,
  706. .4380, .3893, .3405, .2918, .2430, .2085, .1740, .1395,
  707. .1050, .0895, .0740, .0585, .0430, .0367, .0305, .0242,
  708. .0180, .0155, .0130, .0105, .0080, .0070, .0060, .0050,
  709. .0040, .0035, .0030, .0025, .0020, .0018, .0015, .0013,
  710. .0010
  711. };
  712. static const float wli[8] = { 0.4699999, 0.60, 0.73, 0.4699999, 0.4699999, 0.5899999, 0.74, 0.4699999 };
  713. static const float wls[8] = { 0.6499999, 0.72, 0.93, 0.7900000, 0.6499999, 0.7300000, 0.94, 0.7900000 };
  714. ffu.wlinf = wli[iwa-1];
  715. ffu.wlsup = wls[iwa-1];
  716. int i;
  717. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  718. switch(iwa)
  719. {
  720. case 1: for(i = 0; i < 73; i++) ffu.s[88+i] = sr1[i];
  721. break;
  722. case 2: for(i = 0; i < 49; i++) ffu.s[140+i] = sr2[i];
  723. break;
  724. case 3: for(i = 0; i < 81; i++) ffu.s[192+i] = sr3[i];
  725. break;
  726. case 4: for(i = 0; i < 129; i++) ffu.s[88+i] = sr4[i];
  727. break;
  728. case 5: for(i = 0; i < 73; i++) ffu.s[88+i] = sr5[i];
  729. break;
  730. case 6: for(i = 0; i < 57; i++) ffu.s[136+i] = sr6[i];
  731. break;
  732. case 7: for(i = 0; i < 81; i++) ffu.s[196+i] = sr7[i];
  733. break;
  734. case 8: for(i = 0; i < 129; i++) ffu.s[88+i] = sr8[i];
  735. break;
  736. }
  737. }
  738. void IWave::tm(int iwa)
  739. {
  740. /* 1st spectral band of thematic mapper */
  741. static const float sr1[53] = {
  742. .0030, .0085, .0140, .0255, .0370, .0500, .0630, .2010,
  743. .3390, .5030, .6670, .6935, .7200, .7525, .7850, .8030,
  744. .8210, .8370, .8530, .8780, .9030, .9135, .9240, .9355,
  745. .9470, .9625, .9780, .9835, .9890, .9860, .9830, .9060,
  746. .8290, .7815, .7340, .5265, .3190, .1995, .0800, .0630,
  747. .0460, .0380, .0300, .0230, .0160, .0120, .0080, .0065,
  748. .0050, .0045, .0040, .0035, .0030
  749. };
  750. /* 2nd spectral band of thematic mapper */
  751. static const float sr2[61] = {
  752. .0010, .0055, .0100, .0165, .0230, .0305, .0380, .1010,
  753. .1640, .2710, .3780, .4750, .5720, .6150, .6580, .6945,
  754. .7310, .7575, .7840, .8105, .8370, .8510, .8650, .8770,
  755. .8890, .8965, .9040, .9055, .9070, .9070, .9070, .9095,
  756. .9120, .9310, .9500, .9685, .9870, .9951, .9980, .9705,
  757. .9430, .8655, .7880, .6250, .4620, .3330, .2040, .1505,
  758. .0970, .0745, .0520, .0440, .0360, .0285, .0210, .0165,
  759. .0120, .0090, .0060, .0030, .0000
  760. };
  761. /* 3rd spectral band of thematic mapper */
  762. static const float sr3[65] = {
  763. .0020, .0020, .0020, .0020, .0020, .0030, .0040, .0060,
  764. .0080, .0140, .0200, .0290, .0380, .0730, .1080, .2020,
  765. .2960, .3840, .4720, .5245, .5770, .6625, .7480, .7830,
  766. .8180, .8430, .8680, .8845, .9010, .9030, .9050, .9055,
  767. .9060, .9200, .9340, .9520, .9700, .9815, .9930,1.0000,
  768. .9980, .9770, .9560, .8715, .7870, .5775, .3680, .2435,
  769. .1190, .0920, .0650, .0555, .0460, .0385, .0310, .0255,
  770. .0200, .0160, .0120, .0090, .0060, .0055, .0050, .0040,
  771. .0030
  772. };
  773. /* 4th spectral band of thematic mapper */
  774. static const float sr4[89] = {
  775. .0020, .0035, .0050, .0060, .0070, .0080, .0090, .0140,
  776. .0190, .0260, .0330, .0520, .0710, .1035, .1360, .2055,
  777. .2750, .3615, .4480, .5505, .6530, .7410, .8290, .8795,
  778. .9300, .9520, .9740, .9870,1.0000, .9955, .9910, .9855,
  779. .9800, .9685, .9570, .9465, .9360, .9260, .9160, .9165,
  780. .9170, .9180, .9190, .9195, .9200, .9215, .9230, .9240,
  781. .9250, .9160, .9070, .8965, .8860, .8835, .8810, .8825,
  782. .8840, .8825, .8810, .8705, .8600, .8410, .8220, .8030,
  783. .7840, .7715, .7590, .7370, .7150, .5905, .4660, .3385,
  784. .2110, .1440, .0770, .0540, .0310, .0230, .0150, .0115,
  785. .0080, .0070, .0060, .0050, .0040, .0030, .0020, .0010,
  786. .0000
  787. };
  788. /* 5th spectral band of thematic mapper */
  789. static const float sr5[156] = {
  790. .0000, .0003, .0007, .0010, .0013, .0015, .0018, .0020,
  791. .0038, .0055, .0073, .0090, .0123, .0155, .0188, .0220,
  792. .0393, .0565, .0738, .0910, .1410, .1910, .2410, .2910,
  793. .3617, .4325, .5032, .5740, .6383, .7025, .7668, .8310,
  794. .8622, .8935, .9248, .9560, .9522, .9485, .9447, .9410,
  795. .9417, .9425, .9433, .9440, .9505, .9570, .9635, .9700,
  796. .9738, .9775, .9813, .9850, .9833, .9815, .9797, .9780,
  797. .9747, .9715, .9682, .9650, .9682, .9715, .9747, .9780,
  798. .9793, .9805, .9818, .9830, .9837, .9845, .9852, .9860,
  799. .9838, .9815, .9793, .9770, .9815, .9860, .9905, .9950,
  800. .9963, .9975, .9988,1.0000, .9992, .9985, .9977, .9970,
  801. .9912, .9855, .9797, .9740, .9697, .9655, .9613, .9570,
  802. .9553, .9535, .9517, .9500, .9505, .9510, .9515, .9520,
  803. .9370, .9220, .9070, .8920, .8260, .7600, .6940, .6280,
  804. .5507, .4735, .3962, .3190, .2780, .2370, .1960, .1550,
  805. .1340, .1130, .0920, .0710, .0643, .0575, .0508, .0440,
  806. .0385, .0330, .0275, .0220, .0197, .0175, .0152, .0130,
  807. .0120, .0110, .0100, .0090, .0077, .0065, .0052, .0040,
  808. .0037, .0035, .0032, .0030, .0027, .0025, .0022, .0020,
  809. .0015, .0010, .0005, .0000
  810. };
  811. /* 7th spectral band of thematic mapper */
  812. static const float sr6[185] = {
  813. .0000, .0005, .0010, .0015, .0020, .0025, .0030, .0035,
  814. .0040, .0043, .0045, .0048, .0050, .0055, .0060, .0065,
  815. .0070, .0075, .0080, .0085, .0090, .0103, .0115, .0128,
  816. .0140, .0153, .0165, .0178, .0190, .0233, .0275, .0318,
  817. .0360, .0400, .0440, .0480, .0520, .0563, .0605, .0648,
  818. .0690, .0768, .0845, .0923, .1000, .1125, .1250, .1375,
  819. .1500, .1753, .2005, .2258, .2510, .2870, .3230, .3590,
  820. .3950, .4313, .4675, .5038, .5400, .5788, .6175, .6563,
  821. .6950, .7345, .7740, .8135, .8530, .8737, .8945, .9152,
  822. .9360, .9398, .9435, .9473, .9510, .9472, .9435, .9397,
  823. .9360, .9385, .9410, .9435, .9460, .9500, .9540, .9580,
  824. .9620, .9693, .9765, .9838, .9910, .9930, .9950, .9970,
  825. .9990,1.0000, .9988, .9975, .9960, .9952, .9945, .9937,
  826. .9930, .9922, .9915, .9908, .9900, .9815, .9730, .9645,
  827. .9560, .9525, .9490, .9455, .9420, .9370, .9320, .9270,
  828. .9220, .9205, .9190, .9175, .9160, .9135, .9110, .9085,
  829. .9060, .9020, .8980, .8940, .8900, .8730, .8560, .8390,
  830. .8220, .8058, .7895, .7732, .7570, .7545, .7520, .7495,
  831. .7470, .7623, .7775, .7928, .8080, .8245, .8410, .8575,
  832. .8740, .8292, .7845, .7397, .6950, .6290, .5630, .4970,
  833. .4310, .3747, .3185, .2622, .2060, .1735, .1410, .1085,
  834. .0760, .0653, .0545, .0438, .0330, .0275, .0220, .0165,
  835. .0110, .0097, .0085, .0072, .0060, .0045, .0030, .0015,
  836. .0000
  837. };
  838. static const float wli[6] = { 0.43, 0.5000000, 0.5799999, 0.73, 1.5025, 1.95 };
  839. static const float wls[6] = { 0.56, 0.6499999, 0.7400000, 0.95, 1.8900, 2.41 };
  840. ffu.wlinf = wli[iwa-1];
  841. ffu.wlsup = wls[iwa-1];
  842. int i;
  843. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  844. switch(iwa)
  845. {
  846. case 1: for(i = 0; i < 53; i++) ffu.s[72+i] = sr1[i];
  847. break;
  848. case 2: for(i = 0; i < 61; i++) ffu.s[100+i] = sr2[i];
  849. break;
  850. case 3: for(i = 0; i < 65; i++) ffu.s[132+i] = sr3[i];
  851. break;
  852. case 4: for(i = 0; i < 89; i++) ffu.s[192+i] = sr4[i];
  853. break;
  854. case 5: for(i = 0; i < 156; i++) ffu.s[501+i] = sr5[i];
  855. break;
  856. case 6: for(i = 0; i < 185; i++) ffu.s[680+i] = sr6[i];
  857. break;
  858. }
  859. }
  860. void IWave::mss(int iwa)
  861. {
  862. /* 1st spectral band of multi spectral scanner */
  863. static const float sr1[67] = {
  864. .00, .01, .01, .01, .02, .04, .05,
  865. .09, .13, .21, .29, .45, .61, .72,
  866. .82, .85, .89, .92, .95, .96, .98,
  867. .99, .99, 1.00, 1.00, 1.00, 1.00, 1.00,
  868. 1.00, 1.00, .99, .99, .98, .98, .98,
  869. .97, .97, .96, .96, .96, .96, .95,
  870. .95, .93, .91, .89, .87, .85, .82,
  871. .73, .65, .54, .43, .38, .33, .24,
  872. .15, .11, .08, .06, .04, .03, .03,
  873. .02, .02, .02, .01
  874. };
  875. /* 2nd spectral band of multi spectral scanner */
  876. static const float sr2[69] = {
  877. .01, .01, .01, .01, .01, .01, .02,
  878. .03, .04, .08, .13, .21, .29, .43,
  879. .57, .69, .80, .86, .92, .94, .96,
  880. .97, .99, .99, 1.00, 1.00, 1.00, .99,
  881. .98, .97, .96, .94, .93, .90, .88,
  882. .92, .96, .96, .96, .95, .95, .90,
  883. .84, .82, .80, .79, .78, .79, .80,
  884. .80, .80, .73, .67, .59, .50, .38,
  885. .25, .18, .11, .09, .08, .07, .06,
  886. .05, .05, .04, .04, .03, .03
  887. };
  888. /* 3rd spectral band of multi spectral scanner */
  889. static const float sr3[81] = {
  890. .01, .01, .01, .02, .02, .02, .02,
  891. .03, .03, .05, .07, .10, .14, .17,
  892. .20, .31, .41, .48, .56, .66, .75,
  893. .83, .90, .93, .97, .98, .99, 1.00,
  894. 1.00, 1.00, .99, .99, .98, .97, .96,
  895. .94, .93, .90, .88, .87, .86, .84,
  896. .83, .82, .82, .82, .82, .82, .83,
  897. .83, .83, .83, .83, .81, .80, .78,
  898. .75, .68, .61, .55, .49, .41, .34,
  899. .29, .24, .19, .15, .12, .08, .07,
  900. .07, .05, .03, .03, .03, .02, .02,
  901. .01, .01, .01, .01
  902. };
  903. /* 4th spectral band of multi spectral scanner */
  904. static const float sr4[127] = {
  905. .01, .02, .02, .04, .06, .14, .21,
  906. .45, .68, .76, .83, .89, .94, .94,
  907. .94, .94, .95, .95, .96, .97, .98,
  908. .99, .99, 1.00, 1.00, 1.00, 1.00, 1.00,
  909. 1.00, 1.00, .99, .98, .97, .96, .95,
  910. .94, .93, .92, .92, .91, .90, .89,
  911. .88, .87, .86, .86, .85, .83, .82,
  912. .81, .80, .78, .77, .76, .76, .75,
  913. .74, .72, .70, .69, .68, .66, .64,
  914. .63, .62, .61, .60, .58, .57, .56/
  915. .55, .55, .54, .52, .51, .50, .49,
  916. .47, .46, .45, .44, .43, .42, .41,
  917. .40, .39, .39, .38, .37, .36, .35,
  918. .34, .33, .32, .31, .30, .29, .28,
  919. .27, .26, .25, .24, .23, .22, .21,
  920. .20, .20, .19, .18, .16, .15, .14,
  921. .13, .12, .12, .11, .10, .08, .07,
  922. .06, .06, .05, .04, .03, .02, .01,
  923. .01
  924. };
  925. static const float wli[4] = { 0.4749999, 0.5799999, 0.6549999, 0.7849999 };
  926. static const float wls[4] = { 0.6399999, 0.7500000, 0.8549998, 1.1000000 };
  927. ffu.wlinf = wli[iwa-1];
  928. ffu.wlsup = wls[iwa-1];
  929. int i;
  930. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  931. switch(iwa)
  932. {
  933. case 1: for(i = 0; i < 67; i++) ffu.s[90+i] = sr1[i];
  934. break;
  935. case 2: for(i = 0; i < 69; i++) ffu.s[132+i] = sr2[i];
  936. break;
  937. case 3: for(i = 0; i < 81; i++) ffu.s[162+i] = sr3[i];
  938. break;
  939. case 4: for(i = 0; i < 127; i++) ffu.s[214+i] = sr4[i];
  940. break;
  941. }
  942. }
  943. void IWave::mas(int iwa)
  944. {
  945. /* first spectral band of Modis airborne simulator */
  946. static const float sr1[35] = {
  947. .0244, .0338, .0536, .1052, .1941, .3166, .4797, .6893,
  948. .9417,1.2218,1.4890,1.7202,1.9194,2.0812,2.1934,2.2580,
  949. 2.3031,2.3395,2.3620,2.3575,2.3228,2.2421,2.1129,1.9317,
  950. 1.7031,1.4126,1.0985, .8088, .5573, .3477, .1843, .0918,
  951. .0473, .0308, .0248
  952. };
  953. /* second spectral band of Modis airborne simulator */
  954. static const float sr2[38] = {
  955. .0197, .0223, .0298, .0481, .0877, .1645, .2829, .4699,
  956. .7101, .9752,1.2209,1.4459,1.6307,1.7482,1.8092,1.8370,
  957. 1.8465,1.8527,1.8574,1.8627,1.8703,1.8733,1.8763,1.8769,
  958. 1.8731,1.8599,1.8221,1.7208,1.5341,1.2689, .9810, .6911,
  959. .4250, .2204, .0947, .0447, .0253, .0209
  960. };
  961. /* third spectral band of Modis airborne simulator */
  962. static const float sr3[34] = {
  963. .0273, .0357, .0560, .1265, .3269, .6239, .9777,1.3481,
  964. 1.7037,2.0081,2.1885,2.2765,2.3178,2.3474,2.3777,2.4053,
  965. 2.4286,2.4487,2.4604,2.4324,2.2594,1.9695,1.6105,1.2200,
  966. .8289, .4724, .2484, .1443, .0998, .0726, .0546, .0421,
  967. .0333, .0270
  968. };
  969. /* fourth spectral band of Modis airborne simulator */
  970. static const float sr4[40] = {
  971. .0242, .0276, .0364, .0505, .0717, .1058, .1841, .3889,
  972. .7570,1.1872,1.6245,1.9511,2.0986,2.1652,2.2058,2.2430,
  973. 2.2471,2.2299,2.2190,2.2052,2.1875,2.1519,2.0989,2.0314,
  974. 1.9292,1.7185,1.3603, .9476, .5555, .2803, .1608, .1090,
  975. .0926, .0830, .0720, .0590, .0476, .0377, .0300, .0245
  976. };
  977. /* fifth spectral band of Modis airborne simulator */
  978. static const float sr5[56] = {
  979. .0232, .0234, .0254, .0259, .0300, .0313, .0325, .0368,
  980. .0397, .0432, .0454, .0525, .0624, .0839, .1305, .2066,
  981. .3012, .4087, .5292, .6814, .8961,1.1607,1.4407,1.6803,
  982. 1.8543,1.9683,2.0260,2.0562,2.0704,2.0550,2.0031,1.9304,
  983. 1.8731,1.8325,1.7974,1.7334,1.6188,1.4710,1.2919,1.0871,
  984. .8785, .6871, .5194, .3728, .2565, .1667, .1099, .0720,
  985. .0536, .0434, .0375, .0355, .0324, .0281, .0251, .0214
  986. };
  987. /* sixth spectral band of Modis airborne simulator */
  988. static const float sr6[40] = {
  989. .0229, .0271, .0404, .0690, .1237, .2051, .3206, .4619,
  990. .6269, .8073,1.0025,1.2045,1.4075,1.5980,1.7690,1.9111,
  991. 2.0102,2.0697,2.0965,2.1009,2.0903,2.0685,2.0262,1.9608,
  992. 1.8675,1.7447,1.5974,1.4411,1.2742,1.0954, .9031, .7062,
  993. .5164, .3475, .2148, .1205, .0665, .0376, .0254, .0211
  994. };
  995. /* seventh spectral band of Modis airborne simulator */
  996. static const float sr7[117] = {
  997. .0075, .0087, .0108, .0133, .0168, .0208, .0257, .0312,
  998. .0379, .0456, .0540, .0629, .0728, .0828, .0937, .1054,
  999. .1189, .1329, .1478, .1618, .1729, .1845, .1963, .2095,
  1000. .2206, .2326, .2448, .2578, .2714, .2864, .3033, .3192,
  1001. .3349, .3515, .3724, .3922, .4100, .4291, .4477, .4674,
  1002. .4824, .4992, .5197, .5436, .5681, .5908, .6099, .6204,
  1003. .6284, .6393, .6466, .6466, .6488, .6531, .6575, .6612,
  1004. .6572, .6566, .6577, .6602, .6649, .6595, .6568, .6522,
  1005. .6606, .6656, .6606, .6517, .6426, .6374, .6311, .6217,
  1006. .6053, .5933, .5827, .5672, .5483, .5325, .5241, .5121,
  1007. .5077, .4958, .4827, .4718, .4552, .4369, .4200, .4076,
  1008. .3921, .3730, .3550, .3397, .3224, .3045, .2849, .2622,
  1009. .2426, .2223, .2035, .1830, .1628, .1416, .1211, .1033,
  1010. .0871, .0731, .0606, .0491, .0395, .0315, .0245, .0189,
  1011. .0151, .0117, .0093, .0076, .0070
  1012. };
  1013. /* third band of MODIS (469nm) soil and vegetation differences */
  1014. static const float sr8[13] = {
  1015. .0732, .8372,3.6403,4.9195,5.0091,5.0102,5.0102,5.0099,
  1016. 4.9670,4.0931,1.2880, .1186, .0237
  1017. };
  1018. /* fifth band of MODIS ( 1.24micron) leaf and canopy properties */
  1019. static const float sr9[25] = {
  1020. .0094, .0143, .0248, .0457, .0902, .1928, .4494,1.1087,
  1021. 2.4282,3.6387,4.5556,4.9434,4.9975,4.9434,4.5556,3.6387,
  1022. 2.4282,1.1087, .4494, .1928, .0902, .0457, .0248, .0143,
  1023. .0094
  1024. };
  1025. /* sixth band of MODIS ( 1.64microns) snow and cloud differences */
  1026. static const float sr10[27] = {
  1027. .0215, .0307, .0493, .0827, .1454, .2693, .5240,1.0412,
  1028. 1.9431,2.6724,3.3494,3.8269,4.0296,4.0624,4.0296,3.8269,
  1029. 3.3494,2.6724,1.9097,1.0412, .5240, .2693, .1454, .0827,
  1030. .0493, .0307, .0215
  1031. };
  1032. static const float wli[10] = { 0.5025, 0.6075, 0.8300, 0.9000, 1.8200, 2.0950, 3.5800, 0.4550, 1.2100, 1.6075 };
  1033. static const float wls[10] = { 0.5875, 0.7000, 0.9125, 0.9975, 1.9575, 2.1925, 3.8700, 0.4850, 1.2700, 1.6725 };
  1034. ffu.wlinf = wli[iwa-1];
  1035. ffu.wlsup = wls[iwa-1];
  1036. int i;
  1037. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  1038. switch(iwa)
  1039. {
  1040. case 1: for(i = 0; i < 35; i++) ffu.s[101+i] = sr1[i];
  1041. break;
  1042. case 2: for(i = 0; i < 38; i++) ffu.s[143+i] = sr2[i];
  1043. break;
  1044. case 3: for(i = 0; i < 34; i++) ffu.s[232+i] = sr3[i];
  1045. break;
  1046. case 4: for(i = 0; i < 40; i++) ffu.s[260+i] = sr4[i];
  1047. break;
  1048. case 5: for(i = 0; i < 56; i++) ffu.s[628+i] = sr5[i];
  1049. break;
  1050. case 6: for(i = 0; i < 40; i++) ffu.s[738+i] = sr6[i];
  1051. break;
  1052. case 7: for(i = 0; i < 117; i++) ffu.s[1332+i] = sr7[i];
  1053. break;
  1054. case 8: for(i = 0; i < 13; i++) ffu.s[82+i] = sr8[i];
  1055. break;
  1056. case 9: for(i = 0; i < 25; i++) ffu.s[384+i] = sr9[i];
  1057. break;
  1058. case 10: for(i = 0; i < 27; i++) ffu.s[543+i] = sr10[i];
  1059. break;
  1060. }
  1061. }
  1062. void IWave::modis(int iwa)
  1063. {
  1064. /* band 1 of MODIS (vegetation monitoring at 250m) */
  1065. static const float sr1[31] = {
  1066. .0000, .0000, .0101, .0984, .2914, .5020, .6564, .6881,
  1067. .7064, .7114, .7292, .7523, .7721, .7852, .8112, .8664,
  1068. .9309, .9794,1.0000, .9855, .9333, .8429, .7187, .5672,
  1069. .3996, .2327, .1024, .0369, .0157, .0092, .0000
  1070. };
  1071. /* band 2 of MODIS (vegetation monitoring at 250m) */
  1072. static const float sr2[34] = {
  1073. .0000, .0216, .0502, .0923, .1431, .1938, .2713, .4292,
  1074. .6543, .8606, .9672, .9609, .9418, .9273, .9311, .9550,
  1075. .9827, .9948,1.0000, .9782, .9308, .7860, .5430, .2931,
  1076. .1477, .0824, .0520, .0367, .0276, .0213, .0159, .0112,
  1077. .0076, .0000
  1078. };
  1079. /* band 3 of MODIS (vegetation monitoring at 500m / MVI) */
  1080. static const float sr3[14] = {
  1081. .0000, .0222, .2021, .7451,1.0141, .9036, .8745, .9242,
  1082. 1.0009, .9305, .5877, .1496, .0170, .0000
  1083. };
  1084. /* band 4 of MODIS (green channel at 500m ) */
  1085. static const float sr4[13] = {
  1086. .0286, .2645, .7583, .9889,1.0002, .9750, .9726, .9878,
  1087. .9622, .7041, .2147, .0163, .0000
  1088. };
  1089. /* band 5 of MODIS (cloud channel at 500m ) */
  1090. static const float sr5[23] = {
  1091. .0000, .0188, .0381, .0984, .1872, .3188, .4933, .6582,
  1092. .8046, .8877, .9564, .9973,1.0000, .9451, .8172, .6366,
  1093. .3949, .2260, .1218, .0623, .0253, .0173, .0000
  1094. };
  1095. /* band 6 of MODIS (snow/ice channel at 500m ) */
  1096. static const float sr6[27] = {
  1097. .0000, .0580, .0910, .1611, .2705, .4289, .6049, .7688,
  1098. .8948, .9729,1.0000, .9969, .9875, .9648, .9278, .8629,
  1099. .7530, .6041, .4342, .2748, .1614, .0911, .0508, .0299,
  1100. .0162, .0108, .0000
  1101. };
  1102. /* band 7 of MODIS (liquid water absorption channel at 500m ) */
  1103. static const float sr7[51] = {
  1104. .0000, .0124, .0165, .0229, .0317, .0444, .0630, .0918,
  1105. .1358, .2006, .2904, .4032, .5329, .6632, .7775, .8680,
  1106. .9308, .9700, .9913,1.0000,1.0009, .9961, .9866, .9715,
  1107. .9498, .9209, .8851, .8446, .8022, .7614, .7241, .6860,
  1108. .6423, .5915, .5326, .4637, .3846, .3042, .2317, .1698,
  1109. .1195, .0814, .0553, .0381, .0266, .0189, .0137, .0097,
  1110. .0056, .0001, .0000
  1111. };
  1112. static const float wli[7] = { 0.6100, 0.8200, 0.4500, 0.5400, 1.2150, 1.6000, 2.0575 };
  1113. static const float wls[7] = { 0.6850, 0.9025, 0.4825, 0.5700, 1.2700, 1.6650, 2.1825 };
  1114. ffu.wlinf = wli[iwa-1];
  1115. ffu.wlsup = wls[iwa-1];
  1116. int i;
  1117. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  1118. switch(iwa)
  1119. {
  1120. case 1: for(i = 0; i < 31; i++) ffu.s[144+i] = sr1[i];
  1121. break;
  1122. case 2: for(i = 0; i < 34; i++) ffu.s[228+i] = sr2[i];
  1123. break;
  1124. case 3: for(i = 0; i < 14; i++) ffu.s[80+i] = sr3[i];
  1125. break;
  1126. case 4: for(i = 0; i < 13; i++) ffu.s[116+i] = sr4[i];
  1127. break;
  1128. case 5: for(i = 0; i < 23; i++) ffu.s[386+i] = sr5[i];
  1129. break;
  1130. case 6: for(i = 0; i < 27; i++) ffu.s[540+i] = sr6[i];
  1131. break;
  1132. case 7: for(i = 0; i < 51; i++) ffu.s[723+i] = sr7[i];
  1133. break;
  1134. }
  1135. }
  1136. void IWave::polder(int iwa)
  1137. {
  1138. /* band 1 of POLDER (443 mic, polarized channel) */
  1139. static const float sr1[27] = {
  1140. .0003, .0042, .0028, .0036, .0060, .0134, .0430, .1284,
  1141. .3394, .6162, .8056, .9060, .9656, .9968, .9880, .8944,
  1142. .6612, .3880, .1950, .0966, .0512, .0292, .0180, .0122,
  1143. .0040, .0000, .0000
  1144. };
  1145. /* band 2 of POLDER (490 mic) */
  1146. static const float sr2[46] = {
  1147. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  1148. .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
  1149. .0000, .0000, .0000, .0000, .0012, .0014, .0022, .0032,
  1150. .0060, .0116, .0252, .0666, .1932, .4896, .8104, .9414,
  1151. .9544, .9710, .9898, .9544, .6920, .3438, .1466, .0630,
  1152. .0304, .0170, .0102, .0070, .0000, .0000
  1153. };
  1154. /* band 3 of POLDER (565 mic) */
  1155. static const float sr3[26] = {
  1156. .0000, .0016, .0048, .0074, .0130, .0258, .0566, .1368,
  1157. .3294, .6592, .9270, .9946, .9798, .9544, .9262, .8814,
  1158. .7692, .5420, .2814, .1218, .0518, .0244, .0118, .0066,
  1159. .0038, .0000
  1160. };
  1161. /* band 4 of POLDER (670 P1, polarized channel) */
  1162. static const float sr4[30] = {
  1163. .0000, .0000, .0000, .0000, .0010, .0044, .0022, .0140,
  1164. .0176, .0394, .1004, .2476, .5462, .8672, .9902, .9874,
  1165. .9572, .9484, .9264, .8274, .5688, .2828, .1154, .0500,
  1166. .0224, .0186, .0160, .0072, .0000, .0000
  1167. };
  1168. /* band 5 of POLDER (763 mic, oxygen absorption channel) */
  1169. static const float sr5[15] = {
  1170. .0000, .0004, .0046, .0134, .0834, .4148, .8056, .9274,
  1171. .9880, .7488, .2416, .0416, .0094, .0008, .0000
  1172. };
  1173. /* band 6 of POLDER (765 mic, oxygen absorption channel) */
  1174. static const float sr6[53] = {
  1175. .0000, .0000, .0010, .0018, .0010, .0030, .0046, .0080,
  1176. .0096, .0140, .0202, .0300, .0410, .0622, .0958, .1516,
  1177. .2400, .3648, .5174, .6640, .7798, .8494, .8858, .9066,
  1178. .9202, .9374, .9516, .9692, .9886, .9932, .9650, .8684,
  1179. .6836, .4686, .2922, .1724, .1012, .0594, .0360, .0238,
  1180. .0144, .0104, .0088, .0060, .0052, .0046, .0038, .0052,
  1181. .0028, .0022, .0000, .0000, .0000
  1182. };
  1183. /* band 7 of POLDER (865 P1, polarized channel) */
  1184. static const float sr7[45] = {
  1185. .0000, .0004, .0008, .0024, .0030, .0056, .0102, .0186,
  1186. .0338, .0622, .1110, .1974, .3410, .5432, .7610, .9218,
  1187. .9896, .9936, .9744, .9514, .9352, .9222, .9150, .9094,
  1188. .8954, .8592, .7766, .6354, .4604, .3006, .1838, .1082,
  1189. .0626, .0346, .0198, .0112, .0064, .0038, .0028, .0016,
  1190. .0014, .0006, .0000, .0000, .0000
  1191. };
  1192. /* band 8 of POLDER (910 mic, water vapor absorption channel) */
  1193. static const float sr8[31] = {
  1194. .0000, .0000, .0000, .0012, .0016, .0018, .0032, .0046,
  1195. .0082, .0158, .0354, .0876, .2242, .5142, .8436, .9848,
  1196. .9838, .9534, .9254, .9084, .8560, .6444, .3388, .1424,
  1197. .0566, .0238, .0098, .0000, .0000, .0000, .0000
  1198. };
  1199. static const float wli[8] = { 0.4125, 0.4100, 0.5325, 0.6300, 0.7450, 0.7000, 0.8100, 0.8650 };
  1200. static const float wls[8] = { 0.4775, 0.5225, 0.5950, 0.7025, 0.7800, 0.8300, 0.9200, 0.9400 };
  1201. ffu.wlinf = wli[iwa-1];
  1202. ffu.wlsup = wls[iwa-1];
  1203. int i;
  1204. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  1205. switch(iwa)
  1206. {
  1207. case 1: for(i = 0; i < 27; i++) ffu.s[65+i] = sr1[i];
  1208. break;
  1209. case 2: for(i = 0; i < 46; i++) ffu.s[64+i] = sr2[i];
  1210. break;
  1211. case 3: for(i = 0; i < 26; i++) ffu.s[113+i] = sr3[i];
  1212. break;
  1213. case 4: for(i = 0; i < 30; i++) ffu.s[152+i] = sr4[i];
  1214. break;
  1215. case 5: for(i = 0; i < 15; i++) ffu.s[198+i] = sr5[i];
  1216. break;
  1217. case 6: for(i = 0; i < 53; i++) ffu.s[180+i] = sr6[i];
  1218. break;
  1219. case 7: for(i = 0; i < 45; i++) ffu.s[224+i] = sr7[i];
  1220. break;
  1221. case 8: for(i = 0; i < 31; i++) ffu.s[246+i] = sr8[i];
  1222. break;
  1223. }
  1224. }
  1225. void IWave::etmplus(int iwa)
  1226. {
  1227. /* Spectral filter data found on the following page:
  1228. http://ltpwww.gsfc.nasa.gov/IAS/handbook/handbook_toc.html
  1229. */
  1230. /* 1st spectral band of enhanced thematic mapper plus */
  1231. static const float sr1[35] = {
  1232. .0160, .0710, .2870, .6665, .7920, .8570, .8390, .8060,
  1233. .7790, .8460, .9010, .8995, .8900, .8510, .8750, .8930,
  1234. .8840, .9300, .9580, .9540, .9800, .9750, .9650, .9625,
  1235. .9950, .9900, .9900, .9795, .9830, .9685, .9600, .7685,
  1236. .2930, .0545, .0090
  1237. };
  1238. /* 2nd spectral band of enhanced thematic mapper plus */
  1239. static const float sr2[50] = {
  1240. .0006, .0015, .0030, .0117, .0260, .0740, .1740, .3480,
  1241. .5520, .6960, .7590, .7845, .8220, .8695, .9050, .9285,
  1242. .9470, .9525, .9520, .9515, .9530, .9500, .9540, .9670,
  1243. .9590, .9405, .9330, .9385, .9510, .9565, .9550, .9560,
  1244. .9730, .9915,1.0000, .9760, .9420, .9300, .9120, .7985,
  1245. .5740, .3400, .1850, .1055, .0620, .0375, .0210, .0109,
  1246. .0048, .0021
  1247. };
  1248. /* 3rd spectral band of enhanced thematic mapper plus */
  1249. static const float sr3[36] = {
  1250. .0001, .0006, .0020, .0095, .0470, .1740, .4190, .7310,
  1251. .9210, .9425, .9370, .9365, .9490, .9645, .9730, .9705,
  1252. .9580, .9550, .9620, .9800, .9930, .9980,1.0000, .9955,
  1253. .9920, .9885, .9770, .9545, .9320, .8805, .7290, .4440,
  1254. .1830, .0660, .0250, .0121
  1255. };
  1256. /* 4th spectral band of enhanced thematic mapper plus */
  1257. static const float sr4[70] = {
  1258. .0004, .0021, .0037, .0024, .0010, .0199, .0315, .0518,
  1259. .0690, .1100, .1750, .2710, .4020, .5555, .7050, .8120,
  1260. .8710, .8955, .9080, .9180, .9260, .9280, .9300, .9255,
  1261. .9250, .9280, .9230, .9165, .9080, .9035, .9090, .9240,
  1262. .9460, .9655, .9710, .9690, .9670, .9655, .9670, .9605,
  1263. .9490, .9310, .9250, .9295, .9430, .9610, .9850, .9925,
  1264. .9980, .9915, .9940, .9970, .9980, .9995, .9910, .9880,
  1265. .9690, .9265, .8680, .8175, .8190, .8800, .8540, .5725,
  1266. .2560, .1035, .0440, .0220, .0110, .0071
  1267. };
  1268. /* 5th spectral band of enhanced thematic mapper plus */
  1269. static const float sr5[116] = {
  1270. .0015, .0000, .0010, .0112, .0120, .0060, .0135, .0210,
  1271. .0400, .0530, .0760, .1028, .1480, .2052, .2740, .3660,
  1272. .4620, .5137, .5780, .6250, .6670, .7090, .7370, .7710,
  1273. .8080, .8315, .8590, .8750, .8930, .9013, .8960, .8953,
  1274. .8945, .8878, .8760, .8685, .8725, .8773, .8740, .8605,
  1275. .8680, .8785, .8990, .8940, .9000, .9020, .9190, .9248,
  1276. .9290, .9455, .9475, .9533, .9520, .9668, .9610, .9598,
  1277. .9780, .9587, .9535, .9513, .9517, .9550, .9440, .9345,
  1278. .9305, .9385, .9480, .9398, .9385, .9470, .9450, .9450,
  1279. .9553, .9648, .9690, .9733, .9910, .9960, .9975, .9945,
  1280. 1.0000, .9913, .9865, .9885, .9895, .9875, .9810, .9812,
  1281. .9780, .9685, .9600, .9383, .9020, .8545, .7910, .6928,
  1282. .6077, .5257, .4275, .3420, .2670, .2028, .1585, .1187,
  1283. .0840, .0723, .0535, .0437, .0390, .0305, .0205, .0217,
  1284. .0110, .0100, .0060, .0020
  1285. };
  1286. /* 7th spectral band of enhanced thematic mapper plus */
  1287. static const float sr6[147] = {
  1288. .0020, .0020, .0120, .0085, .0090, .0177, .0170, .0313,
  1289. .0370, .0458, .0580, .0762, .0880, .1097, .1490, .1960,
  1290. .2420, .3030, .3670, .4368, .5190, .6100, .6765, .7182,
  1291. .7560, .7738, .7840, .7755, .7890, .7817, .7780, .7665,
  1292. .7615, .7680, .7750, .7690, .7880, .8085, .7940, .8230,
  1293. .8115, .8195, .8365, .8370, .8360, .8513, .8585, .8553,
  1294. .8710, .8735, .8750, .8590, .8715, .8593, .8720, .8625,
  1295. .8650, .8680, .8765, .8730, .8690, .8760, .8680, .8793,
  1296. .8735, .8760, .8800, .8745, .8700, .8578, .8630, .8585,
  1297. .8440, .8585, .8545, .8625, .8680, .8560, .8470, .8613,
  1298. .8510, .8520, .8380, .8465, .8403, .8305, .8355, .8382,
  1299. .8220, .8380, .8385, .8425, .8535, .8623, .8730, .8680,
  1300. .8790, .8908, .8980, .9195, .9200, .9263, .9275, .9340,
  1301. .9360, .9533, .9540, .9518, .9600, .9728, .9850, .9720,
  1302. .9700, .9938, .9895, .9748,1.0000, .9912, .9680, .9658,
  1303. .9555, .9295, .9290, .9255, .9030, .9235, .9290, .9285,
  1304. .9200, .8533, .7750, .6587, .5315, .4035, .2750, .2175,
  1305. .1310, .1035, .0750, .0518, .0290, .0280, .0135, .0193,
  1306. .0130, .0065, .0150
  1307. };
  1308. /* 8th spectral band of enhanced thematic mapper plus (Pan) */
  1309. static const float sr7[164] = {
  1310. .0028, .0175, .0563, .1500, .3285, .5015, .5845, .5990,
  1311. .6018, .6095, .6143, .6100, .6035, .6035, .6118, .6270,
  1312. .6385, .6445, .6438, .6320, .6260, .6245, .6320, .6420,
  1313. .6593, .6775, .6898, .6970, .7005, .7050, .7110, .7130,
  1314. .7165, .7180, .7120, .7070, .7040, .7030, .7148, .7300,
  1315. .7440, .7535, .7615, .7640, .7533, .7450, .7353, .7290,
  1316. .7285, .7310, .7328, .7340, .7435, .7495, .7540, .7580,
  1317. .7618, .7680, .7720, .7790, .7815, .7850, .7900, .7930,
  1318. .7918, .7915, .7950, .7980, .8018, .8060, .8133, .8200,
  1319. .8275, .8315, .8370, .8420, .8485, .8545, .8605, .8680,
  1320. .8723, .8795, .8853, .8920, .8945, .8960, .8945, .8940,
  1321. .8943, .8955, .8975, .9000, .9033, .9035, .9023, .9000,
  1322. .8968, .8935, .8828, .8790, .8783, .8730, .8760, .8800,
  1323. .8813, .8865, .8910, .8930, .9035, .9105, .9183, .9200,
  1324. .9175, .9160, .9183, .9180, .9168, .9155, .9173, .9270,
  1325. .9290, .9375, .9497, .9570, .9638, .9695, .9715, .9770,
  1326. .9795, .9840, .9908, .9970, .9985, .9980, .9953, .9940,
  1327. .9920, .9930, .9925, .9870, .9755, .9650, .9583, .9490,
  1328. .9348, .9240, .9133, .9070, .9053, .9085, .9193, .9400,
  1329. .9658, .9780, .9625, .8950, .7520, .5715, .3962, .2580,
  1330. .1675, .1080, .0687, .0440
  1331. };
  1332. static const float wli[7] = { 0.4350, 0.5000, 0.6150, 0.7400, 1.5050, 2.0150, 0.5025 };
  1333. static const float wls[7] = { 0.5200, 0.6225, 0.7025, 0.9125, 1.7925, 2.3800, 0.9100 };
  1334. ffu.wlinf = wli[iwa-1];
  1335. ffu.wlsup = wls[iwa-1];
  1336. int i;
  1337. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  1338. switch(iwa)
  1339. {
  1340. case 1: for(i = 0; i < 35; i++) ffu.s[74+i] = sr1[i];
  1341. break;
  1342. case 2: for(i = 0; i < 50; i++) ffu.s[100+i] = sr2[i];
  1343. break;
  1344. case 3: for(i = 0; i < 36; i++) ffu.s[146+i] = sr3[i];
  1345. break;
  1346. case 4: for(i = 0; i < 70; i++) ffu.s[196+i] = sr4[i];
  1347. break;
  1348. case 5: for(i = 0; i < 116; i++) ffu.s[502+i] = sr5[i];
  1349. break;
  1350. case 6: for(i = 0; i < 147; i++) ffu.s[706+i] = sr6[i];
  1351. break;
  1352. case 7: for(i = 0; i < 164; i++) ffu.s[101+i] = sr7[i];
  1353. }
  1354. }
  1355. float IWave::solirr(const float wl) const
  1356. {
  1357. /* si (in w/m2/micron) contains the values of the solar
  1358. irradiance between 0.25 and 4.0 microns, by step of 0.0025 m.
  1359. the value of the total irradiance is 1372 w/m2 on the whole
  1360. spectrum (1358 w/m2 between 0.25 and 4.0 microns) */
  1361. static const float si[1501] = {
  1362. 69.30, 77.65, 86.00, 100.06, 114.12, 137.06, 160.00,
  1363. 169.52, 179.04, 178.02, 177.00, 193.69, 210.38, 241.69,
  1364. 273.00, 318.42, 363.84, 434.42, 505.00, 531.50, 558.00,
  1365. 547.50, 537.00, 559.02, 581.03, 619.52, 658.00, 694.39,
  1366. 730.78, 774.39, 817.99, 871.99, 925.99, 912.04, 898.09,
  1367. 920.69, 943.29, 925.99, 908.69, 936.09, 963.49, 994.94,
  1368. 1026.39, 980.74, 935.09,1036.29,1137.49,1163.74,1189.99,
  1369. 1109.34,1028.69,1088.99,1149.29,1033.69, 918.09,1031.89,
  1370. 1145.69,1035.09, 924.49,1269.29,1614.09,1631.09,1648.09,
  1371. 1677.19,1706.29,1744.89,1783.49,1750.19,1716.89,1705.19,
  1372. 1693.49,1597.69,1501.89,1630.99,1760.09,1775.24,1790.39,
  1373. 1859.94,1929.49,1993.44,2057.39,2039.23,2021.08,2030.73,
  1374. 2040.38,2026.53,2012.68,1999.53,1986.38,2002.88,2019.38,
  1375. 2038.09,2056.79,1967.74,1878.68,1905.83,1932.98,1953.58,
  1376. 1974.18,1935.68,1897.19,1916.78,1936.38,1937.23,1938.09,
  1377. 1881.44,1824.79,1814.09,1803.39,1832.24,1861.09,1885.93,
  1378. 1910.78,1904.68,1898.58,1875.73,1852.88,1865.64,1878.39,
  1379. 1874.74,1871.09,1872.44,1873.79,1850.39,1826.99,1837.04,
  1380. 1847.09,1841.18,1835.28,1849.48,1863.69,1851.03,1838.38,
  1381. 1840.73,1843.08,1802.83,1762.58,1778.78,1794.99,1777.48,
  1382. 1759.98,1764.73,1769.49,1753.48,1737.48,1713.14,1688.80,
  1383. 1702.88,1716.97,1696.07,1675.17,1672.03,1668.89,1663.56,
  1384. 1658.23,1647.75,1637.27,1630.02,1622.77,1606.06,1589.36,
  1385. 1552.29,1515.22,1528.91,1542.60,1548.90,1555.21,1544.41,
  1386. 1533.62,1525.24,1516.86,1507.92,1498.98,1484.07,1469.17,
  1387. 1464.28,1459.39,1448.73,1438.08,1423.16,1408.24,1407.53,
  1388. 1406.82,1397.82,1388.82,1378.51,1368.21,1352.13,1336.05,
  1389. 1343.88,1351.71,1339.60,1327.50,1320.72,1313.94,1294.94,
  1390. 1275.94,1280.92,1285.90,1278.04,1270.19,1263.68,1257.18,
  1391. 1249.80,1242.41,1231.30,1220.19,1212.14,1204.10,1201.69,
  1392. 1199.29,1194.78,1190.27,1185.47,1180.68,1174.38,1168.09,
  1393. 1156.17,1144.26,1143.46,1142.67,1132.95,1123.23,1116.71,
  1394. 1110.19,1110.89,1111.59,1094.80,1078.01,1077.75,1077.49,
  1395. 1073.89,1070.29,1058.71,1047.13,1045.66,1044.20,1037.03,
  1396. 1029.86,1010.40, 990.94, 966.91, 942.89, 972.87,1002.86,
  1397. 978.93, 955.00, 960.95, 966.91, 983.31, 999.71, 991.91,
  1398. 984.11, 979.05, 973.99, 968.79, 963.60, 958.23, 952.87,
  1399. 947.93, 942.99, 937.99, 933.00, 928.00, 923.00, 918.18,
  1400. 913.37, 908.74, 904.11, 899.05, 893.99, 889.18, 884.37,
  1401. 879.74, 875.12, 870.24, 865.36, 860.94, 856.53, 852.02,
  1402. 847.50, 843.00, 838.50, 833.99, 829.49, 824.98, 820.48,
  1403. 815.99, 811.50, 806.99, 802.49, 798.17, 793.86, 789.74,
  1404. 785.63, 781.25, 776.87, 772.92, 768.98, 764.80, 760.63,
  1405. 756.06, 751.49, 746.99, 742.49, 738.18, 733.88, 729.76,
  1406. 725.63, 721.24, 716.86, 712.92, 708.99, 704.81, 700.63,
  1407. 696.25, 691.87, 687.94, 684.01, 680.01, 676.00, 671.80,
  1408. 667.61, 663.23, 658.86, 655.32, 651.77, 649.07, 646.37,
  1409. 643.74, 641.11, 638.05, 634.99, 632.18, 629.37, 626.74,
  1410. 624.12, 621.06, 618.00, 615.18, 612.37, 609.92, 607.48,
  1411. 604.79, 602.11, 599.24, 596.38, 593.93, 591.48, 588.79,
  1412. 586.11, 583.25, 580.40, 577.94, 575.48, 572.99, 570.51,
  1413. 568.00, 565.49, 562.98, 560.47, 557.98, 555.50, 553.01,
  1414. 550.51, 548.00, 545.49, 542.98, 540.48, 537.98, 535.49,
  1415. 533.19, 530.90, 528.94, 526.99, 524.80, 522.62, 520.24,
  1416. 517.87, 515.44, 513.01, 509.59, 506.17, 502.89, 499.62,
  1417. 496.35, 493.09, 489.81, 486.54, 483.27, 480.01, 476.73,
  1418. 473.46, 470.19, 466.92, 463.64, 460.37, 457.10, 453.84,
  1419. 450.57, 447.30, 444.03, 440.76, 437.48, 434.21, 430.94,
  1420. 427.67, 424.40, 421.13, 417.86, 414.59, 411.32, 408.05,
  1421. 404.78, 401.51, 398.24, 394.97, 391.70, 388.43, 392.57,
  1422. 396.71, 401.92, 407.14, 405.32, 403.50, 401.67, 399.84,
  1423. 398.02, 396.21, 394.37, 392.54, 390.72, 388.90, 387.06,
  1424. 385.23, 383.42, 381.60, 379.77, 377.95, 376.12, 374.30,
  1425. 372.48, 370.66, 368.82, 366.99, 365.17, 363.35, 361.52,
  1426. 359.69, 357.87, 356.05, 354.22, 352.39, 350.57, 348.75,
  1427. 346.92, 345.10, 343.27, 341.45, 341.84, 342.24, 342.95,
  1428. 343.66, 342.27, 340.89, 339.49, 338.09, 336.69, 335.30,
  1429. 333.91, 332.53, 331.13, 329.73, 328.34, 326.96, 325.56,
  1430. 324.16, 322.77, 321.39, 319.99, 318.59, 317.20, 315.82,
  1431. 314.42, 313.03, 311.63, 310.24, 308.85, 307.46, 306.06,
  1432. 304.66, 303.28, 301.90, 300.50, 299.10, 297.71, 296.32,
  1433. 294.93, 293.54, 293.41, 293.28, 293.35, 293.42, 292.26,
  1434. 291.10, 289.97, 288.84, 287.69, 286.54, 285.39, 284.25,
  1435. 283.10, 281.96, 280.81, 279.67, 278.52, 277.38, 276.23,
  1436. 275.08, 273.94, 272.80, 271.65, 270.51, 269.36, 268.22,
  1437. 267.07, 265.93, 264.78, 263.64, 262.49, 261.34, 260.20,
  1438. 259.06, 257.91, 256.77, 255.62, 254.47, 253.33, 252.20,
  1439. 251.16, 250.13, 249.11, 248.09, 246.97, 245.86, 244.74,
  1440. 243.61, 242.49, 241.37, 240.24, 239.12, 238.00, 236.89,
  1441. 235.76, 234.64, 233.51, 232.38, 231.26, 230.13, 229.01,
  1442. 227.90, 226.77, 225.65, 224.53, 223.42, 222.29, 221.16,
  1443. 220.04, 218.92, 217.80, 216.68, 215.55, 214.43, 213.30,
  1444. 212.18, 211.06, 209.94, 208.82, 207.69, 206.99, 206.29,
  1445. 205.65, 205.02, 203.98, 202.95, 201.90, 200.85, 199.81,
  1446. 198.78, 197.74, 196.70, 195.65, 194.61, 193.57, 192.54,
  1447. 191.50, 190.47, 189.42, 188.37, 187.33, 186.30, 185.26,
  1448. 184.22, 183.18, 182.14, 181.10, 180.06, 179.02, 177.98,
  1449. 176.93, 175.89, 174.86, 173.83, 172.78, 171.73, 170.70,
  1450. 169.67, 168.62, 167.57, 167.59, 167.60, 167.76, 167.93,
  1451. 167.09, 166.26, 165.42, 164.58, 163.75, 162.92, 162.08,
  1452. 161.25, 160.41, 159.58, 158.74, 157.91, 157.07, 156.24,
  1453. 155.40, 154.57, 153.73, 152.90, 152.06, 151.23, 150.39,
  1454. 149.56, 148.72, 147.89, 147.06, 146.23, 145.39, 144.55,
  1455. 143.71, 142.88, 142.05, 141.22, 140.38, 139.54, 138.70,
  1456. 137.86, 137.99, 138.11, 138.36, 138.60, 137.94, 137.29,
  1457. 136.64, 136.00, 135.35, 134.71, 134.05, 133.39, 132.74,
  1458. 132.09, 131.45, 130.81, 130.15, 129.49, 128.84, 128.20,
  1459. 127.55, 126.90, 126.25, 125.60, 124.94, 124.29, 123.64,
  1460. 123.00, 122.35, 121.70, 121.05, 120.40, 119.74, 119.09,
  1461. 118.45, 117.81, 117.15, 116.50, 115.85, 115.19, 115.25,
  1462. 115.31, 115.46, 115.62, 115.11, 114.60, 114.09, 113.58,
  1463. 113.06, 112.54, 112.03, 111.53, 111.01, 110.50, 109.99,
  1464. 109.47, 108.95, 108.44, 107.93, 107.42, 106.92, 106.42,
  1465. 105.89, 105.37, 104.85, 104.34, 103.83, 103.33, 102.81,
  1466. 102.29, 101.79, 101.29, 100.77, 100.25, 99.74, 99.22,
  1467. 98.71, 98.20, 97.69, 97.18, 97.12, 97.07, 97.09,
  1468. 97.11, 96.68, 96.26, 95.84, 95.42, 94.99, 94.56,
  1469. 94.14, 93.72, 93.31, 92.89, 92.46, 92.03, 91.61,
  1470. 91.19, 90.76, 90.34, 89.92, 89.49, 89.07, 88.66,
  1471. 88.24, 87.81, 87.39, 86.97, 86.55, 86.12, 85.69,
  1472. 85.26, 84.85, 84.43, 84.01, 83.59, 83.17, 82.75,
  1473. 82.32, 81.89, 81.89, 81.89, 81.95, 82.02, 81.68,
  1474. 81.35, 81.00, 80.65, 80.32, 79.99, 79.64, 79.30,
  1475. 78.96, 78.61, 78.27, 77.94, 77.60, 77.26, 76.91,
  1476. 76.57, 76.24, 75.90, 75.56, 75.22, 74.88, 74.54,
  1477. 74.20, 73.86, 73.52, 73.18, 72.84, 72.50, 72.16,
  1478. 71.82, 71.48, 71.14, 70.80, 70.47, 70.13, 69.79,
  1479. 69.76, 69.73, 69.76, 69.80, 69.52, 69.24, 68.96,
  1480. 68.68, 68.41, 68.14, 67.85, 67.57, 67.29, 67.02,
  1481. 66.75, 66.48, 66.19, 65.90, 65.63, 65.36, 65.08,
  1482. 64.80, 64.53, 64.25, 63.97, 63.69, 63.41, 63.14,
  1483. 62.85, 62.57, 62.30, 62.03, 61.75, 61.47, 61.19,
  1484. 60.92, 60.64, 60.36, 60.08, 59.81, 59.80, 59.80,
  1485. 59.82, 59.85, 59.63, 59.40, 59.17, 58.95, 58.73,
  1486. 58.50, 58.28, 58.06, 57.83, 57.60, 57.37, 57.15,
  1487. 56.93, 56.70, 56.48, 56.26, 56.03, 55.79, 55.57,
  1488. 55.36, 55.13, 54.90, 54.66, 54.43, 54.22, 54.00,
  1489. 53.77, 53.55, 53.32, 53.09, 52.87, 52.65, 52.43,
  1490. 52.20, 51.97, 51.75, 51.72, 51.68, 51.67, 51.67,
  1491. 51.48, 51.30, 51.11, 50.92, 50.73, 50.55, 50.37,
  1492. 50.18, 49.98, 49.79, 49.61, 49.43, 49.23, 49.04,
  1493. 48.85, 48.67, 48.48, 48.30, 48.12, 47.93, 47.73,
  1494. 47.54, 47.36, 47.18, 46.98, 46.79, 46.60, 46.42,
  1495. 46.24, 46.06, 45.87, 45.67, 45.48, 45.30, 45.12,
  1496. 44.93, 44.87, 44.82, 44.80, 44.79, 44.62, 44.45,
  1497. 44.29, 44.14, 43.98, 43.83, 43.66, 43.49, 43.34,
  1498. 43.18, 43.02, 42.86, 42.70, 42.55, 42.38, 42.21,
  1499. 42.06, 41.90, 41.74, 41.58, 41.42, 41.26, 41.10,
  1500. 40.94, 40.78, 40.62, 40.46, 40.31, 40.14, 39.97,
  1501. 39.81, 39.66, 39.50, 39.34, 39.18, 39.03, 38.99,
  1502. 38.96, 38.94, 38.92, 38.79, 38.66, 38.52, 38.38,
  1503. 38.25, 38.12, 37.99, 37.86, 37.72, 37.58, 37.44,
  1504. 37.30, 37.17, 37.05, 36.91, 36.77, 36.64, 36.50,
  1505. 36.36, 36.23, 36.09, 35.96, 35.82, 35.69, 35.55,
  1506. 35.42, 35.28, 35.15, 35.01, 34.88, 34.75, 34.61,
  1507. 34.47, 34.34, 34.20, 34.07, 34.05, 34.03, 34.03,
  1508. 34.03, 33.91, 33.79, 33.68, 33.57, 33.46, 33.35,
  1509. 33.23, 33.12, 33.01, 32.90, 32.78, 32.67, 32.55,
  1510. 32.44, 32.33, 32.23, 32.11, 32.00, 31.89, 31.77,
  1511. 31.66, 31.55, 31.43, 31.31, 31.20, 31.10, 30.99,
  1512. 30.87, 30.76, 30.66, 30.54, 30.42, 30.31, 30.20,
  1513. 30.08, 29.97, 29.93, 29.90, 29.88, 29.87, 29.76,
  1514. 29.66, 29.56, 29.46, 29.36, 29.27, 29.17, 29.08,
  1515. 28.98, 28.88, 28.77, 28.67, 28.58, 28.49, 28.39,
  1516. 28.30, 28.20, 28.10, 28.00, 27.91, 27.81, 27.71,
  1517. 27.61, 27.52, 27.41, 27.31, 27.21, 27.12, 27.03,
  1518. 26.93, 26.83, 26.74, 26.64, 26.54, 26.44, 26.35,
  1519. 26.33, 26.31, 26.29, 26.28, 26.20, 26.12, 26.04,
  1520. 25.95, 25.87, 25.79, 25.71, 25.64, 25.54, 25.45,
  1521. 25.37, 25.30, 25.21, 25.12, 25.05, 24.98, 24.89,
  1522. 24.80, 24.71, 24.63, 24.55, 24.47, 24.39, 24.31,
  1523. 24.22, 24.14, 24.05, 23.97, 23.89, 23.81, 23.73,
  1524. 23.66, 23.56, 23.47, 23.39, 23.31, 23.28, 23.26,
  1525. 23.23, 23.21, 23.13, 23.06, 22.99, 22.92, 22.84,
  1526. 22.76, 22.69, 22.63, 22.55, 22.47, 22.41, 22.35,
  1527. 22.27, 22.19, 22.11, 22.04, 21.97, 21.90, 21.83,
  1528. 21.76, 21.68, 21.60, 21.53, 21.47, 21.39, 21.31,
  1529. 21.24, 21.18, 21.11, 21.03, 20.96, 20.89, 20.81,
  1530. 20.73, 20.66, 20.60, 20.57, 20.55, 20.54, 20.53,
  1531. 20.46, 20.40, 20.34, 20.28, 20.21, 20.14, 20.08,
  1532. 20.03, 19.96, 19.90, 19.83, 19.77, 19.71, 19.65,
  1533. 19.59, 19.53, 19.46, 19.39, 19.33, 19.27, 19.21,
  1534. 19.15, 19.08, 19.02, 18.96, 18.90, 18.84, 18.78,
  1535. 18.71, 18.64, 18.58, 18.53, 18.46, 18.40, 18.33,
  1536. 18.27, 18.26, 18.25, 18.24, 18.24, 18.19, 18.14,
  1537. 18.08, 18.03, 17.98, 17.93, 17.88, 17.83, 17.77,
  1538. 17.71, 17.66, 17.62, 17.56, 17.50, 17.45, 17.41,
  1539. 17.35, 17.29, 17.25, 17.21, 17.14, 17.08, 17.04,
  1540. 17.00, 16.93, 16.87, 16.83, 16.79, 16.72, 16.66,
  1541. 16.61, 16.57, 16.51, 16.46, 16.41, 16.36, 16.34,
  1542. 16.33, 16.31, 16.30, 16.26, 16.22, 16.17, 16.13,
  1543. 16.08, 16.04, 16.00, 15.96, 15.90, 15.84, 15.81,
  1544. 15.78, 15.73, 15.68, 15.63, 15.59, 15.55, 15.50,
  1545. 15.45, 15.40, 15.36, 15.32, 15.28, 15.24, 15.18,
  1546. 15.13, 15.09, 15.05, 15.01, 14.96, 14.91, 14.87,
  1547. 14.82, 14.78, 14.73, 14.69, 14.66, 14.64, 14.64,
  1548. 14.63, 14.59, 14.55, 14.50, 14.45, 14.41, 14.38,
  1549. 14.35, 14.32, 14.26, 14.21, 14.18, 14.15, 14.10,
  1550. 14.05, 14.01, 13.98, 13.94, 13.91, 13.86, 13.82,
  1551. 13.78, 13.74, 13.70, 13.67, 13.62, 13.58, 13.54,
  1552. 13.50, 13.46, 13.43, 13.39, 13.35, 13.30, 13.25,
  1553. 13.22, 13.18, 13.17, 13.16, 13.14, 13.12, 13.09,
  1554. 13.06, 13.03, 13.00, 12.96, 12.92, 12.89, 12.85,
  1555. 12.81, 12.78, 12.74, 12.70, 12.67, 12.65, 12.61,
  1556. 12.57, 12.53, 12.50, 12.46, 12.43, 12.39, 12.36,
  1557. 12.32, 12.28, 12.25, 12.22, 12.18, 12.15, 12.11,
  1558. 12.07, 12.04, 12.01, 11.97, 11.94, 11.90, 11.86,
  1559. 11.85, 11.85, 11.85, 11.84, 11.81, 11.78, 11.75,
  1560. 11.72, 11.69, 11.66, 11.63, 11.60, 11.58, 11.55,
  1561. 11.51, 11.47, 11.45, 11.42, 11.39, 11.36, 11.33,
  1562. 11.30, 11.27, 11.24, 11.21, 11.18, 11.15, 11.12,
  1563. 11.09, 11.06, 11.03, 11.00, 10.97, 10.94, 10.91,
  1564. 10.89, 10.85, 10.82, 10.78, 10.75, 10.73, 10.72,
  1565. 10.71, 10.70, 10.67, 10.64, 10.62, 10.59, 10.55,
  1566. 10.52, 10.50, 10.47, 10.44, 10.42, 10.39, 10.37,
  1567. 10.34, 10.31, 10.28, 10.25, 10.22, 10.20, 10.17,
  1568. 10.15, 10.12, 10.10, 10.06, 10.03, 10.00, 9.98,
  1569. 9.95, 9.92, 9.89, 9.86, 9.84, 9.82, 9.79,
  1570. 9.75, 9.73, 9.71, 9.70, 9.70, 9.70, 9.70,
  1571. 9.67, 9.63, 9.61, 9.59, 9.58, 9.56, 9.53,
  1572. 9.50, 9.48, 9.45, 9.43, 9.41, 9.39, 9.36,
  1573. 9.34, 9.32, 9.30, 9.27, 9.24, 9.22, 9.20,
  1574. 9.18, 9.15, 9.13, 9.11, 9.08, 9.06, 9.05,
  1575. 9.02, 8.99, 8.96, 8.94, 8.92, 8.90, 8.87,
  1576. 8.85, 8.83, 8.81
  1577. };
  1578. float pas = 0.0025;
  1579. int iwl = (int)((wl - 0.250) / pas + 1.5);
  1580. if(iwl >= 0) return si[iwl-1];
  1581. cout << " wavelength less than 0.25 micron: " << endl << " let's take s(l)=s(0.25)" << endl;
  1582. return si[0];
  1583. }
  1584. void IWave::irs_1c_liss(int iwa)
  1585. {
  1586. /* 2nd spectral band of IRS 1C LISS III */
  1587. static const float sr2[61] = {
  1588. .0006, .0009, .0012, .0020, .0036, .0080, .0216, .0655,
  1589. .1690, .3080, .4280, .5600, .7010, .7600, .7640, .7690,
  1590. .7960, .8400, .8760, .8820, .8670, .8560, .8620, .8890,
  1591. .9240, .9480, .9590, .9540, .9460, .9490, .9660, .9860,
  1592. 1.0000,.9960, .9740, .9490, .9340, .9340, .9340, .9210,
  1593. .8820, .8300, .7880, .7770, .7670, .6640, .4190, .1980,
  1594. .0882, .0396, .0192, .0107, .0066, .0041, .0026, .0018,
  1595. .0012, .0010, .0007, .0006
  1596. };
  1597. /* 3rd spectral band of IRS 1C LISS III */
  1598. static const float sr3[45] = {
  1599. .0041, .0110, .0357, .1310, .4020, .7200, .8300, .8700,
  1600. .8980, .9120, .9230, .9300, .9320, .9310, .9270, .9300,
  1601. .9390, .9510, .9580, .9600, .9630, .9700, .9890,1.0000,
  1602. .9880, .9390, .8740, .8220, .8040, .8350, .9000, .9620,
  1603. .9730, .9410, .9170, .8790, .6460, .2940, .1050, .0390,
  1604. .0105, .0040, .0020, .0010, .0000
  1605. };
  1606. /* 4th spectral band of IRS 1C LISS III */
  1607. static const float sr4[65] = {
  1608. .0090, .0149, .0244, .0400, .0649, .1020, .1520, .2170,
  1609. .2940, .3820, .4830, .6120, .7270, .8320, .9180, .9760,
  1610. 1.0000,.9970, .9800, .9590, .9410, .9330, .9330, .9390,
  1611. .9480, .9550, .9620, .9580, .9500, .9380, .9270, .9150,
  1612. .9100, .9050, .9050, .9020, .8970, .8900, .8830, .8740,
  1613. .8690, .8700, .8720, .8740, .8680, .8490, .8150, .7720,
  1614. .7310, .6990, .6840, .6800, .6640, .5750, .4060, .2280,
  1615. .1240, .0641, .0356, .0206, .0126, .0080, .0052, .0035,
  1616. .0025
  1617. };
  1618. /* 5th spectral band of IRS 1C LISS III */
  1619. static const float sr5[155] = {
  1620. .0000, .0000, .0000, .0000, .0001, .0001, .0001, .0001,
  1621. .0000, .0001, .0001, .0021, .0001, .0000, .0001, .0001,
  1622. .0001, .0001, .0001, .0002, .0002, .0002, .0001, .0005,
  1623. .0004, .0006, .0007, .0010, .0011, .0015, .0020, .0024,
  1624. .0030, .0039, .0051, .0068, .0088, .0114, .0153, .0206,
  1625. .0281, .0372, .0515, .0708, .0983, .1370, .1870, .2580,
  1626. .3470, .4410, .5340, .6190, .6920, .7510, .7940, .8270,
  1627. .8500, .8680, .8800, .8920, .9010, .9090, .9170, .9250,
  1628. .9310, .9400, .9490, .9590, .9700, .9760, .9850, .9920,
  1629. .9960,1.0000,1.0000, .9960, .9910, .9860, .9790, .9730,
  1630. .9680, .9660, .9620, .9640, .9670, .9700, .9750, .9810,
  1631. .9850, .9880, .9840, .9770, .9690, .9560, .9400, .9240,
  1632. .9080, .8880, .8710, .8570, .8410, .8300, .8220, .8180,
  1633. .8170, .8220, .8290, .8370, .8460, .8550, .8450, .8310,
  1634. .8110, .7870, .7580, .7180, .6780, .6380, .5990, .5640,
  1635. .5280, .4930, .4590, .4210, .3770, .3320, .2770, .2160,
  1636. .1580, .1110, .0772, .0528, .0357, .0242, .0165, .0117,
  1637. .0083, .0059, .0042, .0031, .0023, .0017, .0013, .0009,
  1638. .0007, .0005, .0004, .0002, .0002, .0001, .0001, .0001,
  1639. .0001, .0000, .0000
  1640. };
  1641. static const float wli[4] = { 0.502, 0.612, 0.752, 1.452 };
  1642. static const float wls[4] = { 0.620, 0.700, 0.880, 1.760 };
  1643. ffu.wlinf = wli[iwa-1];
  1644. ffu.wlsup = wls[iwa-1];
  1645. int i;
  1646. for(i = 0; i < 1501; i++) ffu.s[i] = 0;
  1647. switch(iwa)
  1648. {
  1649. case 1: for(i = 0; i < 61; i++) ffu.s[101+i] = sr2[i];
  1650. break;
  1651. case 2: for(i = 0; i < 45; i++) ffu.s[145+i] = sr3[i];
  1652. break;
  1653. case 3: for(i = 0; i < 65; i++) ffu.s[201+i] = sr4[i];
  1654. break;
  1655. case 4: for(i = 0; i < 155; i++) ffu.s[481+i] = sr5[i];
  1656. break;
  1657. }
  1658. }
  1659. float IWave::equivwl() const
  1660. {
  1661. float seb = 0;
  1662. float wlwave = 0;
  1663. for(int i = iinf; i <= isup; i++)
  1664. {
  1665. float sbor = ffu.s[i];
  1666. if(i == iinf || i == isup) sbor *= 0.5;
  1667. float wl = (float)(0.25 + i * step);
  1668. float swl = solirr(wl);
  1669. float coef = sbor * step * swl;
  1670. seb += coef;
  1671. wlwave += wl * coef;
  1672. }
  1673. return wlwave/seb;
  1674. }
  1675. void IWave::parse()
  1676. {
  1677. iinf = 0;
  1678. isup = 1500;
  1679. int i;
  1680. for(i = 0; i <= isup; i++) ffu.s[i] = 1;
  1681. cin >> iwave;
  1682. cin.ignore(numeric_limits<int>::max(),'\n');
  1683. if(iwave == 0 || iwave == -2)
  1684. {
  1685. cin >> ffu.wlinf;
  1686. cin >> ffu.wlsup;
  1687. cin.ignore(numeric_limits<int>::max(),'\n');
  1688. }
  1689. else if(iwave < 0) /* excludes -2 */
  1690. {
  1691. cin >> wl;
  1692. cin.ignore(numeric_limits<int>::max(),'\n');
  1693. ffu.wlinf = wl;
  1694. ffu.wlsup = wl;
  1695. }
  1696. else
  1697. {
  1698. /* da big switch */
  1699. if(iwave == 1)
  1700. {
  1701. cin >> ffu.wlinf;
  1702. cin >> ffu.wlsup;
  1703. cin.ignore(numeric_limits<int>::max(),'\n');
  1704. /* moved rest further on */
  1705. }
  1706. else if(iwave == 2) meteo();
  1707. else if(iwave == 3) goes_east();
  1708. else if(iwave == 4) goes_west();
  1709. else if(iwave <= 16) avhrr(iwave - 4);
  1710. else if(iwave <= 24) hrv(iwave - 16);
  1711. else if(iwave <= 30) tm(iwave - 24);
  1712. else if(iwave <= 34) mss(iwave - 30);
  1713. else if(iwave <= 41) mas(iwave - 34);
  1714. else if(iwave <= 48) modis(iwave - 41);
  1715. else if(iwave <= 52) avhrr(iwave - 36);
  1716. else if(iwave <= 60) polder(iwave - 52);
  1717. else if(iwave <= 67) etmplus(iwave - 60);
  1718. else if(iwave <= 71) irs_1c_liss(iwave - 67);
  1719. else G_warning(_("Unsupported iwave value: %d"), iwave);
  1720. }
  1721. iinf = (int)((ffu.wlinf - 0.25f) / 0.0025f + 1.5f) - 1; /* remember indexing*/
  1722. isup = (int)((ffu.wlsup - 0.25f) / 0.0025f + 1.5f) - 1; /* "*/
  1723. if(iwave == 1) /* moved here to avoid unnecessery gotos */
  1724. {
  1725. for(int i = iinf; i <= isup; i++) cin >> ffu.s[i];
  1726. cin.ignore(numeric_limits<int>::max(),'\n');
  1727. }
  1728. }
  1729. /* --- spectral condition ---- */
  1730. void IWave::print()
  1731. {
  1732. static const string nsat[72] = {
  1733. string(" constant "), string(" user s "),
  1734. string(" meteosat "), string(" goes east "), string(" goes west "),
  1735. string(" avhrr 1 (noaa6) "), string(" avhrr 2 (noaa6) "),
  1736. string(" avhrr 1 (noaa7) "), string(" avhrr 2 (noaa7) "),
  1737. string(" avhrr 1 (noaa8) "), string(" avhrr 2 (noaa8) "),
  1738. string(" avhrr 1 (noaa9) "), string(" avhrr 2 (noaa9) "),
  1739. string(" avhrr 1 (noaa10)"), string(" avhrr 2 (noaa10)"),
  1740. string(" avhrr 1 (noaa11)"), string(" avhrr 2 (noaa11)"),
  1741. string(" hrv1 1 "), string(" hrv1 2 "), string(" hrv1 3 "),
  1742. string(" hrv1 pan "),
  1743. string(" hrv2 1 "), string(" hrv2 2 "), string(" hrv2 3 "),
  1744. string(" hrv2 pan "),
  1745. string(" tm 1 "), string(" tm 2 "), string(" tm 3 "),
  1746. string(" tm 4 "), string(" tm 5 "), string(" tm 7 "),
  1747. string(" mss 4 "), string(" mss 5 "),
  1748. string(" mss 6 "), string(" mss 7 "),
  1749. string(" mas 1 "), string(" mas 2 "), string(" mas 3 "),
  1750. string(" mas 4 "), string(" mas 5 "), string(" mas 6 "),
  1751. string(" mas 7 "), string(" modis 1 "), string(" modis 2 "),
  1752. string(" modis 3 "), string(" modis 4 "), string(" modis 5 "),
  1753. string(" modis 6 "), string(" modis 7 "),
  1754. string(" avhrr 1 (noaa12)"), string(" avhrr 2 (noaa12)"),
  1755. string(" avhrr 1 (noaa14)"), string(" avhrr 2 (noaa14)"),
  1756. string(" polder 1 "), string(" polder 2 "),
  1757. string(" polder 3 "), string(" polder 4 "), string(" polder 6 "),
  1758. string(" polder 6 "), string(" polder 7 "), string(" polder 8 "),
  1759. string(" etm+ 1 "), string(" etm+ 2 "), string(" etm+ 3 "),
  1760. string(" etm+ 4 "), string(" etm+ 5 "), string(" etm+ 7 "),
  1761. string(" etm+ 8 "),
  1762. string(" liss 2 "), string(" liss 3 "), string(" liss 4 "),
  1763. string(" liss 5 ")
  1764. };
  1765. Output::Begin();
  1766. Output::Repeat(22, ' ');
  1767. Output::Print(" spectral condition ");
  1768. Output::End();
  1769. Output::Begin();
  1770. Output::Repeat(22, ' ');
  1771. Output::Print(" ------------------ ");
  1772. Output::End();
  1773. if(iwave == -2)
  1774. {
  1775. Output::Begin();
  1776. Output::Repeat(10,' ');
  1777. Output::Print(nsat[0]);
  1778. Output::End();
  1779. Output::Begin();
  1780. Output::Repeat(15,' ');
  1781. Output::Print("value of filter function :");
  1782. Output::End();
  1783. Output::Begin();
  1784. Output::Repeat(15,' ');
  1785. ostringstream s;
  1786. s.setf(ios::fixed, ios::floatfield);
  1787. s << setprecision(3);
  1788. s << " wl inf=" << setw(9) << ffu.wlinf << " mic "
  1789. << " wl sup=" << setw(9) << ffu.wlsup << " mic" << ends;
  1790. Output::Print(s.str());
  1791. Output::End();
  1792. }
  1793. else if(iwave == -1)
  1794. {
  1795. Output::Begin();
  1796. Output::Repeat(12,' ');
  1797. ostringstream s;
  1798. s.setf(ios::fixed, ios::floatfield);
  1799. s << setprecision(3);
  1800. s << " monochromatic calculation at wl :" << setw(9) << ffu.wlsup << " micron" << ends;
  1801. Output::Print(s.str());
  1802. Output::End();
  1803. }
  1804. else if(iwave >= 0)
  1805. {
  1806. Output::Begin();
  1807. Output::Repeat(10,' ');
  1808. Output::Print(nsat[iwave]);
  1809. Output::End();
  1810. Output::Begin();
  1811. Output::Repeat(15,' ');
  1812. Output::Print("value of filter function :");
  1813. Output::End();
  1814. Output::Begin();
  1815. Output::Repeat(15,' ');
  1816. ostringstream s;
  1817. s.setf(ios::fixed, ios::floatfield);
  1818. s << setprecision(3);
  1819. s << " wl inf=" << setw(9) << ffu.wlinf << " mic "
  1820. << " wl sup=" << setw(9) << ffu.wlsup << " mic" << ends;
  1821. Output::Print(s.str());
  1822. Output::End();
  1823. }
  1824. }
  1825. IWave IWave::Parse()
  1826. {
  1827. IWave iwave;
  1828. iwave.parse();
  1829. return iwave;
  1830. }