Orfeo Toolbox  4.0
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  // This values were provided by the French Space Agency
133  double defaultRadianceMS[4];
134  double defaultRadianceP;
135 
136  const std::string sensorId = this->GetSensorID();
137  if (sensorId == "PHR 1A")
138  {
139  // MS, ordered as B0, B1, B2, B3
140  defaultRadianceMS[0] = 1915.01;
141  defaultRadianceMS[1] = 1830.57;
142  defaultRadianceMS[2] = 1594.06;
143  defaultRadianceMS[3] = 1060.01;
144 
145  defaultRadianceP = 1548.71;
146  }
147  else if (sensorId == "PHR 1B")
148  {
149  // MS, ordered as B0, B1, B2, B3
150  defaultRadianceMS[0] = 1926.51688;
151  defaultRadianceMS[1] = 1805.91412;
152  defaultRadianceMS[2] = 1533.60973;
153  defaultRadianceMS[3] = 1019.23037;
154 
155  defaultRadianceP = 1529.00384;
156  }
157  else
158  {
159  itkExceptionMacro(<< "Invalid sensor ID.");
160  }
161 
162  // tolerance threshold
163  double tolerance = 0.05;
164 
165  if (outputValues.size() == 1)
166  {
167  // Pan
168  if (vcl_abs(outputValues[0] - defaultRadianceP) > (tolerance * defaultRadianceP))
169  {
170  outputValuesVariableLengthVector[0] = defaultRadianceP;
171  }
172  else
173  {
174  outputValuesVariableLengthVector[0] = outputValues[0];
175  }
176  }
177  else
178  {
179  // MS
180  for (unsigned int i = 0; i < outputValues.size(); ++i)
181  {
182  int wavelenghPos = this->BandIndexToWavelengthPosition(i);
183  if (vcl_abs(outputValues[wavelenghPos] - defaultRadianceMS[wavelenghPos]) >
184  (tolerance * defaultRadianceMS[wavelenghPos]))
185  {
186  outputValuesVariableLengthVector[i] = defaultRadianceMS[wavelenghPos];
187  }
188  else
189  {
190  outputValuesVariableLengthVector[i] = outputValues[wavelenghPos];
191  }
192  }
193  }
194 
195  return outputValuesVariableLengthVector;
196 }
197 
198 int
200 {
201  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
202  if (!this->CanRead())
203  {
204  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
205  }
206 
207  ImageKeywordlistType imageKeywordlist;
208 
210  {
211  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
212  }
213 
214  if (!imageKeywordlist.HasKey("support_data.image_date"))
215  {
216  return -1;
217  }
218 
219  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
220  std::vector<std::string> outputValues;
221 
222  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
223 
224  int value;
225  try
226  {
227  value = lexical_cast<int> (outputValues[2]);
228  }
229  catch (bad_lexical_cast &)
230  {
231  itkExceptionMacro(<< "Invalid Day");
232  }
233 
234  return value;
235 }
236 
237 int
239 {
240  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
241  if (!this->CanRead())
242  {
243  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
244  }
245 
246  ImageKeywordlistType imageKeywordlist;
247 
249  {
250  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
251  }
252 
253  if (!imageKeywordlist.HasKey("support_data.image_date"))
254  {
255  return -1;
256  }
257 
258  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
259  std::vector<std::string> outputValues;
260  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
261 
262  int value;
263  try
264  {
265  value = lexical_cast<int> (outputValues[1]);
266  }
267  catch (bad_lexical_cast &)
268  {
269  itkExceptionMacro(<< "Invalid Month");
270  }
271  return value;
272 }
273 
274 int
276 {
277  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
278  if (!this->CanRead())
279  {
280  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
281  }
282 
283  ImageKeywordlistType imageKeywordlist;
284 
286  {
287  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
288  }
289 
290  if (!imageKeywordlist.HasKey("support_data.image_date"))
291  {
292  return -1;
293  }
294 
295  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
296  std::vector<std::string> outputValues;
297  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
298 
299  int value;
300  try
301  {
302  value = lexical_cast<int> (outputValues[0]);
303  }
304  catch (bad_lexical_cast &)
305  {
306  itkExceptionMacro(<< "Invalid Year");
307  }
308  return value;
309 }
310 
311 int
313 {
314  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
315  if (!this->CanRead())
316  {
317  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
318  }
319 
320  ImageKeywordlistType imageKeywordlist;
321 
323  {
324  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
325  }
326 
327  if (!imageKeywordlist.HasKey("support_data.image_date"))
328  {
329  return -1;
330  }
331 
332  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
333  std::vector<std::string> outputValues;
334  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
335 
336  int value;
337  try
338  {
339  value = lexical_cast<int> (outputValues[3]);
340  }
341  catch (bad_lexical_cast &)
342  {
343  itkExceptionMacro(<< "Invalid Hour");
344  }
345  return value;
346 }
347 
348 int
350 {
351  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
352  if (!this->CanRead())
353  {
354  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
355  }
356 
357  ImageKeywordlistType imageKeywordlist;
358 
360  {
361  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
362  }
363 
364  if (!imageKeywordlist.HasKey("support_data.image_date"))
365  {
366  return -1;
367  }
368 
369  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.image_date");
370  std::vector<std::string> outputValues;
371  boost::split(outputValues, valueString, boost::is_any_of(" T:-."));
372 
373  int value;
374  try
375  {
376  value = lexical_cast<int> (outputValues[4]);
377  }
378  catch (bad_lexical_cast &)
379  {
380  itkExceptionMacro(<< "Invalid Minute");
381  }
382  return value;
383 }
384 
385 int
387 {
388  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
389  if (!this->CanRead())
390  {
391  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
392  }
393 
394  ImageKeywordlistType imageKeywordlist;
395 
397  {
398  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
399  }
400 
401  if (!imageKeywordlist.HasKey("support_data.production_date"))
402  {
403  return -1;
404  }
405 
406  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
407  std::vector<std::string> outputValues;
408  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
409 
410  int value;
411  try
412  {
413  value = lexical_cast<int> (outputValues[2]);
414  }
415  catch (bad_lexical_cast &)
416  {
417  itkExceptionMacro(<< "Invalid Day");
418  }
419  return value;
420 }
421 
422 int
424 {
425  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
426  if (!this->CanRead())
427  {
428  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
429  }
430 
431  ImageKeywordlistType imageKeywordlist;
432 
434  {
435  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
436  }
437 
438  if (!imageKeywordlist.HasKey("support_data.production_date"))
439  {
440  return -1;
441  }
442 
443  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
444  std::vector<std::string> outputValues;
445  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
446 
447  int value;
448  try
449  {
450  value = lexical_cast<int> (outputValues[1]);
451  }
452  catch (bad_lexical_cast &)
453  {
454  itkExceptionMacro(<< "Invalid Month");
455  }
456  return value;
457 }
458 
459 int
461 {
462  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
463  if (!this->CanRead())
464  {
465  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
466  }
467 
468  ImageKeywordlistType imageKeywordlist;
469 
471  {
472  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
473  }
474 
475  if (!imageKeywordlist.HasKey("support_data.production_date"))
476  {
477  return -1;
478  }
479 
480  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.production_date");
481  std::vector<std::string> outputValues;
482  boost::split(outputValues, valueString, boost::is_any_of(" T:-"));
483 
484  if (outputValues.size() <= 2) itkExceptionMacro(<< "Invalid Year");
485 
486  int value;
487  try
488  {
489  value = lexical_cast<int> (outputValues[0]);
490  }
491  catch (bad_lexical_cast &)
492  {
493  itkExceptionMacro(<< "Invalid Year");
494  }
495  return value;
496 }
497 
501 {
502  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
503  if (!this->CanRead())
504  {
505  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
506  }
507 
508  ImageKeywordlistType imageKeywordlist;
509 
511  {
512  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
513  }
514 
515  std::vector<double> outputValues;
516  if (imageKeywordlist.HasKey("support_data.physical_bias"))
517  {
518  std::vector<std::string> outputValuesString;
519  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.physical_bias");
520  boost::trim(valueString);
521  boost::split(outputValuesString, valueString, boost::is_any_of(" "));
522  for (unsigned int i = 0; i < outputValuesString.size(); ++i)
523  {
524  outputValues.push_back(atof(outputValuesString[i].c_str()));
525  }
526  }
527 
528  VariableLengthVectorType outputValuesVariableLengthVector;
529  outputValuesVariableLengthVector.SetSize(outputValues.size());
530  outputValuesVariableLengthVector.Fill(0);
531 
532  // Use BandIndexToWavelengthPosition because values in keywordlist are sorted by wavelength
533  for (unsigned int i = 0; i < outputValues.size(); ++i)
534  {
535  outputValuesVariableLengthVector[i] = outputValues[this->BandIndexToWavelengthPosition(i)];
536  }
537 
538 
539  return outputValuesVariableLengthVector;
540 }
541 
545 {
546  //We use here tabulate in flight values for physical gain of PHR. Those values evolve
547  //with time and are much more accurate. Values provided by CNES calibration
548  //team. Diference between metadata values and in flight gain can lead to
549  //difference of 10%.
550 
551  //Values:
552  // Ak values for PHR1A are given in the following table :
553 
554  // Dates PA NTDI=13 B0 B1 B2 B3
555 
556  // From 17/12/2011 to 01/08/2012 11.75 9.52 9.62 10.55 15.73
557  // From 01/08/2012 to 01/03/2013 11.73 9.45 9.48 10.51 15.71
558  // From 01/03/2013 11.70 9.38 9.34 10.46 15.69
559 
560  // For PHR1B in the following table :
561 
562  // Dates PA NTDI=13 B0 B1 B2 B3
563  // From 01/12/2012 12.04 10.46 10.47 11.32 17.21
564 
565  std::vector<double> outputValues;
566  const std::string sensorId = this->GetSensorID();
567  const int nbBands = this->GetNumberOfBands();
568 
569  if (sensorId == "PHR 1A")
570  {
571  //PHR 1A
572  if ( (this->GetYear() < 2012) || (this->GetYear() == 2012 && this->GetMonth() <8 ) )
573  {
574  if (nbBands == 1)
575  {
576  outputValues.push_back(11.75);
577  }
578  else
579  {
580  outputValues.push_back(9.52);
581  outputValues.push_back(9.62);
582  outputValues.push_back(10.55);
583  outputValues.push_back(15.73);
584  }
585  }
586  else if ( (this->GetYear() == 2012 && this->GetMonth() >=8) || (this->GetYear() == 2013 && this->GetMonth() <3) )
587  {
588  if (nbBands == 1)
589  {
590  outputValues.push_back(11.73);
591  }
592  else
593  {
594  outputValues.push_back(9.45);
595  outputValues.push_back(9.48);
596  outputValues.push_back(10.51);
597  outputValues.push_back(15.71);
598  }
599  }
600  else if ( (this->GetYear() == 2013 && this->GetMonth() >= 3) || this->GetYear() > 2013 )
601  {
602  if (nbBands == 1)
603  {
604  outputValues.push_back(11.7);
605  }
606  else
607  {
608  outputValues.push_back(9.38);
609  outputValues.push_back(9.34);
610  outputValues.push_back(10.46);
611  outputValues.push_back(15.69);
612  }
613  }
614  else
615  {
616  itkExceptionMacro(<< "Invalid metadata, wrong acquisition date");
617  }
618  }
619  else if (sensorId == "PHR 1B")
620  {
621  //PHR 1B
622  if ( this->GetYear() >= 2012 )
623  {
624  if (nbBands == 1)
625  {
626  outputValues.push_back(12.04);
627  }
628  else
629  {
630  outputValues.push_back(10.46);
631  outputValues.push_back(10.47);
632  outputValues.push_back(11.32);
633  outputValues.push_back(17.21);
634  }
635  }
636  else
637  {
638  itkExceptionMacro(<< "Invalid metadata, wrong acquisition date");
639  }
640  }
641  else
642  {
643  itkExceptionMacro(<< "Invalid metadata, bad sensor id");
644  }
645 
646  VariableLengthVectorType outputValuesVariableLengthVector;
647  outputValuesVariableLengthVector.SetSize(outputValues.size());
648  outputValuesVariableLengthVector.Fill(0);
649 
650  // Use BandIndexToWavelengthPosition because values are tabulated and sorted by wavelength
651  for (unsigned int i = 0; i < outputValues.size(); ++i)
652  {
653  outputValuesVariableLengthVector[i] = outputValues[this->BandIndexToWavelengthPosition(i)];
654  }
655 
656  otbMsgDevMacro( << "physical gain " << outputValuesVariableLengthVector);
657  return outputValuesVariableLengthVector;
658 }
659 
660 double
662 {
663  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
664  if (!this->CanRead())
665  {
666  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
667  }
668 
669  ImageKeywordlistType imageKeywordlist;
670 
672  {
673  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
674  }
675 
676  if (!imageKeywordlist.HasKey("support_data.incident_angle"))
677  {
678  return 0;
679  }
680 
681  // MSD: for the moment take only topCenter value
682  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.incident_angle");
683  double value = atof(valueString.c_str());
684  return value;
685 }
686 
687 double
689 {
690  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
691  if (!this->CanRead())
692  {
693  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
694  }
695 
696  ImageKeywordlistType imageKeywordlist;
697 
699  {
700  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
701  }
702 
703  if (!imageKeywordlist.HasKey("support_data.scene_orientation"))
704  {
705  return 0;
706  }
707 
708  // MSD: for the moment take only topCenter value
709  std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation");
710  double satAz = atof(valueString.c_str());
711 
712  return satAz;
713 }
714 
718 {
719  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
720  if (!this->CanRead())
721  {
722  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
723  }
724 
725  ImageKeywordlistType imageKeywordlist;
726 
728  {
729  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
730  }
731 
732  VariableLengthVectorType wavel(1);
733  wavel.Fill(0.);
734 
735  int nbBands = this->GetNumberOfBands();
736  std::string sensorId = this->GetSensorID();
737 
738  // Panchromatic case
739  if (nbBands == 1)
740  {
741  wavel.SetSize(1);
742  wavel.Fill(0.430);
743  }
744  else if (nbBands > 1 && nbBands < 5)
745  {
746  wavel.SetSize(4);
747  wavel[0] = 0.430;
748  wavel[1] = 0.430;
749  wavel[2] = 0.430;
750  wavel[3] = 0.430;
751  }
752  else itkExceptionMacro(<< "Invalid number of bands...");
753 
754  return wavel;
755 }
756 
760 {
761  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
762  if (!this->CanRead())
763  {
764  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
765  }
766 
767  ImageKeywordlistType imageKeywordlist;
768 
770  {
771  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
772  }
773 
774  VariableLengthVectorType wavel(1);
775  wavel.Fill(0.);
776 
777  int nbBands = this->GetNumberOfBands();
778 
779  // Panchromatic case
780  if (nbBands == 1)
781  {
782  wavel.SetSize(1);
783  wavel.Fill(0.95);
784  }
785  else if (nbBands > 1 && nbBands < 5)
786  {
787  wavel.SetSize(4);
788  wavel[0] = 0.95;
789  wavel[1] = 0.95;
790  wavel[2] = 0.95;
791  wavel[3] = 0.95;
792  }
793  else itkExceptionMacro(<< "Invalid number of bands...");
794 
795  return wavel;
796 }
797 
798 // TODO MSD need to update this function
799 // Comment this part as relative response
800 // FIXME check if this is coherent with other sensor
801 unsigned int
803 ::BandIndexToWavelengthPosition(unsigned int i) const
804 {
805  int nbBands = this->GetNumberOfBands();
806  //Panchromatic case
807  if (nbBands == 1)
808  {
809  return 0;
810  }
811  else
812  {
813  otbMsgDevMacro(<< "Pleiades detected: band 0 and 2 inverted");
814  if (i == 0) return 2;
815  if (i == 2) return 0;
816  }
817 
818  return i;
819 }
820 
821 std::vector<std::string>
824 {
825  std::vector<std::string> enhBandNames;
826  std::vector<std::string> rawBandNames = this->Superclass::GetBandName();
827 
828  if(rawBandNames.size())
829  {
830  for (std::vector<std::string>::iterator it = rawBandNames.begin(); it != rawBandNames.end(); ++it)
831  {
832  // Manage Panchro case
833  if ( (rawBandNames.size() == 1) && !(*it).compare("P") )
834  {
835  enhBandNames.push_back("PAN");
836  break;
837  }
838  else if ((rawBandNames.size() != 1) && !(*it).compare("P"))
839  {
840  /* Launch exception situation not valid*/
841  itkExceptionMacro(<< "Invalid Metadata, we cannot provide an consistent name to the band");
842  }
843 
844  // Manage MS case
845  if ( !(*it).compare("B0") )
846  {
847  enhBandNames.push_back("Blue");
848  }
849  else if ( !(*it).compare("B1") )
850  {
851  enhBandNames.push_back("Green");
852  }
853  else if ( !(*it).compare("B2") )
854  {
855  enhBandNames.push_back("Red");
856  }
857  else if ( !(*it).compare("B3") )
858  {
859  enhBandNames.push_back("NIR");
860  }
861  else
862  {
863  enhBandNames.push_back("Unknown");
864  }
865  }
866  }
867 
868  return enhBandNames;
869 
870 }
871 
872 std::vector<unsigned int>
875 {
876  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
877  if (!this->CanRead())
878  {
879  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
880  }
881 
882  ImageKeywordlistType imageKeywordlist;
883 
885  {
886  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
887  }
888 
889  int nbBands = this->GetNumberOfBands();
890 
891  std::string key = "support_data.band_name_list";
892  std::vector<unsigned int> rgb(3);
893 
894  // TODO MSD remove this limitation when we get a real pleiades image
895  // Band order in PHR products seems to be always the same : RGB => keep the flag off
896  bool realProduct = false;
897  if (realProduct)
898  {
899  if (imageKeywordlist.HasKey(key) && (nbBands > 1))
900  {
901  std::string keywordStringBandNameList = imageKeywordlist.GetMetadataByKey(key);
902  std::vector<std::string> bandNameList;
903  boost::trim(keywordStringBandNameList);
904  boost::split(bandNameList, keywordStringBandNameList, boost::is_any_of(" "));
905 
906  for (int i = 0; i < nbBands && i < 3; i++)
907  {
908  size_t found;
909  found = bandNameList[i].find_first_not_of("B");
910  rgb[i] = lexical_cast<int> (bandNameList[i].at(found));
911  }
912  }
913  else
914  {
915  // Default values
916  rgb[0] = 2;
917  rgb[1] = 1;
918  rgb[2] = 0;
919  }
920  }
921  else
922  {
923  // Default values for simulation product
924  rgb[0] = 0;
925  rgb[1] = 1;
926  rgb[2] = 2;
927  }
928 
929  return rgb;
930 }
931 
935 {
936  //TODO tabulate spectral responses
937  WavelengthSpectralBandVectorType wavelengthSpectralBand = InternalWavelengthSpectralBandVectorType::New();
938 
939  std::list <std::vector<float> > tmpSpectralBandList;
940 
941  const MetaDataDictionaryType& dict = this->GetMetaDataDictionary();
942  if (!this->CanRead())
943  {
944  itkExceptionMacro(<< "Invalid Metadata, no Pleiades Image");
945  }
946 
947  ImageKeywordlistType imageKeywordlist;
948 
950  {
951  itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
952  }
953 
954  const int nbBands = this->GetNumberOfBands();
955  const std::string sensorId = this->GetSensorID();
956 
957  // Panchromatic case
958  if (nbBands == 1)
959  {
960  //if (sensorId.find("PHR") != std::string::npos)
961  if (sensorId == "PHR 1A")
962  {
963  const float pan[209] =
964  {
965  0.0000000,
966  0.0000000,
967  0.0000000,
968  0.0000000,
969  0.0000000,
970  0.0000000,
971  0.0000000,
972  0.0000000,
973  0.0004358,
974  0.0008051,
975  0.0030464,
976  0.0060688,
977  0.0130170,
978  0.0240166,
979  0.0421673,
980  0.0718226,
981  0.1151660,
982  0.1738520,
983  0.2442960,
984  0.3204090,
985  0.3940400,
986  0.4552560,
987  0.5015220,
988  0.5324310,
989  0.5537040,
990  0.5683830,
991  0.5824280,
992  0.5967100,
993  0.6107110,
994  0.6232080,
995  0.6335930,
996  0.6421600,
997  0.6501020,
998  0.6570500,
999  0.6640260,
1000  0.6707420,
1001  0.6765340,
1002  0.6808170,
1003  0.6829760,
1004  0.6834310,
1005  0.6831800,
1006  0.6831390,
1007  0.6846760,
1008  0.6892820,
1009  0.6964400,
1010  0.7073100,
1011  0.7193370,
1012  0.7323050,
1013  0.7449550,
1014  0.7554270,
1015  0.7638770,
1016  0.7715940,
1017  0.7776340,
1018  0.7826480,
1019  0.7871060,
1020  0.7913600,
1021  0.7949010,
1022  0.7974290,
1023  0.7996850,
1024  0.8007000,
1025  0.8003370,
1026  0.8002560,
1027  0.8000160,
1028  0.8012780,
1029  0.8035920,
1030  0.8077100,
1031  0.8136680,
1032  0.8209800,
1033  0.8302930,
1034  0.8390660,
1035  0.8482460,
1036  0.8564130,
1037  0.8634600,
1038  0.8689680,
1039  0.8738000,
1040  0.8767770,
1041  0.8799960,
1042  0.8825630,
1043  0.8849870,
1044  0.8894330,
1045  0.8939110,
1046  0.8994160,
1047  0.9056300,
1048  0.9123790,
1049  0.9188800,
1050  0.9244770,
1051  0.9289540,
1052  0.9338010,
1053  0.9374110,
1054  0.9414880,
1055  0.9449190,
1056  0.9480210,
1057  0.9509810,
1058  0.9532570,
1059  0.9560420,
1060  0.9581430,
1061  0.9600910,
1062  0.9609580,
1063  0.9631350,
1064  0.9649320,
1065  0.9674470,
1066  0.9728920,
1067  0.9774240,
1068  0.9827830,
1069  0.9874630,
1070  0.9926650,
1071  0.9966400,
1072  0.9993680,
1073  0.9999140,
1074  0.9942900,
1075  0.9882640,
1076  0.9810720,
1077  0.9751580,
1078  0.9699990,
1079  0.9659940,
1080  0.9632210,
1081  0.9624050,
1082  0.9621500,
1083  0.9633410,
1084  0.9654310,
1085  0.9671030,
1086  0.9672570,
1087  0.9677370,
1088  0.9653110,
1089  0.9633140,
1090  0.9579490,
1091  0.9533250,
1092  0.9486410,
1093  0.9423590,
1094  0.9358410,
1095  0.9299340,
1096  0.9243940,
1097  0.9190090,
1098  0.9141220,
1099  0.9087800,
1100  0.9039750,
1101  0.8980690,
1102  0.8927220,
1103  0.8870500,
1104  0.8828150,
1105  0.8771870,
1106  0.8734510,
1107  0.8694140,
1108  0.8664310,
1109  0.8660560,
1110  0.8588170,
1111  0.8477750,
1112  0.8331070,
1113  0.8135860,
1114  0.7865930,
1115  0.7489860,
1116  0.6981680,
1117  0.6306270,
1118  0.5506620,
1119  0.4616840,
1120  0.3695890,
1121  0.2823490,
1122  0.2074510,
1123  0.1465300,
1124  0.1010100,
1125  0.0686868,
1126  0.0471034,
1127  0.0324221,
1128  0.0246752,
1129  0.0174143,
1130  0.0126697,
1131  0.0116629,
1132  0.0086694,
1133  0.0081772,
1134  0.0000000,
1135  0.0000000,
1136  0.0000000,
1137  0.0000000,
1138  0.0000000,
1139  0.0000000,
1140  0.0000000,
1141  0.0000000,
1142  0.0000000,
1143  0.0000000,
1144  0.0000000,
1145  0.0000000,
1146  0.0000000,
1147  0.0000000,
1148  0.0000000,
1149  0.0000000,
1150  0.0000000,
1151  0.0000000,
1152  0.0000000,
1153  0.0000000,
1154  0.0000000,
1155  0.0000000,
1156  0.0000000,
1157  0.0000000,
1158  0.0000000,
1159  0.0000000,
1160  0.0000000,
1161  0.0000000,
1162  0.0000000,
1163  0.0000000,
1164  0.0000000,
1165  0.0000000,
1166  0.0000000,
1167  0.0000000,
1168  0.0000000,
1169  0.0000000,
1170  0.0000000,
1171  0.0000000,
1172  0.0000000,
1173  0.0000000
1174  };
1175  //add panchromatic band to the temporary list
1176  const std::vector<float> vpan (pan, pan + sizeof(pan) / sizeof(float) );
1177  tmpSpectralBandList.push_back(vpan);
1178  }
1179  else if (sensorId == "PHR 1B")
1180  {
1181  const float pan[209] =
1182  {
1183  8.4949016432e-06,1.27423524648e-05,2.54847049296e-05,4.10586912755e-05,5.94643115024e-05,7.64541147888e-05,
1184  0.0001047705,0.0001628184,0.0004077553,0.0007560434,0.0027948226,0.0055783471,
1185  0.0119863062,0.022134882,0.0389179761,0.0664188043,0.1067016279,0.1614272001,
1186  0.2272018077,0.2986552571,0.367815083,0.4258041132,0.4697397445,0.4991660838,
1187  0.5193159905,0.5332504608,0.5467262065,0.5603038909,0.5736437182,0.5855337488,
1188  0.5956625032,0.6041036038,0.6120151889,0.618774299,0.625564557,0.6319045853,
1189  0.6377943837,0.6421862479,0.6443949223,0.6448819633,0.644884795,0.6451141573,
1190  0.6468357907,0.6513182672,0.6590911022,0.6691405708,0.6811806781,0.6937021631,
1191  0.7056091836,0.7157690859,0.7250568451,0.7323511339,0.7384193253,0.7438758838,
1192  0.7492531566,0.7536450207,0.7580793594,0.7610893862,0.7639125252,0.7652348982,
1193  0.766172169,0.7665969141,0.767494542,0.7687546191,0.7723026564,0.7771079391,
1194  0.7833828397,0.7917191699,0.8015449394,0.8109516272,0.8200326771,0.8290684208,
1195  0.8364646485,0.8426517685,0.8481876127,0.8519168746,0.8555045547,0.8583361886,
1196  0.8620173126,0.8666838452,0.8715797402,0.8780188757,0.8847071949,0.8913473763,
1197  0.898890849,0.9045824331,0.9105090428,0.9154615705,0.9207935371,0.9253156564,
1198  0.9289882855,0.9328931087,0.9369565033,0.9400797954,0.9441601799,0.9469295178,
1199  0.9503472999,0.9521085762,0.9542804394,0.9574405428,0.9607705442,0.9663148834,
1200  0.9720999114,0.9788278735,0.9845959117,0.991221935,0.9956874216,0.9990882139,
1201  1.0,0.9963273709,0.9914682871,0.9869688209,0.9817019819,0.9771458829,
1202  0.9745974125,0.9729012638,0.9739319785,0.9741924888,0.9768712145,0.9798246086,
1203  0.9827723395,0.9845732586,0.9850772894,0.9837266001,0.9825967782,0.9790232562,
1204  0.9745945808,0.9697411603,0.9648141174,0.9598389367,0.9533346736,0.9483566613,
1205  0.9445481137,0.93968903,0.9344561706,0.9297160154,0.9248342786,0.9183356789,
1206  0.9111942982,0.9061001889,0.9006181457,0.8953456434,0.8908093659,0.8894954878,
1207  0.8885412272,0.8809779331,0.8707840511,0.8566683562,0.8369346997,0.8102408871,
1208  0.7728519933,0.718954674,0.6528501811,0.5710810895,0.4795853355,0.3846491464,
1209  0.294773087,0.2166449103,0.1531319287,0.1057054591,0.0716799801,0.0491432892,
1210  0.0337757289,0.0256986066,0.0181762579,0.0131968863,0.0121562043,0.0090201414,
1211  0.0084156159,0.0042799863,0.0033130116,0.0026688064,0.0022115061,0.0018292327,
1212  0.0015290823,0.0013634289,0.0012147709,0.0011015056,0.0009939035,0.0009188652,
1213  0.0008523218,0.0008225925,0.0006965819,0.0007220666,0.0006682656,0.0006470283,
1214  0.0006144646,0.000603138,0.0006116329,0.0005578319,0.0005295155,0.0005295155,
1215  0.0005210206,0.0005054466,0.0004473982,0.0004473953,0.0004077553,0.0004558931,
1216  0.0004077553,0.0004346558,0.0003766073,0.0003851022,0.0003879338,0.0003723599,
1217  0.0003341328,0.0003723599,0.0003313012,0.0003341328,0.0003143114
1218  };
1219  //add panchromatic band to the temporary list
1220  const std::vector<float> vpan (pan, pan + sizeof(pan) / sizeof(float) );
1221  tmpSpectralBandList.push_back(vpan);
1222  }
1223  else
1224  {
1225  itkExceptionMacro(<< "Invalid Pleiades Sensor ID");
1226  }
1227  }
1228  else if (nbBands > 1 && nbBands < 5)
1229  {
1230  if (sensorId == "PHR 1A")
1231  {
1232  //band B0 (blue band)
1233  const float b0[209] =
1234  {
1235  0.0098681,
1236  0.0293268,
1237  0.0877320,
1238  0.1287040,
1239  0.1341240,
1240  0.2457050,
1241  0.4345520,
1242  0.5133040,
1243  0.4710970,
1244  0.5125880,
1245  0.6530370,
1246  0.7707870,
1247  0.7879420,
1248  0.7648330,
1249  0.7718380,
1250  0.8013290,
1251  0.8240790,
1252  0.8352890,
1253  0.8326150,
1254  0.8249150,
1255  0.8168160,
1256  0.8163380,
1257  0.8285420,
1258  0.8623820,
1259  0.9075060,
1260  0.9379000,
1261  0.9505710,
1262  0.9572260,
1263  0.9650570,
1264  0.9632790,
1265  0.9587260,
1266  0.9567320,
1267  0.9646760,
1268  0.9804620,
1269  0.9900240,
1270  0.9838940,
1271  0.9719110,
1272  0.9715280,
1273  0.9574890,
1274  0.8770130,
1275  0.7103910,
1276  0.4943810,
1277  0.3021990,
1278  0.1722720,
1279  0.0943537,
1280  0.0543895,
1281  0.0345732,
1282  0.0261018,
1283  0.0230010,
1284  0.0223203,
1285  0.0210136,
1286  0.0173172,
1287  0.0119112,
1288  0.0072895,
1289  0.0046311,
1290  0.0033297,
1291  0.0025865,
1292  0.0020232,
1293  0.0015030,
1294  0.0010527,
1295  0.0007044,
1296  0.0005199,
1297  0.0004117,
1298  0.0004097,
1299  0.0005317,
1300  0.0009532,
1301  0.0013521,
1302  0.0014273,
1303  0.0009182,
1304  0.0003440,
1305  0.0001323,
1306  0.0000783,
1307  0.0000626,
1308  0.0000511,
1309  0.0000538,
1310  0.0000533,
1311  0.0000454,
1312  0.0000404,
1313  0.0000315,
1314  0.0000327,
1315  0.0000262,
1316  0.0000303,
1317  0.0000206,
1318  0.0000241,
1319  0.0000241,
1320  0.0000273,
1321  0.0000258,
1322  0.0000208,
1323  0.0000341,
1324  0.0000379,
1325  0.0000393,
1326  0.0000429,
1327  0.0000281,
1328  0.0000277,
1329  0.0000187,
1330  0.0000272,
1331  0.0000245,
1332  0.0000209,
1333  0.0000137,
1334  0.0000171,
1335  0.0000257,
1336  0.0000300,
1337  0.0000330,
1338  0.0000446,
1339  0.0000397,
1340  0.0000399,
1341  0.0000384,
1342  0.0000336,
1343  0.0000307,
1344  0.0000300,
1345  0.0000242,
1346  0.0000224,
1347  0.0000210,
1348  0.0000325,
1349  0.0000690,
1350  0.0002195,
1351  0.0005063,
1352  0.0008373,
1353  0.0009464,
1354  0.0007099,
1355  0.0004910,
1356  0.0004433,
1357  0.0006064,
1358  0.0012019,
1359  0.0016241,
1360  0.0016779,
1361  0.0009733,
1362  0.0003606,
1363  0.0001659,
1364  0.0000864,
1365  0.0000564,
1366  0.0000562,
1367  0.0000590,
1368  0.0000458,
1369  0.0000382,
1370  0.0000586,
1371  0.0000685,
1372  0.0000474,
1373  0.0000872,
1374  0.0000628,
1375  0.0000948,
1376  0.0001015,
1377  0.0001564,
1378  0.0002379,
1379  0.0003493,
1380  0.0005409,
1381  0.0007229,
1382  0.0007896,
1383  0.0007188,
1384  0.0005204,
1385  0.0003939,
1386  0.0003128,
1387  0.0002699,
1388  0.0002605,
1389  0.0002378,
1390  0.0002286,
1391  0.0002406,
1392  0.0002741,
1393  0.0003203,
1394  0.0003812,
1395  0.0004904,
1396  0.0006077,
1397  0.0008210,
1398  0.0011791,
1399  0.0018150,
1400  0.0030817,
1401  0.0055589,
1402  0.0103652,
1403  0.0166309,
1404  0.0211503,
1405  0.0216246,
1406  0.0176910,
1407  0.0136927,
1408  0.0107136,
1409  0.0089555,
1410  0.0079790,
1411  0.0079189,
1412  0.0080456,
1413  0.0088920,
1414  0.0102062,
1415  0.0126157,
1416  0.0162251,
1417  0.0221306,
1418  0.0308295,
1419  0.0411980,
1420  0.0498232,
1421  0.0531265,
1422  0.0484487,
1423  0.0391122,
1424  0.0291405,
1425  0.0212633,
1426  0.0162146,
1427  0.0128925,
1428  0.0108169,
1429  0.0094115,
1430  0.0084386,
1431  0.0077249,
1432  0.0074231,
1433  0.0072603,
1434  0.0073459,
1435  0.0074214,
1436  0.0076433,
1437  0.0077788,
1438  0.0078151,
1439  0.0077003,
1440  0.0072256,
1441  0.0065903,
1442  0.0057120,
1443  0.0048136
1444  };
1445  //B1 green band
1446  const float b1[209] =
1447  {
1448  0.0000144,
1449  0.0000143,
1450  0.0000259,
1451  0.0000189,
1452  0.0000132,
1453  0.0000179,
1454  0.0000224,
1455  0.0000179,
1456  0.0000124,
1457  0.0000202,
1458  0.0000276,
1459  0.0000292,
1460  0.0000420,
1461  0.0000366,
1462  0.0000261,
1463  0.0000247,
1464  0.0000445,
1465  0.0000902,
1466  0.0001144,
1467  0.0000823,
1468  0.0000778,
1469  0.0001923,
1470  0.0003401,
1471  0.0004085,
1472  0.0004936,
1473  0.0007849,
1474  0.0045979,
1475  0.0085122,
1476  0.0143014,
1477  0.0243310,
1478  0.0480572,
1479  0.1097360,
1480  0.2353890,
1481  0.4328370,
1482  0.6491340,
1483  0.8095770,
1484  0.8847680,
1485  0.9066640,
1486  0.9131150,
1487  0.9186700,
1488  0.9273270,
1489  0.9405210,
1490  0.9512930,
1491  0.9587500,
1492  0.9667360,
1493  0.9709750,
1494  0.9728630,
1495  0.9769560,
1496  0.9850710,
1497  0.9892500,
1498  0.9865960,
1499  0.9743300,
1500  0.9575190,
1501  0.9435550,
1502  0.9439310,
1503  0.9571350,
1504  0.9712530,
1505  0.9761580,
1506  0.9619590,
1507  0.9244890,
1508  0.8734580,
1509  0.8349840,
1510  0.8166740,
1511  0.8015960,
1512  0.7435910,
1513  0.6160350,
1514  0.4321320,
1515  0.2544540,
1516  0.1360870,
1517  0.0769553,
1518  0.0479321,
1519  0.0342014,
1520  0.0266703,
1521  0.0212632,
1522  0.0160541,
1523  0.0106967,
1524  0.0060543,
1525  0.0030797,
1526  0.0015416,
1527  0.0008333,
1528  0.0004706,
1529  0.0002918,
1530  0.0001917,
1531  0.0001472,
1532  0.0001063,
1533  0.0000912,
1534  0.0000589,
1535  0.0000552,
1536  0.0000752,
1537  0.0000884,
1538  0.0000985,
1539  0.0001125,
1540  0.0001368,
1541  0.0001947,
1542  0.0002284,
1543  0.0002088,
1544  0.0001498,
1545  0.0000637,
1546  0.0000307,
1547  0.0000283,
1548  0.0000311,
1549  0.0000331,
1550  0.0000215,
1551  0.0000236,
1552  0.0000205,
1553  0.0000186,
1554  0.0000233,
1555  0.0000233,
1556  0.0000198,
1557  0.0000195,
1558  0.0000161,
1559  0.0000308,
1560  0.0000464,
1561  0.0000290,
1562  0.0000264,
1563  0.0000233,
1564  0.0000395,
1565  0.0001113,
1566  0.0001903,
1567  0.0002290,
1568  0.0002229,
1569  0.0001322,
1570  0.0000548,
1571  0.0000608,
1572  0.0000414,
1573  0.0000382,
1574  0.0000381,
1575  0.0000269,
1576  0.0000233,
1577  0.0000198,
1578  0.0000208,
1579  0.0000302,
1580  0.0000419,
1581  0.0000305,
1582  0.0000340,
1583  0.0000334,
1584  0.0000362,
1585  0.0000282,
1586  0.0000337,
1587  0.0000330,
1588  0.0000424,
1589  0.0000420,
1590  0.0000470,
1591  0.0000417,
1592  0.0000233,
1593  0.0000439,
1594  0.0000503,
1595  0.0000446,
1596  0.0000428,
1597  0.0000597,
1598  0.0000671,
1599  0.0001142,
1600  0.0001780,
1601  0.0003546,
1602  0.0009610,
1603  0.0041260,
1604  0.0066679,
1605  0.0078563,
1606  0.0068645,
1607  0.0029441,
1608  0.0011320,
1609  0.0007028,
1610  0.0005471,
1611  0.0004967,
1612  0.0004929,
1613  0.0005351,
1614  0.0006223,
1615  0.0007957,
1616  0.0010708,
1617  0.0016699,
1618  0.0030334,
1619  0.0054959,
1620  0.0091390,
1621  0.0125045,
1622  0.0144212,
1623  0.0141099,
1624  0.0117418,
1625  0.0089824,
1626  0.0067916,
1627  0.0056849,
1628  0.0051998,
1629  0.0053640,
1630  0.0060350,
1631  0.0067668,
1632  0.0083174,
1633  0.0106521,
1634  0.0139110,
1635  0.0183736,
1636  0.0231289,
1637  0.0272661,
1638  0.0298126,
1639  0.0300318,
1640  0.0286507,
1641  0.0266172,
1642  0.0247529,
1643  0.0236974,
1644  0.0232734,
1645  0.0236733,
1646  0.0245808,
1647  0.0257173,
1648  0.0267721,
1649  0.0267455,
1650  0.0254447,
1651  0.0227056,
1652  0.0188513,
1653  0.0147988,
1654  0.0109864,
1655  0.0079795,
1656  0.0057516
1657  };
1658  //B2 red band
1659  const float b2[209] =
1660  {
1661  0.0097386,
1662  0.0035306,
1663  0.0035374,
1664  0.0114418,
1665  0.0266686,
1666  0.0373494,
1667  0.0904431,
1668  0.0907580,
1669  0.0399312,
1670  0.0208748,
1671  0.0080694,
1672  0.0027002,
1673  0.0011241,
1674  0.0006460,
1675  0.0005029,
1676  0.0006051,
1677  0.0009979,
1678  0.0019446,
1679  0.0014554,
1680  0.0006090,
1681  0.0003230,
1682  0.0002503,
1683  0.0002538,
1684  0.0003360,
1685  0.0005377,
1686  0.0007773,
1687  0.0004895,
1688  0.0002045,
1689  0.0000875,
1690  0.0000594,
1691  0.0000217,
1692  0.0000290,
1693  0.0000297,
1694  0.0000408,
1695  0.0000456,
1696  0.0000447,
1697  0.0000322,
1698  0.0000222,
1699  0.0000147,
1700  0.0000095,
1701  0.0000072,
1702  0.0000113,
1703  0.0000313,
1704  0.0000123,
1705  0.0000122,
1706  0.0000280,
1707  0.0000180,
1708  0.0000261,
1709  0.0000138,
1710  0.0000392,
1711  0.0000517,
1712  0.0000695,
1713  0.0000797,
1714  0.0000785,
1715  0.0001004,
1716  0.0001170,
1717  0.0001483,
1718  0.0001837,
1719  0.0002110,
1720  0.0002973,
1721  0.0004162,
1722  0.0006371,
1723  0.0010012,
1724  0.0032888,
1725  0.0100109,
1726  0.0181837,
1727  0.0330510,
1728  0.0624784,
1729  0.1183670,
1730  0.2218740,
1731  0.3756820,
1732  0.5574830,
1733  0.7342220,
1734  0.8636840,
1735  0.9319920,
1736  0.9527010,
1737  0.9620090,
1738  0.9527340,
1739  0.9437220,
1740  0.9456300,
1741  0.9562330,
1742  0.9693120,
1743  0.9839640,
1744  0.9949160,
1745  0.9992700,
1746  0.9993300,
1747  0.9963430,
1748  0.9944130,
1749  0.9883050,
1750  0.9857580,
1751  0.9807560,
1752  0.9683790,
1753  0.9544700,
1754  0.9371750,
1755  0.9170350,
1756  0.8922820,
1757  0.8662710,
1758  0.8442750,
1759  0.8220420,
1760  0.7888070,
1761  0.7372920,
1762  0.6625080,
1763  0.5662120,
1764  0.4493120,
1765  0.3260000,
1766  0.2194040,
1767  0.1416500,
1768  0.0925669,
1769  0.0619437,
1770  0.0456444,
1771  0.0355683,
1772  0.0310879,
1773  0.0295168,
1774  0.0233351,
1775  0.0189628,
1776  0.0158627,
1777  0.0132266,
1778  0.0107473,
1779  0.0083969,
1780  0.0063847,
1781  0.0046601,
1782  0.0033814,
1783  0.0024167,
1784  0.0017478,
1785  0.0012949,
1786  0.0009939,
1787  0.0007442,
1788  0.0006312,
1789  0.0005142,
1790  0.0004354,
1791  0.0003549,
1792  0.0003156,
1793  0.0003079,
1794  0.0002906,
1795  0.0002867,
1796  0.0002751,
1797  0.0003048,
1798  0.0003010,
1799  0.0003342,
1800  0.0004310,
1801  0.0004955,
1802  0.0005488,
1803  0.0005838,
1804  0.0006687,
1805  0.0006968,
1806  0.0006650,
1807  0.0005866,
1808  0.0004688,
1809  0.0004086,
1810  0.0003611,
1811  0.0002404,
1812  0.0002609,
1813  0.0002476,
1814  0.0002133,
1815  0.0002098,
1816  0.0001916,
1817  0.0001642,
1818  0.0001799,
1819  0.0002180,
1820  0.0002003,
1821  0.0002030,
1822  0.0002348,
1823  0.0002735,
1824  0.0002652,
1825  0.0002944,
1826  0.0004666,
1827  0.0004882,
1828  0.0006642,
1829  0.0007798,
1830  0.0010588,
1831  0.0014008,
1832  0.0019011,
1833  0.0024917,
1834  0.0034379,
1835  0.0042182,
1836  0.0053618,
1837  0.0062814,
1838  0.0068774,
1839  0.0071141,
1840  0.0070399,
1841  0.0065876,
1842  0.0067873,
1843  0.0066877,
1844  0.0068572,
1845  0.0070486,
1846  0.0073911,
1847  0.0081201,
1848  0.0087391,
1849  0.0096581,
1850  0.0106625,
1851  0.0120129,
1852  0.0137222,
1853  0.0159817,
1854  0.0180896,
1855  0.0206562,
1856  0.0236408,
1857  0.0269627,
1858  0.0310497,
1859  0.0353146,
1860  0.0398729,
1861  0.0438795,
1862  0.0462377,
1863  0.0454916,
1864  0.0408754,
1865  0.0333175,
1866  0.0251186,
1867  0.0179089,
1868  0.0125129,
1869  0.0086117
1870  };
1871  //B3 nir band
1872  const float b3[209] =
1873  {
1874  0.0024163,
1875  0.0017305,
1876  0.0020803,
1877  0.0020499,
1878  0.0012660,
1879  0.0007361,
1880  0.0006198,
1881  0.0006344,
1882  0.0007721,
1883  0.0011837,
1884  0.0020819,
1885  0.0023991,
1886  0.0013377,
1887  0.0006328,
1888  0.0003544,
1889  0.0002890,
1890  0.0002498,
1891  0.0002541,
1892  0.0003346,
1893  0.0005048,
1894  0.0008684,
1895  0.0009871,
1896  0.0006587,
1897  0.0003833,
1898  0.0002606,
1899  0.0002356,
1900  0.0002364,
1901  0.0002791,
1902  0.0003613,
1903  0.0005575,
1904  0.0007414,
1905  0.0007413,
1906  0.0005768,
1907  0.0004230,
1908  0.0003206,
1909  0.0003044,
1910  0.0003019,
1911  0.0003201,
1912  0.0003813,
1913  0.0004630,
1914  0.0005930,
1915  0.0007080,
1916  0.0008577,
1917  0.0009017,
1918  0.0008813,
1919  0.0007801,
1920  0.0006583,
1921  0.0005863,
1922  0.0005224,
1923  0.0005506,
1924  0.0006403,
1925  0.0008293,
1926  0.0013444,
1927  0.0023942,
1928  0.0027274,
1929  0.0014330,
1930  0.0006388,
1931  0.0003596,
1932  0.0002416,
1933  0.0001718,
1934  0.0001566,
1935  0.0001642,
1936  0.0001892,
1937  0.0002351,
1938  0.0003227,
1939  0.0006734,
1940  0.0014311,
1941  0.0013325,
1942  0.0005796,
1943  0.0002424,
1944  0.0001263,
1945  0.0001022,
1946  0.0000446,
1947  0.0000652,
1948  0.0000544,
1949  0.0000573,
1950  0.0000518,
1951  0.0000504,
1952  0.0000649,
1953  0.0000723,
1954  0.0000833,
1955  0.0000739,
1956  0.0000691,
1957  0.0001382,
1958  0.0001692,
1959  0.0002240,
1960  0.0002296,
1961  0.0001553,
1962  0.0001492,
1963  0.0001121,
1964  0.0001058,
1965  0.0001068,
1966  0.0001012,
1967  0.0000864,
1968  0.0000533,
1969  0.0000354,
1970  0.0000440,
1971  0.0000371,
1972  0.0000691,
1973  0.0000769,
1974  0.0000791,
1975  0.0001333,
1976  0.0001244,
1977  0.0002048,
1978  0.0002455,
1979  0.0002721,
1980  0.0003812,
1981  0.0004568,
1982  0.0006255,
1983  0.0008185,
1984  0.0009733,
1985  0.0012281,
1986  0.0013528,
1987  0.0015758,
1988  0.0017458,
1989  0.0019104,
1990  0.0020863,
1991  0.0023053,
1992  0.0025241,
1993  0.0037234,
1994  0.0044186,
1995  0.0053574,
1996  0.0066118,
1997  0.0083509,
1998  0.0107509,
1999  0.0150393,
2000  0.0212756,
2001  0.0292566,
2002  0.0414246,
2003  0.0586633,
2004  0.0834879,
2005  0.1190380,
2006  0.1671850,
2007  0.2326370,
2008  0.3124060,
2009  0.4070470,
2010  0.5091930,
2011  0.6148270,
2012  0.7140870,
2013  0.8017550,
2014  0.8714840,
2015  0.9241260,
2016  0.9587210,
2017  0.9782990,
2018  0.9882040,
2019  0.9922940,
2020  0.9902030,
2021  0.9854020,
2022  0.9777560,
2023  0.9660200,
2024  0.9532070,
2025  0.9421250,
2026  0.9303560,
2027  0.9241490,
2028  0.9212220,
2029  0.9203820,
2030  0.9217020,
2031  0.9227420,
2032  0.9230000,
2033  0.9237670,
2034  0.9243070,
2035  0.9206520,
2036  0.9154840,
2037  0.9090910,
2038  0.9003380,
2039  0.8905620,
2040  0.8776420,
2041  0.8668600,
2042  0.8537290,
2043  0.8428590,
2044  0.8305310,
2045  0.8195740,
2046  0.8069090,
2047  0.7921080,
2048  0.7791670,
2049  0.7660510,
2050  0.7521190,
2051  0.7375270,
2052  0.7217320,
2053  0.7043220,
2054  0.6853170,
2055  0.6642500,
2056  0.6413850,
2057  0.6173030,
2058  0.5919540,
2059  0.5672310,
2060  0.5430130,
2061  0.5184560,
2062  0.4957540,
2063  0.4734340,
2064  0.4528220,
2065  0.4332270,
2066  0.4131920,
2067  0.3919120,
2068  0.3659660,
2069  0.3325420,
2070  0.2917680,
2071  0.2453910,
2072  0.1962540,
2073  0.1486850,
2074  0.1068860,
2075  0.0738260,
2076  0.0491777,
2077  0.0327991,
2078  0.0215831,
2079  0.0145386,
2080  0.0103219,
2081  0.0076144,
2082  0.0061346
2083  };
2084  //Add multispectral bands to the temporary list
2085  const std::vector<float> vb0 (b0, b0 + sizeof(b0) / sizeof(float) );
2086  const std::vector<float> vb1 (b1, b1 + sizeof(b1) / sizeof(float) );
2087  const std::vector<float> vb2 (b2, b2 + sizeof(b2) / sizeof(float) );
2088  const std::vector<float> vb3 (b3, b3 + sizeof(b3) / sizeof(float) );
2089  //For Pleiades MS image the order of band in 1A product is: B2 B1 B0 B3
2090  //(BandIndexToWavelength method could be used here)
2091  tmpSpectralBandList.push_back(vb2);
2092  tmpSpectralBandList.push_back(vb1);
2093  tmpSpectralBandList.push_back(vb0);
2094  tmpSpectralBandList.push_back(vb3);
2095  }
2096  else if (sensorId == "PHR 1B")
2097  {
2098  //B0 blue band
2099  const float b0[209] =
2100  {0.0016025229,0.0013381709,0.0043437933,0.0110724631,0.0176270388,0.0233671533,
2101  0.057403285,0.1345548468,0.2237631463,0.3085427458,0.4615565735,0.650820526,
2102  0.755369094,0.7477203647,0.7168186424,0.7185381794,0.7566962056,0.8101088802,
2103  0.842166474,0.8234370764,0.775247228,0.7527006008,0.7802203291,0.8199266521,
2104  0.8516631705,0.8602751259,0.858684019,0.8658261626,0.8828217532,0.9040412689,
2105  0.9196954778,0.9325955734,0.9502333148,0.9757980507,0.9949769539,1.0,
2106  0.995062574,0.9806284516,0.9417497895,0.8436220158,0.6711424576,0.4633403256,
2107  0.2888651055,0.1670783567,0.0901800876,0.0505194286,0.0314882201,0.0238137335,
2108  0.0213108438,0.0206298072,0.0195599127,0.0167943833,0.0113582202,0.0066519685,
2109  0.004144013,0.0030298814,0.0024159139,0.0019903178,0.0015682749,0.0011355438,
2110  0.0012529075,0.0008355166,0.0005508227,0.000419896,0.0003617449,0.000377798,
2111  0.0005322716,0.0011091514,0.0019870999,0.0012200722,0.0003753015,0.0001469798,
2112  7.49175906503e-05,5.2799e-05,5.56530673402e-05,5.74373902992e-05,5.63665682035e-05,3.78155457568e-05,
2113  3.49615423035e-05,2.06915250367e-05,1.35565164034e-05,1.99783095738e-05,4.281e-06,1.10591920316e-05,
2114  1.21295146767e-05,1.14159424633e-05,9.27551122337e-06,1.1773e-05,1.92645233101e-05,8.919e-06,
2115  1.1416e-05,1.71237353197e-05,4.99450604335e-06,8.56172495969e-06,2.4259e-05,3.85286898697e-05,
2116  1.2843e-05,2.35456711903e-05,9.989e-06,1.14162992137e-05,2.06915250367e-05,1.39132668351e-05,
2117  5.708e-06,2.854e-06,8.562e-06,1.24862651084e-05,8.562e-06,9.27565392354e-06,
2118  6.42150777002e-06,1.1773e-05,5.708e-06,1.35566591036e-05,1.7124e-05,7.13522268362e-06,
2119  9.989e-06,2.71133895572e-05,6.35015768369e-05,0.0002194051,0.0007613054,0.0011194829,
2120  0.0007541704,0.0004084771,0.0003546099,0.0004063402,0.0006792528,0.0016292935,
2121  0.0024002169,0.0010317222,0.0003481884,0.000165889,8.2766100147e-05,9.70361174137e-05,
2122  4.63775561168e-05,2.63994605933e-05,3.21075388501e-05,4.1026442342e-05,1.5697e-05,8.9192602423e-06,
2123  4.70910569802e-05,7.88411318978e-05,2.21185267634e-05,5.35134923013e-05,8.2766100147e-05,0.0001052421,
2124  0.0001833697,0.00026043,0.000441657,0.000710293,0.000864763,0.0007370464,
2125  0.0005515362,0.000394566,0.0002811193,0.0002340283,0.0002247528,0.0001922885,
2126  0.0002197583,0.0002340276,0.0002454443,0.0002454436,0.0002782653,0.000350685,
2127  0.000431668,0.0005326263,0.0006885283,0.0010277909,0.0015625669,0.0026085734,
2128  0.0045749675,0.0090618891,0.0171625498,0.0237927565,0.021523467,0.0159138519,
2129  0.011956134,0.0094824265,0.007869201,0.0072241962,0.0072420338,0.0075677469,
2130  0.0083793541,0.0098637927,0.0122586583,0.0162673916,0.0226015668,0.0320271273,
2131  0.0444304123,0.0546690783,0.0564243618,0.048004124,0.0357991923,0.0258336544,
2132  0.0188870814,0.0144386889,0.0116792956,0.0099112405,0.008646917,0.0078099805,
2133  0.0072270502,0.006995876,0.0069230989,0.0069141801,0.0070208485,0.0072527363,
2134  0.0073726044,0.0075049588,0.007470354,0.0070672332,0.0063679952
2135  };
2136  //B1 green band
2137  const float b1[209] =
2138  {3.2793605247e-06,3.2793605247e-06,4.919e-06,6.5587210494e-06,6.5587210494e-06,2.86944045911e-06,
2139  6.5587210494e-06,5.73885632302e-06,4.09920065587e-06,2.86943226071e-06,1.47571223611e-05,2.29553597049e-05,
2140  1.06579217053e-05,1.27075220332e-05,2.21356835417e-05,1.8856323017e-05,9.01824144292e-05,0.0001151875,
2141  0.0001123181,0.0001893831,0.000323017,0.0004849346,0.0006238983,0.0008153327,
2142  0.0015208034,0.0041299447,0.009953679,0.0196421398,0.0325476532,0.0567927854,
2143  0.1237909408,0.2859094077,0.5289756098,0.7716253331,0.8838040582,0.9079565485,
2144  0.9131461365,0.913728223,0.9224841156,0.9367083419,0.9497601968,0.9544988727,
2145  0.9585816766,0.9642057799,0.9705267473,0.9722648084,0.967517934,0.9589096126,
2146  0.9524492724,0.9524656692,0.9560483706,0.95517934,0.948989547,0.9471449067,
2147  0.9544496823,0.9710596434,0.9898175856,1.0,0.9953597049,0.9698216848,
2148  0.9253043656,0.8633244517,0.7948284485,0.7238967001,0.6453265013,0.5438524288,
2149  0.4170280795,0.2766706292,0.1575273622,0.0856068867,0.049225661,0.0327237549,
2150  0.0237934003,0.0181966796,0.0140618979,0.0099658947,0.0058454601,0.0030383275,
2151  0.0015355606,0.0008386965,0.0004878049,0.0003115409,0.0002074196,0.0001381439,
2152  9.26419348227e-05,7.00964131994e-05,6.39475302316e-05,5.41093666735e-05,4.0992e-05,7.00968231195e-05,
2153  4.75507276081e-05,4.71408895265e-05,6.23078499693e-05,6.72277925804e-05,0.0001483911,0.0002512826,
2154  0.0002992416,0.0002303743,0.0001270752,6.72265628203e-05,3.11539249846e-05,3.15638450502e-05,
2155  1.72166427547e-05,6.5587210494e-06,5.73888091822e-06,1.76265628203e-05,1.06579217053e-05,1.72168067227e-05,
2156  1.14777618364e-05,2.86946505431e-06,3.2793605247e-06,2.86941586391e-06,1.393728223e-05,1.27072760812e-05,
2157  1.72166427547e-05,9.83840951015e-06,7.37856118057e-06,2.41853658537e-05,3.2793605247e-05,0.0001295372,
2158  0.000277106,0.0001893831,0.0001237959,2.4185e-05,7.37856118057e-06,7.37870875179e-06,
2159  4.09920065587e-06,1.0248e-05,9.83808157409e-06,3.2793605247e-06,1.5577e-05,2.29556056569e-05,
2160  7.37856118057e-06,1.02477556876e-05,9.01824144292e-06,6.96851813896e-06,1.72166427547e-05,2.29553597049e-05,
2161  2.45952039352e-06,2.1315e-05,9.83808157409e-06,1.1887763886e-05,3.44332855093e-05,9.01856937897e-06,
2162  1.80364828858e-05,1.72165607706e-05,1.8856323017e-05,1.8037e-05,2.86944045911e-05,2.86944865751e-05,
2163  2.0496e-05,4.34515269522e-05,2.95142447223e-05,5.28796884608e-05,9.34617749539e-05,0.0001336339,
2164  0.000277106,0.0007050527,0.0031850789,0.0141905308,0.0083394138,0.0022443452,
2165  0.0009182209,0.000571841,0.0004369748,0.0004029514,0.0004181185,0.000445174,
2166  0.0005173191,0.0006021734,0.0007575323,0.0011108916,0.0019381021,0.0036905349,
2167  0.0063570404,0.0102714491,0.013107604,0.0132605042,0.0111153925,0.0083664685,
2168  0.0065644599,0.0056847797,0.0053797909,0.0056228653,0.0062004509,0.007239172,
2169  0.0089198606,0.0115101455,0.0149415864,0.0192686206,0.0234785817,0.0264402542,
2170  0.0270489854,0.0255453986,0.0233974175,0.0213945481,0.0199442509,0.0192531256,
2171  0.0190744005,0.0196892806,0.0206935848,0.0220106579,0.0232301701,0.0237573273,
2172  0.0229858578,0.0206595614,0.0172248412,0.01329215,0.0097815126
2173  };
2174  //B2 red band
2175  const float b2[209] =
2176  {0.0004536879,0.0008531472,0.000520901,0.0011945588,0.0051417966,0.0080033148,
2177  0.0066930427,0.0108594102,0.0246908583,0.0653593224,0.1225423328,0.0570092494,
2178  0.0213752702,0.0127972076,0.006277544,0.0023536016,0.0009409824,0.0005174639,
2179  0.0003742544,0.0003818922,0.0005155545,0.0008462731,0.0010127781,0.0006431042,
2180  0.0003513408,0.0002512851,0.000223025,0.000251667,0.0003551597,0.0004998969,
2181  0.0005262475,0.0003864772,0.0002528126,0.0001626868,0.0001069298,8.78352058781e-05,
2182  7.02681647025e-05,5.84297356542e-05,5.49924767237e-05,4.81185698901e-05,3.66616511491e-05,3.20791738908e-05,
2183  1.90946099735e-05,1.79493916457e-05,3.74254355481e-05,2.40590558097e-05,3.43702979523e-05,1.48934902656e-05,
2184  6.87405959046e-06,7.256e-06,3.8189219947e-06,2.29135319682e-06,9.16541278728e-06,2.94056993592e-05,
2185  2.36773163671e-05,2.90238071597e-05,3.8953e-05,4.5063e-05,6.95043803035e-05,8.13422747027e-05,
2186  0.0001038747,0.0001229693,0.0001351898,0.0001535207,0.0001833083,0.0002214967,
2187  0.0007454536,0.0012442124,0.0021416515,0.0038193268,0.0068045552,0.0123329031,
2188  0.0221780076,0.0413324983,0.0780709861,0.151934284,0.277674582,0.4510376011,
2189  0.6291322645,0.7625485958,0.8329450763,0.8579055504,0.8658870974,0.8692630244,
2190  0.8752205427,0.8857760431,0.9005934605,0.9174883714,0.9348797421,0.947810612,
2191  0.9569531113,0.9623301534,0.9647666257,0.9624294454,0.9613066823,0.9620246397,
2192  0.9699145325,0.9811574389,0.9933932649,1.0,0.9809512171,0.9522634751,
2193  0.9131729895,0.8694005056,0.8252079403,0.7830470415,0.7361270021,0.6734890435,
2194  0.5877527172,0.4804914189,0.3630068664,0.2523031919,0.1626028245,0.102221085,
2195  0.0641273381,0.0419155713,0.0284639532,0.0204548336,0.0153696335,0.0121174395,
2196  0.0098810788,0.0083168483,0.0071016673,0.0060949919,0.0051723479,0.0043142285,
2197  0.0034950774,0.0027713917,0.0035890229,0.0030310784,0.0023173219,0.001784208,
2198  0.0013312762,0.0010207978,0.0007897531,0.0006385253,0.0005079166,0.0004120624,
2199  0.0003788371,0.0003593606,0.0002978759,0.0002787813,0.0002810727,0.0002623607,
2200  0.0002856554,0.0002948208,0.0002757262,0.0003158256,0.0003750181,0.0004296295,
2201  0.0005186096,0.0005747478,0.0006194291,0.0006503624,0.0006515081,0.0006041535,
2202  0.0005369404,0.0004643817,0.0003765457,0.0003215532,0.0002841278,0.0002539583,
2203  0.000226844,0.0002226432,0.0001672688,0.0001978194,0.0002207337,0.000208895,
2204  0.0002329542,0.0002054572,0.0001871272,0.0002505213,0.0002932932,0.0002635079,
2205  0.0002589229,0.000449106,0.0005361766,0.000566728,0.0008210682,0.0009856638,
2206  0.0013075989,0.0017612792,0.0024028657,0.0032682258,0.0043635003,0.0056615366,
2207  0.0068900991,0.0078222979,0.0083298327,0.0084363806,0.0081854774,0.0081381228,
2208  0.0080006416,0.0077676873,0.0077844906,0.0079983502,0.0081518709,0.008505885,
2209  0.008792686,0.0093120594,0.009752763,0.0101358009,0.0103874678,0.0104061805,
2210  0.0101713168,0.009522482,0.008608614,0.0073373101,0.0059842508
2211  };
2212  //B3 nir band
2213  const float b3[209] =
2214  {0.0001962709,0.0007612586,0.0003823311,0.0005128001,0.0016870217,0.0026649725,
2215  0.0012252747,0.0007391367,0.0007408374,0.0007538843,0.0007760073,0.0009904326,
2216  0.0015486111,0.0021799679,0.0019876678,0.001044887,0.0004923789,0.0002830611,
2217  0.0002144231,0.0001957036,0.0002132886,0.0002819266,0.000417501,0.0006069659,
2218  0.0006410002,0.000437355,0.0002654762,0.0001905983,0.0001622354,0.0001707443,
2219  0.0001849257,0.0002461883,0.0003834656,0.0005627165,0.0006784391,0.0006143403,
2220  0.0004844373,0.0003880048,0.0003596408,0.000353401,0.0003970798,0.0004623154,
2221  0.0005513736,0.0006410013,0.0007306268,0.0007572878,0.0007669312,0.0007192805,
2222  0.0006364621,0.0005706603,0.0005286833,0.0004878409,0.0004764957,0.0005519409,
2223  0.0007181471,0.0012241402,0.0022656237,0.0028788283,0.00204099,0.0008389819,
2224  0.0003789275,0.0002252021,0.0001395452,0.0001242292,9.98371972976e-05,9.70007998321e-05,
2225  0.0001043753,0.0001242292,0.0001724461,0.000286467,0.0005275488,0.0008208217,
2226  0.0006602869,0.0003221996,0.000167908,0.0001032404,6.80708163393e-05,5.72929370855e-05,
2227  4.76495714375e-05,3.23336377612e-05,3.63044353809e-05,4.14097466064e-05,4.4246e-05,3.91404924924e-05,
2228  5.78601938884e-05,6.35326484653e-05,6.2398248311e-05,9.01938316495e-05,0.0001009717,0.0001525921,
2229  0.0001917328,0.0001968381,0.0001860602,0.0001429487,0.0001361416,9.47317726208e-05,
2230  8.96265748467e-05,8.79249178896e-05,7.9416e-05,7.54452682274e-05,7.60124115788e-05,8.50885204241e-05,
2231  9.41646292693e-05,8.22522364099e-05,8.1685e-05,0.0001066443,0.000121393,0.0001350071,
2232  0.0001690425,0.0002036441,0.0002507275,0.0003187972,0.0003970798,0.000508261,
2233  0.0006330586,0.000795859,0.0009688746,0.0011538003,0.0013523402,0.0015542836,
2234  0.0017562271,0.0019888024,0.002250875,0.0025345034,0.0029032203,0.0052357916,
2235  0.0064009258,0.0080125023,0.0101470897,0.0131093047,0.017134559,0.0229045817,
2236  0.030977894,0.0426621362,0.0591898438,0.0835072354,0.1178884433,0.1663775548,
2237  0.2311140356,0.3159359454,0.417216244,0.528495011,0.6409593447,0.7472394448,
2238  0.8385519068,0.9088123344,0.9593662607,0.988113701,1.0,0.9992058405,
2239  0.9896418908,0.9676958596,0.9514360106,0.9374939729,0.9254715322,0.9152234708,
2240  0.9087828371,0.9026076795,0.8966832495,0.8924832801,0.8854912728,0.8776551873,
2241  0.8676385667,0.8568958573,0.8474408209,0.8360480353,0.8236977202,0.8130435029,
2242  0.8016268925,0.7921616455,0.7827951012,0.7769353384,0.7714647138,0.7631453255,
2243  0.7543403654,0.7452370283,0.734920896,0.7255123747,0.714614237,0.7030887133,
2244  0.6919477897,0.6816475407,0.6705202312,0.6595358705,0.6475962493,0.6291853625,
2245  0.611093274,0.5934323007,0.5760594939,0.5599936467,0.5448751184,0.5306142824,
2246  0.5154832744,0.4976759489,0.4734098374,0.4387697334,0.3934220901,0.3367690187,
2247  0.2742732022,0.2114336281,0.1535541475,0.1063407965,0.0704419498,0.0459120639,
2248  0.0295347927,0.0192753862,0.0126804586,0.0084623824,0.0057690017
2249  };
2250 
2251  //Add multispectral bands to the temporary list
2252  const std::vector<float> vb0 (b0, b0 + sizeof(b0) / sizeof(float) );
2253  const std::vector<float> vb1 (b1, b1 + sizeof(b1) / sizeof(float) );
2254  const std::vector<float> vb2 (b2, b2 + sizeof(b2) / sizeof(float) );
2255  const std::vector<float> vb3 (b3, b3 + sizeof(b3) / sizeof(float) );
2256  //For Pleiades MS image the order of band in 1A product is: B2 B1 B0 B3
2257  //(BandIndexToWavelength method could be used here)
2258  tmpSpectralBandList.push_back(vb2);
2259  tmpSpectralBandList.push_back(vb1);
2260  tmpSpectralBandList.push_back(vb0);
2261  tmpSpectralBandList.push_back(vb3);
2262  }
2263  else
2264  {
2265  itkExceptionMacro(<< "Invalid Pleiades Sensor ID");
2266  }
2267  }
2268  else
2269  {
2270  itkExceptionMacro(<< "Invalid number of bands...");
2271  }
2272 
2273  unsigned int j = 0;
2274  for (std::list <std::vector<float> >::const_iterator it = tmpSpectralBandList.begin(); it != tmpSpectralBandList.end(); ++it)
2275  {
2276  wavelengthSpectralBand->PushBack(FilterFunctionValues::New());
2277  wavelengthSpectralBand->GetNthElement(j)->SetFilterFunctionValues(*it);
2278  wavelengthSpectralBand->GetNthElement(j)->SetMinSpectralValue(0.430);
2279  wavelengthSpectralBand->GetNthElement(j)->SetMaxSpectralValue(0.950);
2280  wavelengthSpectralBand->GetNthElement(j)->SetUserStep(0.0025);
2281  ++j;
2282  }
2283  return wavelengthSpectralBand;
2284 }
2285 
2286 } // end namespace otb

Generated at Sat Mar 8 2014 16:13:14 for Orfeo Toolbox with doxygen 1.8.3.1