Orfeo Toolbox  3.16
otbPleiadesImageMetadataInterface.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
20 
21 #include <boost/algorithm/string.hpp>
22 #include "otbMacro.h"
23 #include "itkMetaDataObject.h"
24 #include "otbImageKeywordlist.h"
25 #include <boost/lexical_cast.hpp>
26 
27 
28 namespace otb
29 {
30 using boost::lexical_cast;
31 using boost::bad_lexical_cast;
32 
35 {
36 }
37 
38 bool
40 {
41  std::string sensorID = GetSensorID();
42  if (sensorID.find("PHR") != std::string::npos)
43  return true;
44  else
45  return false;
46 }
47 
48 std::string
50 {
51  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
52  if (!this->CanRead())
53  {
54  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
55  }
56 
57  ImageKeywordlistType imageKeywordlist;
58 
60  {
61  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
62  }
63 
64  if (imageKeywordlist.HasKey("support_data.instrument"))
65  {
66  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.instrument");
67  return valueString;
68  }
69 
70  return "";
71 }
72 
73 std::string
75 {
76  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
77  if (!this->CanRead())
78  {
79  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
80  }
81 
82  ImageKeywordlistType imageKeywordlist;
83 
85  {
86  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
87  }
88  if (imageKeywordlist.HasKey("support_data.instrument_index"))
89  {
90  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.instrument_index");
91  return valueString;
92  }
93 
94  return ""; // Invalid value
95 }
96 
99 {
100  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
101  if (!this->CanRead())
102  {
103  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
104  }
105 
106  ImageKeywordlistType imageKeywordlist;
107 
109  {
110  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
111  }
112 
113  std::vector<double> outputValues;
114  if (imageKeywordlist.HasKey("support_data.solar_irradiance"))
115  {
116  std::vector<std::string> outputValuesString;
117  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.solar_irradiance");
118  boost::trim(valueString);
119  boost::split(outputValuesString, valueString, boost::is_any_of(" "));
120  for (unsigned int i = 0; i < outputValuesString.size(); ++i)
121  {
122  outputValues.push_back(atof(outputValuesString[i].c_str()));
123  }
124  }
125 
126  VariableLengthVectorType outputValuesVariableLengthVector;
127  outputValuesVariableLengthVector.SetSize(outputValues.size());
128  outputValuesVariableLengthVector.Fill(0);
129 
130  // Check that values read from metadata is not too far from the standard realistic values
131  // '999' are likely to be dummy values (see Mantis #601)
132  const double defaultRadianceP = 1548.71;
133  // MS, ordered as B0, B1, B2, B3
134  const double defaultRadianceMS[4] =
135  {
136  1915.01,
137  1830.57,
138  1594.06,
139  1060.01
140  };
141  // tolerance threshold
142  double tolerance = 0.05;
143 
144  if (outputValues.size() == 1)
145  {
146  // Pan
147  if (vcl_abs(outputValues[0] - defaultRadianceP) > (tolerance * defaultRadianceP))
148  {
149  outputValuesVariableLengthVector[0] = defaultRadianceP;
150  }
151  else
152  {
153  outputValuesVariableLengthVector[0] = outputValues[0];
154  }
155  }
156  else
157  {
158  // MS
159  for (unsigned int i = 0; i < outputValues.size(); ++i)
160  {
161  int wavelenghPos = this->BandIndexToWavelengthPosition(i);
162  if (vcl_abs(outputValues[wavelenghPos] - defaultRadianceMS[wavelenghPos]) >
163  (tolerance * defaultRadianceMS[wavelenghPos]))
164  {
165  outputValuesVariableLengthVector[i] = defaultRadianceMS[wavelenghPos];
166  }
167  else
168  {
169  outputValuesVariableLengthVector[i] = outputValues[wavelenghPos];
170  }
171  }
172  }
173 
174  return outputValuesVariableLengthVector;
175 }
176 
177 int
179 {
180  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
181  if (!this->CanRead())
182  {
183  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
184  }
185 
186  ImageKeywordlistType imageKeywordlist;
187 
189  {
190  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
191  }
192 
193  if (!imageKeywordlist.HasKey("support_data.image_date"))
194  {
195  return -1;
196  }
197 
198  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
199  std::vector<std::string> outputValues;
200 
201  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
202 
203  int value;
204  try
205  {
206  value = lexical_cast<int> (outputValues[2]);
207  }
208  catch (bad_lexical_cast &)
209  {
210  itkExceptionMacro(<< "Invalid Day");
211  }
212 
213  return value;
214 }
215 
216 int
218 {
219  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
220  if (!this->CanRead())
221  {
222  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
223  }
224 
225  ImageKeywordlistType imageKeywordlist;
226 
228  {
229  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
230  }
231 
232  if (!imageKeywordlist.HasKey("support_data.image_date"))
233  {
234  return -1;
235  }
236 
237  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
238  std::vector<std::string> outputValues;
239  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
240 
241  int value;
242  try
243  {
244  value = lexical_cast<int> (outputValues[1]);
245  }
246  catch (bad_lexical_cast &)
247  {
248  itkExceptionMacro(<< "Invalid Month");
249  }
250  return value;
251 }
252 
253 int
255 {
256  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
257  if (!this->CanRead())
258  {
259  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
260  }
261 
262  ImageKeywordlistType imageKeywordlist;
263 
265  {
266  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
267  }
268 
269  if (!imageKeywordlist.HasKey("support_data.image_date"))
270  {
271  return -1;
272  }
273 
274  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
275  std::vector<std::string> outputValues;
276  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
277 
278  int value;
279  try
280  {
281  value = lexical_cast<int> (outputValues[0]);
282  }
283  catch (bad_lexical_cast &)
284  {
285  itkExceptionMacro(<< "Invalid Year");
286  }
287  return value;
288 }
289 
290 int
292 {
293  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
294  if (!this->CanRead())
295  {
296  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
297  }
298 
299  ImageKeywordlistType imageKeywordlist;
300 
302  {
303  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
304  }
305 
306  if (!imageKeywordlist.HasKey("support_data.image_date"))
307  {
308  return -1;
309  }
310 
311  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
312  std::vector<std::string> outputValues;
313  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
314 
315  int value;
316  try
317  {
318  value = lexical_cast<int> (outputValues[3]);
319  }
320  catch (bad_lexical_cast &)
321  {
322  itkExceptionMacro(<< "Invalid Hour");
323  }
324  return value;
325 }
326 
327 int
329 {
330  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
331  if (!this->CanRead())
332  {
333  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
334  }
335 
336  ImageKeywordlistType imageKeywordlist;
337 
339  {
340  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
341  }
342 
343  if (!imageKeywordlist.HasKey("support_data.image_date"))
344  {
345  return -1;
346  }
347 
348  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
349  std::vector<std::string> outputValues;
350  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
351 
352  int value;
353  try
354  {
355  value = lexical_cast<int> (outputValues[4]);
356  }
357  catch (bad_lexical_cast &)
358  {
359  itkExceptionMacro(<< "Invalid Minute");
360  }
361  return value;
362 }
363 
364 int
366 {
367  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
368  if (!this->CanRead())
369  {
370  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
371  }
372 
373  ImageKeywordlistType imageKeywordlist;
374 
376  {
377  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
378  }
379 
380  if (!imageKeywordlist.HasKey("support_data.production_date"))
381  {
382  return -1;
383  }
384 
385  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
386  std::vector<std::string> outputValues;
387  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
388 
389  int value;
390  try
391  {
392  value = lexical_cast<int> (outputValues[2]);
393  }
394  catch (bad_lexical_cast &)
395  {
396  itkExceptionMacro(<< "Invalid Day");
397  }
398  return value;
399 }
400 
401 int
403 {
404  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
405  if (!this->CanRead())
406  {
407  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
408  }
409 
410  ImageKeywordlistType imageKeywordlist;
411 
413  {
414  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
415  }
416 
417  if (!imageKeywordlist.HasKey("support_data.production_date"))
418  {
419  return -1;
420  }
421 
422  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
423  std::vector<std::string> outputValues;
424  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
425 
426  int value;
427  try
428  {
429  value = lexical_cast<int> (outputValues[1]);
430  }
431  catch (bad_lexical_cast &)
432  {
433  itkExceptionMacro(<< "Invalid Month");
434  }
435  return value;
436 }
437 
438 int
440 {
441  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
442  if (!this->CanRead())
443  {
444  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
445  }
446 
447  ImageKeywordlistType imageKeywordlist;
448 
450  {
451  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
452  }
453 
454  if (!imageKeywordlist.HasKey("support_data.production_date"))
455  {
456  return -1;
457  }
458 
459  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
460  std::vector<std::string> outputValues;
461  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
462 
463  if (outputValues.size() <= 2) itkExceptionMacro(<< "Invalid Year");
464 
465  int value;
466  try
467  {
468  value = lexical_cast<int> (outputValues[0]);
469  }
470  catch (bad_lexical_cast &)
471  {
472  itkExceptionMacro(<< "Invalid Year");
473  }
474  return value;
475 }
476 
480 {
481  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
482  if (!this->CanRead())
483  {
484  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
485  }
486 
487  ImageKeywordlistType imageKeywordlist;
488 
490  {
491  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
492  }
493 
494  std::vector<double> outputValues;
495  if (imageKeywordlist.HasKey("support_data.physical_bias"))
496  {
497  std::vector<std::string> outputValuesString;
498  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.physical_bias");
499  boost::trim(valueString);
500  boost::split(outputValuesString, valueString, boost::is_any_of(" "));
501  for (unsigned int i = 0; i < outputValuesString.size(); ++i)
502  {
503  outputValues.push_back(atof(outputValuesString[i].c_str()));
504  }
505  }
506 
507  VariableLengthVectorType outputValuesVariableLengthVector;
508  outputValuesVariableLengthVector.SetSize(outputValues.size());
509  outputValuesVariableLengthVector.Fill(0);
510 
511  // Use BandIndexToWavelengthPosition because values in keywordlist are sorted by wavelength
512  for (unsigned int i = 0; i < outputValues.size(); ++i)
513  {
514  outputValuesVariableLengthVector[i] = outputValues[this->BandIndexToWavelengthPosition(i)];
515  }
516 
517 
518  return outputValuesVariableLengthVector;
519 }
520 
524 {
525  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
526  if (!this->CanRead())
527  {
528  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
529  }
530 
531  ImageKeywordlistType imageKeywordlist;
532 
534  {
535  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
536  }
537 
538  std::vector<double> outputValues;
539  if (imageKeywordlist.HasKey("support_data.physical_gain"))
540  {
541  std::vector<std::string> outputValuesString;
542  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.physical_gain");
543  boost::trim(valueString);
544  boost::split(outputValuesString, valueString, boost::is_any_of(" "));
545  for (unsigned int i = 0; i < outputValuesString.size(); ++i)
546  {
547  outputValues.push_back(atof(outputValuesString[i].c_str()));
548  }
549  }
550 
551  VariableLengthVectorType outputValuesVariableLengthVector;
552  outputValuesVariableLengthVector.SetSize(outputValues.size());
553  outputValuesVariableLengthVector.Fill(0);
554 
555  // Use BandIndexToWavelengthPosition because values in keywordlist are sorted by wavelength
556  for (unsigned int i = 0; i < outputValues.size(); ++i)
557  {
558  outputValuesVariableLengthVector[i] = outputValues[this->BandIndexToWavelengthPosition(i)];
559  }
560 
561  return outputValuesVariableLengthVector;
562 }
563 
564 double
566 {
567  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
568  if (!this->CanRead())
569  {
570  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
571  }
572 
573  ImageKeywordlistType imageKeywordlist;
574 
576  {
577  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
578  }
579 
580  if (!imageKeywordlist.HasKey("support_data.incident_angle"))
581  {
582  return 0;
583  }
584 
585  // MSD: for the moment take only topCenter value
586  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.incident_angle");
587  double value = atof(valueString.c_str());
588  return value;
589 }
590 
591 double
593 {
594  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
595  if (!this->CanRead())
596  {
597  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
598  }
599 
600  ImageKeywordlistType imageKeywordlist;
601 
603  {
604  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
605  }
606 
607  if (!imageKeywordlist.HasKey("support_data.scene_orientation"))
608  {
609  return 0;
610  }
611 
612  // MSD: for the moment take only topCenter value
613  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation");
614  double satAz = atof(valueString.c_str());
615 
616  return satAz;
617 }
618 
622 {
623  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
624  if (!this->CanRead())
625  {
626  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
627  }
628 
629  ImageKeywordlistType imageKeywordlist;
630 
632  {
633  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
634  }
635 
636  VariableLengthVectorType wavel(1);
637  wavel.Fill(0.);
638 
639  int nbBands = this->GetNumberOfBands();
640  std::string sensorId = this->GetSensorID();
641 
642  // Panchromatic case
643  if (nbBands == 1)
644  {
645  wavel.SetSize(1);
646  wavel.Fill(0.430);
647  }
648  else if (nbBands > 1 && nbBands < 5)
649  {
650  wavel.SetSize(4);
651  wavel[0] = 0.430;
652  wavel[1] = 0.430;
653  wavel[2] = 0.430;
654  wavel[3] = 0.430;
655  }
656  else itkExceptionMacro(<< "Invalid number of bands...");
657 
658  return wavel;
659 }
660 
664 {
665  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
666  if (!this->CanRead())
667  {
668  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
669  }
670 
671  ImageKeywordlistType imageKeywordlist;
672 
674  {
675  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
676  }
677 
678  VariableLengthVectorType wavel(1);
679  wavel.Fill(0.);
680 
681  int nbBands = this->GetNumberOfBands();
682 
683  // Panchromatic case
684  if (nbBands == 1)
685  {
686  wavel.SetSize(1);
687  wavel.Fill(0.95);
688  }
689  else if (nbBands > 1 && nbBands < 5)
690  {
691  wavel.SetSize(4);
692  wavel[0] = 0.95;
693  wavel[1] = 0.95;
694  wavel[2] = 0.95;
695  wavel[3] = 0.95;
696  }
697  else itkExceptionMacro(<< "Invalid number of bands...");
698 
699  return wavel;
700 }
701 
702 // TODO MSD need to update this function
703 // Comment this part as relative response
704 // FIXME check if this is coherent with other sensor
705 unsigned int
707 ::BandIndexToWavelengthPosition(unsigned int i) const
708 {
709  int nbBands = this->GetNumberOfBands();
710  //Panchromatic case
711  if (nbBands == 1)
712  {
713  return 0;
714  }
715  else
716  {
717  otbMsgDevMacro(<< "Pleiades detected: band 0 and 2 inverted");
718  if (i == 0) return 2;
719  if (i == 2) return 0;
720  }
721 
722  return i;
723 }
724 
725 std::vector<std::string>
728 {
729  std::vector<std::string> enhBandNames;
730  std::vector<std::string> rawBandNames = this->Superclass::GetBandName();
731 
732  if(rawBandNames.size())
733  {
734  for (std::vector<std::string>::iterator it = rawBandNames.begin(); it != rawBandNames.end(); ++it)
735  {
736  // Manage Panchro case
737  if ( (rawBandNames.size() == 1) && !(*it).compare("P") )
738  {
739  enhBandNames.push_back("PAN");
740  break;
741  }
742  else if ((rawBandNames.size() != 1) && !(*it).compare("P"))
743  {
744  /* Launch exception situation not valid*/
745  itkExceptionMacro(<< "Invalid Metadata, we cannot provide an consistent name to the band");
746  }
747 
748  // Manage MS case
749  if ( !(*it).compare("B0") )
750  {
751  enhBandNames.push_back("Blue");
752  }
753  else if ( !(*it).compare("B1") )
754  {
755  enhBandNames.push_back("Green");
756  }
757  else if ( !(*it).compare("B2") )
758  {
759  enhBandNames.push_back("Red");
760  }
761  else if ( !(*it).compare("B3") )
762  {
763  enhBandNames.push_back("NIR");
764  }
765  else
766  {
767  enhBandNames.push_back("Unknown");
768  }
769  }
770  }
771 
772  return enhBandNames;
773 
774 }
775 
776 std::vector<unsigned int>
779 {
780  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
781  if (!this->CanRead())
782  {
783  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
784  }
785 
786  ImageKeywordlistType imageKeywordlist;
787 
789  {
790  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
791  }
792 
793  int nbBands = this->GetNumberOfBands();
794 
795  std::string key = "support_data.band_name_list";
796  std::vector<unsigned int> rgb(3);
797 
798  // TODO MSD remove this limitation when we get a real pleiades image
799  // Band order in PHR products seems to be always the same : RGB => keep the flag off
800  bool realProduct = false;
801  if (realProduct)
802  {
803  if (imageKeywordlist.HasKey(key) && (nbBands > 1))
804  {
805  std::string keywordStringBandNameList = imageKeywordlist.GetMetadataByKey(key);
806  std::vector<std::string> bandNameList;
807  boost::trim(keywordStringBandNameList);
808  boost::split(bandNameList, keywordStringBandNameList, boost::is_any_of(" "));
809 
810  for (int i = 0; i < nbBands && i < 3; i++)
811  {
812  size_t found;
813  found = bandNameList[i].find_first_not_of("B");
814  rgb[i] = lexical_cast<int> (bandNameList[i].at(found));
815  }
816  }
817  else
818  {
819  // Default values
820  rgb[0] = 2;
821  rgb[1] = 1;
822  rgb[2] = 0;
823  }
824  }
825  else
826  {
827  // Default values for simulation product
828  rgb[0] = 0;
829  rgb[1] = 1;
830  rgb[2] = 2;
831  }
832 
833  return rgb;
834 }
835 
839 {
840  // TODO MSD what must do this function ???
841  //TODO tabulate spectral responses
842  WavelengthSpectralBandVectorType wavelengthSpectralBand = InternalWavelengthSpectralBandVectorType::New();
843 
844  std::list <std::vector<float> > tmpSpectralBandList;
845 
846  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
847  if (!this->CanRead())
848  {
849  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
850  }
851 
852  ImageKeywordlistType imageKeywordlist;
853 
855  {
856  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
857  }
858 
859  int nbBands = this->GetNumberOfBands();
860  std::string sensorId = this->GetSensorID();
861 
862  // Panchromatic case
863  if (nbBands == 1)
864  {
865  if (sensorId == "PHR 1A")
866  {
867  const float b0[209] =
868  {
869  0.0000000,
870  0.0000000,
871  0.0000000,
872  0.0000000,
873  0.0000000,
874  0.0000000,
875  0.0000000,
876  0.0000000,
877  0.0004358,
878  0.0008051,
879  0.0030464,
880  0.0060688,
881  0.0130170,
882  0.0240166,
883  0.0421673,
884  0.0718226,
885  0.1151660,
886  0.1738520,
887  0.2442960,
888  0.3204090,
889  0.3940400,
890  0.4552560,
891  0.5015220,
892  0.5324310,
893  0.5537040,
894  0.5683830,
895  0.5824280,
896  0.5967100,
897  0.6107110,
898  0.6232080,
899  0.6335930,
900  0.6421600,
901  0.6501020,
902  0.6570500,
903  0.6640260,
904  0.6707420,
905  0.6765340,
906  0.6808170,
907  0.6829760,
908  0.6834310,
909  0.6831800,
910  0.6831390,
911  0.6846760,
912  0.6892820,
913  0.6964400,
914  0.7073100,
915  0.7193370,
916  0.7323050,
917  0.7449550,
918  0.7554270,
919  0.7638770,
920  0.7715940,
921  0.7776340,
922  0.7826480,
923  0.7871060,
924  0.7913600,
925  0.7949010,
926  0.7974290,
927  0.7996850,
928  0.8007000,
929  0.8003370,
930  0.8002560,
931  0.8000160,
932  0.8012780,
933  0.8035920,
934  0.8077100,
935  0.8136680,
936  0.8209800,
937  0.8302930,
938  0.8390660,
939  0.8482460,
940  0.8564130,
941  0.8634600,
942  0.8689680,
943  0.8738000,
944  0.8767770,
945  0.8799960,
946  0.8825630,
947  0.8849870,
948  0.8894330,
949  0.8939110,
950  0.8994160,
951  0.9056300,
952  0.9123790,
953  0.9188800,
954  0.9244770,
955  0.9289540,
956  0.9338010,
957  0.9374110,
958  0.9414880,
959  0.9449190,
960  0.9480210,
961  0.9509810,
962  0.9532570,
963  0.9560420,
964  0.9581430,
965  0.9600910,
966  0.9609580,
967  0.9631350,
968  0.9649320,
969  0.9674470,
970  0.9728920,
971  0.9774240,
972  0.9827830,
973  0.9874630,
974  0.9926650,
975  0.9966400,
976  0.9993680,
977  0.9999140,
978  0.9942900,
979  0.9882640,
980  0.9810720,
981  0.9751580,
982  0.9699990,
983  0.9659940,
984  0.9632210,
985  0.9624050,
986  0.9621500,
987  0.9633410,
988  0.9654310,
989  0.9671030,
990  0.9672570,
991  0.9677370,
992  0.9653110,
993  0.9633140,
994  0.9579490,
995  0.9533250,
996  0.9486410,
997  0.9423590,
998  0.9358410,
999  0.9299340,
1000  0.9243940,
1001  0.9190090,
1002  0.9141220,
1003  0.9087800,
1004  0.9039750,
1005  0.8980690,
1006  0.8927220,
1007  0.8870500,
1008  0.8828150,
1009  0.8771870,
1010  0.8734510,
1011  0.8694140,
1012  0.8664310,
1013  0.8660560,
1014  0.8588170,
1015  0.8477750,
1016  0.8331070,
1017  0.8135860,
1018  0.7865930,
1019  0.7489860,
1020  0.6981680,
1021  0.6306270,
1022  0.5506620,
1023  0.4616840,
1024  0.3695890,
1025  0.2823490,
1026  0.2074510,
1027  0.1465300,
1028  0.1010100,
1029  0.0686868,
1030  0.0471034,
1031  0.0324221,
1032  0.0246752,
1033  0.0174143,
1034  0.0126697,
1035  0.0116629,
1036  0.0086694,
1037  0.0081772,
1038  0.0000000,
1039  0.0000000,
1040  0.0000000,
1041  0.0000000,
1042  0.0000000,
1043  0.0000000,
1044  0.0000000,
1045  0.0000000,
1046  0.0000000,
1047  0.0000000,
1048  0.0000000,
1049  0.0000000,
1050  0.0000000,
1051  0.0000000,
1052  0.0000000,
1053  0.0000000,
1054  0.0000000,
1055  0.0000000,
1056  0.0000000,
1057  0.0000000,
1058  0.0000000,
1059  0.0000000,
1060  0.0000000,
1061  0.0000000,
1062  0.0000000,
1063  0.0000000,
1064  0.0000000,
1065  0.0000000,
1066  0.0000000,
1067  0.0000000,
1068  0.0000000,
1069  0.0000000,
1070  0.0000000,
1071  0.0000000,
1072  0.0000000,
1073  0.0000000,
1074  0.0000000,
1075  0.0000000,
1076  0.0000000,
1077  0.0000000
1078  };
1079  //add panchromatic band to the temporary list
1080  const std::vector<float> vb0 (b0, b0 + sizeof(b0) / sizeof(float) );
1081  tmpSpectralBandList.push_back(vb0);
1082  }
1083  else
1084  {
1085  itkExceptionMacro(<< "Invalid Pleiades Sensor ID");
1086  }
1087  }
1088  else if (nbBands > 1 && nbBands < 5)
1089  {
1090  //FIXME add other instrument relative spectral response (not only HRG)
1091  //band B0
1092  const float b1[209] =
1093  {
1094  0.0098681,
1095  0.0293268,
1096  0.0877320,
1097  0.1287040,
1098  0.1341240,
1099  0.2457050,
1100  0.4345520,
1101  0.5133040,
1102  0.4710970,
1103  0.5125880,
1104  0.6530370,
1105  0.7707870,
1106  0.7879420,
1107  0.7648330,
1108  0.7718380,
1109  0.8013290,
1110  0.8240790,
1111  0.8352890,
1112  0.8326150,
1113  0.8249150,
1114  0.8168160,
1115  0.8163380,
1116  0.8285420,
1117  0.8623820,
1118  0.9075060,
1119  0.9379000,
1120  0.9505710,
1121  0.9572260,
1122  0.9650570,
1123  0.9632790,
1124  0.9587260,
1125  0.9567320,
1126  0.9646760,
1127  0.9804620,
1128  0.9900240,
1129  0.9838940,
1130  0.9719110,
1131  0.9715280,
1132  0.9574890,
1133  0.8770130,
1134  0.7103910,
1135  0.4943810,
1136  0.3021990,
1137  0.1722720,
1138  0.0943537,
1139  0.0543895,
1140  0.0345732,
1141  0.0261018,
1142  0.0230010,
1143  0.0223203,
1144  0.0210136,
1145  0.0173172,
1146  0.0119112,
1147  0.0072895,
1148  0.0046311,
1149  0.0033297,
1150  0.0025865,
1151  0.0020232,
1152  0.0015030,
1153  0.0010527,
1154  0.0007044,
1155  0.0005199,
1156  0.0004117,
1157  0.0004097,
1158  0.0005317,
1159  0.0009532,
1160  0.0013521,
1161  0.0014273,
1162  0.0009182,
1163  0.0003440,
1164  0.0001323,
1165  0.0000783,
1166  0.0000626,
1167  0.0000511,
1168  0.0000538,
1169  0.0000533,
1170  0.0000454,
1171  0.0000404,
1172  0.0000315,
1173  0.0000327,
1174  0.0000262,
1175  0.0000303,
1176  0.0000206,
1177  0.0000241,
1178  0.0000241,
1179  0.0000273,
1180  0.0000258,
1181  0.0000208,
1182  0.0000341,
1183  0.0000379,
1184  0.0000393,
1185  0.0000429,
1186  0.0000281,
1187  0.0000277,
1188  0.0000187,
1189  0.0000272,
1190  0.0000245,
1191  0.0000209,
1192  0.0000137,
1193  0.0000171,
1194  0.0000257,
1195  0.0000300,
1196  0.0000330,
1197  0.0000446,
1198  0.0000397,
1199  0.0000399,
1200  0.0000384,
1201  0.0000336,
1202  0.0000307,
1203  0.0000300,
1204  0.0000242,
1205  0.0000224,
1206  0.0000210,
1207  0.0000325,
1208  0.0000690,
1209  0.0002195,
1210  0.0005063,
1211  0.0008373,
1212  0.0009464,
1213  0.0007099,
1214  0.0004910,
1215  0.0004433,
1216  0.0006064,
1217  0.0012019,
1218  0.0016241,
1219  0.0016779,
1220  0.0009733,
1221  0.0003606,
1222  0.0001659,
1223  0.0000864,
1224  0.0000564,
1225  0.0000562,
1226  0.0000590,
1227  0.0000458,
1228  0.0000382,
1229  0.0000586,
1230  0.0000685,
1231  0.0000474,
1232  0.0000872,
1233  0.0000628,
1234  0.0000948,
1235  0.0001015,
1236  0.0001564,
1237  0.0002379,
1238  0.0003493,
1239  0.0005409,
1240  0.0007229,
1241  0.0007896,
1242  0.0007188,
1243  0.0005204,
1244  0.0003939,
1245  0.0003128,
1246  0.0002699,
1247  0.0002605,
1248  0.0002378,
1249  0.0002286,
1250  0.0002406,
1251  0.0002741,
1252  0.0003203,
1253  0.0003812,
1254  0.0004904,
1255  0.0006077,
1256  0.0008210,
1257  0.0011791,
1258  0.0018150,
1259  0.0030817,
1260  0.0055589,
1261  0.0103652,
1262  0.0166309,
1263  0.0211503,
1264  0.0216246,
1265  0.0176910,
1266  0.0136927,
1267  0.0107136,
1268  0.0089555,
1269  0.0079790,
1270  0.0079189,
1271  0.0080456,
1272  0.0088920,
1273  0.0102062,
1274  0.0126157,
1275  0.0162251,
1276  0.0221306,
1277  0.0308295,
1278  0.0411980,
1279  0.0498232,
1280  0.0531265,
1281  0.0484487,
1282  0.0391122,
1283  0.0291405,
1284  0.0212633,
1285  0.0162146,
1286  0.0128925,
1287  0.0108169,
1288  0.0094115,
1289  0.0084386,
1290  0.0077249,
1291  0.0074231,
1292  0.0072603,
1293  0.0073459,
1294  0.0074214,
1295  0.0076433,
1296  0.0077788,
1297  0.0078151,
1298  0.0077003,
1299  0.0072256,
1300  0.0065903,
1301  0.0057120,
1302  0.0048136
1303  };
1304  const float b2[209] =
1305  {
1306  0.0000144,
1307  0.0000143,
1308  0.0000259,
1309  0.0000189,
1310  0.0000132,
1311  0.0000179,
1312  0.0000224,
1313  0.0000179,
1314  0.0000124,
1315  0.0000202,
1316  0.0000276,
1317  0.0000292,
1318  0.0000420,
1319  0.0000366,
1320  0.0000261,
1321  0.0000247,
1322  0.0000445,
1323  0.0000902,
1324  0.0001144,
1325  0.0000823,
1326  0.0000778,
1327  0.0001923,
1328  0.0003401,
1329  0.0004085,
1330  0.0004936,
1331  0.0007849,
1332  0.0045979,
1333  0.0085122,
1334  0.0143014,
1335  0.0243310,
1336  0.0480572,
1337  0.1097360,
1338  0.2353890,
1339  0.4328370,
1340  0.6491340,
1341  0.8095770,
1342  0.8847680,
1343  0.9066640,
1344  0.9131150,
1345  0.9186700,
1346  0.9273270,
1347  0.9405210,
1348  0.9512930,
1349  0.9587500,
1350  0.9667360,
1351  0.9709750,
1352  0.9728630,
1353  0.9769560,
1354  0.9850710,
1355  0.9892500,
1356  0.9865960,
1357  0.9743300,
1358  0.9575190,
1359  0.9435550,
1360  0.9439310,
1361  0.9571350,
1362  0.9712530,
1363  0.9761580,
1364  0.9619590,
1365  0.9244890,
1366  0.8734580,
1367  0.8349840,
1368  0.8166740,
1369  0.8015960,
1370  0.7435910,
1371  0.6160350,
1372  0.4321320,
1373  0.2544540,
1374  0.1360870,
1375  0.0769553,
1376  0.0479321,
1377  0.0342014,
1378  0.0266703,
1379  0.0212632,
1380  0.0160541,
1381  0.0106967,
1382  0.0060543,
1383  0.0030797,
1384  0.0015416,
1385  0.0008333,
1386  0.0004706,
1387  0.0002918,
1388  0.0001917,
1389  0.0001472,
1390  0.0001063,
1391  0.0000912,
1392  0.0000589,
1393  0.0000552,
1394  0.0000752,
1395  0.0000884,
1396  0.0000985,
1397  0.0001125,
1398  0.0001368,
1399  0.0001947,
1400  0.0002284,
1401  0.0002088,
1402  0.0001498,
1403  0.0000637,
1404  0.0000307,
1405  0.0000283,
1406  0.0000311,
1407  0.0000331,
1408  0.0000215,
1409  0.0000236,
1410  0.0000205,
1411  0.0000186,
1412  0.0000233,
1413  0.0000233,
1414  0.0000198,
1415  0.0000195,
1416  0.0000161,
1417  0.0000308,
1418  0.0000464,
1419  0.0000290,
1420  0.0000264,
1421  0.0000233,
1422  0.0000395,
1423  0.0001113,
1424  0.0001903,
1425  0.0002290,
1426  0.0002229,
1427  0.0001322,
1428  0.0000548,
1429  0.0000608,
1430  0.0000414,
1431  0.0000382,
1432  0.0000381,
1433  0.0000269,
1434  0.0000233,
1435  0.0000198,
1436  0.0000208,
1437  0.0000302,
1438  0.0000419,
1439  0.0000305,
1440  0.0000340,
1441  0.0000334,
1442  0.0000362,
1443  0.0000282,
1444  0.0000337,
1445  0.0000330,
1446  0.0000424,
1447  0.0000420,
1448  0.0000470,
1449  0.0000417,
1450  0.0000233,
1451  0.0000439,
1452  0.0000503,
1453  0.0000446,
1454  0.0000428,
1455  0.0000597,
1456  0.0000671,
1457  0.0001142,
1458  0.0001780,
1459  0.0003546,
1460  0.0009610,
1461  0.0041260,
1462  0.0066679,
1463  0.0078563,
1464  0.0068645,
1465  0.0029441,
1466  0.0011320,
1467  0.0007028,
1468  0.0005471,
1469  0.0004967,
1470  0.0004929,
1471  0.0005351,
1472  0.0006223,
1473  0.0007957,
1474  0.0010708,
1475  0.0016699,
1476  0.0030334,
1477  0.0054959,
1478  0.0091390,
1479  0.0125045,
1480  0.0144212,
1481  0.0141099,
1482  0.0117418,
1483  0.0089824,
1484  0.0067916,
1485  0.0056849,
1486  0.0051998,
1487  0.0053640,
1488  0.0060350,
1489  0.0067668,
1490  0.0083174,
1491  0.0106521,
1492  0.0139110,
1493  0.0183736,
1494  0.0231289,
1495  0.0272661,
1496  0.0298126,
1497  0.0300318,
1498  0.0286507,
1499  0.0266172,
1500  0.0247529,
1501  0.0236974,
1502  0.0232734,
1503  0.0236733,
1504  0.0245808,
1505  0.0257173,
1506  0.0267721,
1507  0.0267455,
1508  0.0254447,
1509  0.0227056,
1510  0.0188513,
1511  0.0147988,
1512  0.0109864,
1513  0.0079795,
1514  0.0057516
1515  };
1516  const float b3[209] =
1517  {
1518  0.0097386,
1519  0.0035306,
1520  0.0035374,
1521  0.0114418,
1522  0.0266686,
1523  0.0373494,
1524  0.0904431,
1525  0.0907580,
1526  0.0399312,
1527  0.0208748,
1528  0.0080694,
1529  0.0027002,
1530  0.0011241,
1531  0.0006460,
1532  0.0005029,
1533  0.0006051,
1534  0.0009979,
1535  0.0019446,
1536  0.0014554,
1537  0.0006090,
1538  0.0003230,
1539  0.0002503,
1540  0.0002538,
1541  0.0003360,
1542  0.0005377,
1543  0.0007773,
1544  0.0004895,
1545  0.0002045,
1546  0.0000875,
1547  0.0000594,
1548  0.0000217,
1549  0.0000290,
1550  0.0000297,
1551  0.0000408,
1552  0.0000456,
1553  0.0000447,
1554  0.0000322,
1555  0.0000222,
1556  0.0000147,
1557  0.0000095,
1558  0.0000072,
1559  0.0000113,
1560  0.0000313,
1561  0.0000123,
1562  0.0000122,
1563  0.0000280,
1564  0.0000180,
1565  0.0000261,
1566  0.0000138,
1567  0.0000392,
1568  0.0000517,
1569  0.0000695,
1570  0.0000797,
1571  0.0000785,
1572  0.0001004,
1573  0.0001170,
1574  0.0001483,
1575  0.0001837,
1576  0.0002110,
1577  0.0002973,
1578  0.0004162,
1579  0.0006371,
1580  0.0010012,
1581  0.0032888,
1582  0.0100109,
1583  0.0181837,
1584  0.0330510,
1585  0.0624784,
1586  0.1183670,
1587  0.2218740,
1588  0.3756820,
1589  0.5574830,
1590  0.7342220,
1591  0.8636840,
1592  0.9319920,
1593  0.9527010,
1594  0.9620090,
1595  0.9527340,
1596  0.9437220,
1597  0.9456300,
1598  0.9562330,
1599  0.9693120,
1600  0.9839640,
1601  0.9949160,
1602  0.9992700,
1603  0.9993300,
1604  0.9963430,
1605  0.9944130,
1606  0.9883050,
1607  0.9857580,
1608  0.9807560,
1609  0.9683790,
1610  0.9544700,
1611  0.9371750,
1612  0.9170350,
1613  0.8922820,
1614  0.8662710,
1615  0.8442750,
1616  0.8220420,
1617  0.7888070,
1618  0.7372920,
1619  0.6625080,
1620  0.5662120,
1621  0.4493120,
1622  0.3260000,
1623  0.2194040,
1624  0.1416500,
1625  0.0925669,
1626  0.0619437,
1627  0.0456444,
1628  0.0355683,
1629  0.0310879,
1630  0.0295168,
1631  0.0233351,
1632  0.0189628,
1633  0.0158627,
1634  0.0132266,
1635  0.0107473,
1636  0.0083969,
1637  0.0063847,
1638  0.0046601,
1639  0.0033814,
1640  0.0024167,
1641  0.0017478,
1642  0.0012949,
1643  0.0009939,
1644  0.0007442,
1645  0.0006312,
1646  0.0005142,
1647  0.0004354,
1648  0.0003549,
1649  0.0003156,
1650  0.0003079,
1651  0.0002906,
1652  0.0002867,
1653  0.0002751,
1654  0.0003048,
1655  0.0003010,
1656  0.0003342,
1657  0.0004310,
1658  0.0004955,
1659  0.0005488,
1660  0.0005838,
1661  0.0006687,
1662  0.0006968,
1663  0.0006650,
1664  0.0005866,
1665  0.0004688,
1666  0.0004086,
1667  0.0003611,
1668  0.0002404,
1669  0.0002609,
1670  0.0002476,
1671  0.0002133,
1672  0.0002098,
1673  0.0001916,
1674  0.0001642,
1675  0.0001799,
1676  0.0002180,
1677  0.0002003,
1678  0.0002030,
1679  0.0002348,
1680  0.0002735,
1681  0.0002652,
1682  0.0002944,
1683  0.0004666,
1684  0.0004882,
1685  0.0006642,
1686  0.0007798,
1687  0.0010588,
1688  0.0014008,
1689  0.0019011,
1690  0.0024917,
1691  0.0034379,
1692  0.0042182,
1693  0.0053618,
1694  0.0062814,
1695  0.0068774,
1696  0.0071141,
1697  0.0070399,
1698  0.0065876,
1699  0.0067873,
1700  0.0066877,
1701  0.0068572,
1702  0.0070486,
1703  0.0073911,
1704  0.0081201,
1705  0.0087391,
1706  0.0096581,
1707  0.0106625,
1708  0.0120129,
1709  0.0137222,
1710  0.0159817,
1711  0.0180896,
1712  0.0206562,
1713  0.0236408,
1714  0.0269627,
1715  0.0310497,
1716  0.0353146,
1717  0.0398729,
1718  0.0438795,
1719  0.0462377,
1720  0.0454916,
1721  0.0408754,
1722  0.0333175,
1723  0.0251186,
1724  0.0179089,
1725  0.0125129,
1726  0.0086117
1727  };
1728  const float b4[209] =
1729  {
1730  0.0024163,
1731  0.0017305,
1732  0.0020803,
1733  0.0020499,
1734  0.0012660,
1735  0.0007361,
1736  0.0006198,
1737  0.0006344,
1738  0.0007721,
1739  0.0011837,
1740  0.0020819,
1741  0.0023991,
1742  0.0013377,
1743  0.0006328,
1744  0.0003544,
1745  0.0002890,
1746  0.0002498,
1747  0.0002541,
1748  0.0003346,
1749  0.0005048,
1750  0.0008684,
1751  0.0009871,
1752  0.0006587,
1753  0.0003833,
1754  0.0002606,
1755  0.0002356,
1756  0.0002364,
1757  0.0002791,
1758  0.0003613,
1759  0.0005575,
1760  0.0007414,
1761  0.0007413,
1762  0.0005768,
1763  0.0004230,
1764  0.0003206,
1765  0.0003044,
1766  0.0003019,
1767  0.0003201,
1768  0.0003813,
1769  0.0004630,
1770  0.0005930,
1771  0.0007080,
1772  0.0008577,
1773  0.0009017,
1774  0.0008813,
1775  0.0007801,
1776  0.0006583,
1777  0.0005863,
1778  0.0005224,
1779  0.0005506,
1780  0.0006403,
1781  0.0008293,
1782  0.0013444,
1783  0.0023942,
1784  0.0027274,
1785  0.0014330,
1786  0.0006388,
1787  0.0003596,
1788  0.0002416,
1789  0.0001718,
1790  0.0001566,
1791  0.0001642,
1792  0.0001892,
1793  0.0002351,
1794  0.0003227,
1795  0.0006734,
1796  0.0014311,
1797  0.0013325,
1798  0.0005796,
1799  0.0002424,
1800  0.0001263,
1801  0.0001022,
1802  0.0000446,
1803  0.0000652,
1804  0.0000544,
1805  0.0000573,
1806  0.0000518,
1807  0.0000504,
1808  0.0000649,
1809  0.0000723,
1810  0.0000833,
1811  0.0000739,
1812  0.0000691,
1813  0.0001382,
1814  0.0001692,
1815  0.0002240,
1816  0.0002296,
1817  0.0001553,
1818  0.0001492,
1819  0.0001121,
1820  0.0001058,
1821  0.0001068,
1822  0.0001012,
1823  0.0000864,
1824  0.0000533,
1825  0.0000354,
1826  0.0000440,
1827  0.0000371,
1828  0.0000691,
1829  0.0000769,
1830  0.0000791,
1831  0.0001333,
1832  0.0001244,
1833  0.0002048,
1834  0.0002455,
1835  0.0002721,
1836  0.0003812,
1837  0.0004568,
1838  0.0006255,
1839  0.0008185,
1840  0.0009733,
1841  0.0012281,
1842  0.0013528,
1843  0.0015758,
1844  0.0017458,
1845  0.0019104,
1846  0.0020863,
1847  0.0023053,
1848  0.0025241,
1849  0.0037234,
1850  0.0044186,
1851  0.0053574,
1852  0.0066118,
1853  0.0083509,
1854  0.0107509,
1855  0.0150393,
1856  0.0212756,
1857  0.0292566,
1858  0.0414246,
1859  0.0586633,
1860  0.0834879,
1861  0.1190380,
1862  0.1671850,
1863  0.2326370,
1864  0.3124060,
1865  0.4070470,
1866  0.5091930,
1867  0.6148270,
1868  0.7140870,
1869  0.8017550,
1870  0.8714840,
1871  0.9241260,
1872  0.9587210,
1873  0.9782990,
1874  0.9882040,
1875  0.9922940,
1876  0.9902030,
1877  0.9854020,
1878  0.9777560,
1879  0.9660200,
1880  0.9532070,
1881  0.9421250,
1882  0.9303560,
1883  0.9241490,
1884  0.9212220,
1885  0.9203820,
1886  0.9217020,
1887  0.9227420,
1888  0.9230000,
1889  0.9237670,
1890  0.9243070,
1891  0.9206520,
1892  0.9154840,
1893  0.9090910,
1894  0.9003380,
1895  0.8905620,
1896  0.8776420,
1897  0.8668600,
1898  0.8537290,
1899  0.8428590,
1900  0.8305310,
1901  0.8195740,
1902  0.8069090,
1903  0.7921080,
1904  0.7791670,
1905  0.7660510,
1906  0.7521190,
1907  0.7375270,
1908  0.7217320,
1909  0.7043220,
1910  0.6853170,
1911  0.6642500,
1912  0.6413850,
1913  0.6173030,
1914  0.5919540,
1915  0.5672310,
1916  0.5430130,
1917  0.5184560,
1918  0.4957540,
1919  0.4734340,
1920  0.4528220,
1921  0.4332270,
1922  0.4131920,
1923  0.3919120,
1924  0.3659660,
1925  0.3325420,
1926  0.2917680,
1927  0.2453910,
1928  0.1962540,
1929  0.1486850,
1930  0.1068860,
1931  0.0738260,
1932  0.0491777,
1933  0.0327991,
1934  0.0215831,
1935  0.0145386,
1936  0.0103219,
1937  0.0076144,
1938  0.0061346
1939  };
1940  //Add multispectral bands to the temporary list
1941  const std::vector<float> vb1 (b1, b1 + sizeof(b1) / sizeof(float) );
1942  tmpSpectralBandList.push_back(vb1);
1943  const std::vector<float> vb2 (b2, b2 + sizeof(b2) / sizeof(float) );
1944  tmpSpectralBandList.push_back(vb2);
1945  const std::vector<float> vb3 (b3, b3 + sizeof(b3) / sizeof(float) );
1946  tmpSpectralBandList.push_back(vb3);
1947  const std::vector<float> vb4 (b4, b4 + sizeof(b4) / sizeof(float) );
1948  tmpSpectralBandList.push_back(vb4);
1949 
1950  }
1951  else
1952  {
1953  itkExceptionMacro(<< "Invalid number of bands...");
1954  }
1955 
1956  unsigned int j = 0;
1957  for (std::list <std::vector<float> >::const_iterator it = tmpSpectralBandList.begin(); it != tmpSpectralBandList.end(); ++it)
1958  {
1959  wavelengthSpectralBand->PushBack(FilterFunctionValues::New());
1960  wavelengthSpectralBand->GetNthElement(j)->SetFilterFunctionValues(*it);
1961  wavelengthSpectralBand->GetNthElement(j)->SetMinSpectralValue(0.430);
1962  wavelengthSpectralBand->GetNthElement(j)->SetMaxSpectralValue(0.950);
1963  wavelengthSpectralBand->GetNthElement(j)->SetUserStep(0.0025);
1964  ++j;
1965  }
1966 
1967  return wavelengthSpectralBand;
1968 }
1969 
1970 } // end namespace otb

Generated at Sun Feb 3 2013 00:42:00 for Orfeo Toolbox with doxygen 1.8.1.1