29 static ossimTrace traceDebug (
"ossimFormosatDimapSupportData:debug");
36 theMetadataVersion(OSSIM_FORMOSAT_METADATA_VERSION_UNKNOWN),
42 theInstrumentIndex(0),
46 theIncidenceAngle(0.0),
48 theViewingAngleAlongTrack(0.0),
49 theViewingAngleAcrossTrack(0.0),
50 theSceneOrientation(0.0),
51 theImageSize(0.0, 0.0),
52 theRefGroundPoint(0.0, 0.0, 0.0),
53 theRefImagePoint(0.0, 0.0),
54 theSubImageOffset(0.0, 0.0),
56 theRefLineTimeLine(0.0),
57 theLineSamplingPeriod(0.0),
58 thePolynomialLookAngleX(),
59 thePolynomialLookAngleY(),
65 theStarTrackerUsed(false),
68 theFrameVertexPosImagePoints(),
69 theFrameVertexPosGroundPoints(),
70 theGeoPosImagePoints(),
71 theGeoPosGroundPoints()
76 theMetadataVersion(rhs.theMetadataVersion),
77 theImageID(rhs.theImageID),
78 theMetadataFile (rhs.theMetadataFile),
79 theProductionDate(rhs.theProductionDate),
80 theSoftwareVersion(rhs.theSoftwareVersion),
81 theInstrument(rhs.theInstrument),
82 theInstrumentIndex(rhs.theInstrumentIndex),
83 theSunAzimuth(rhs.theSunAzimuth),
84 theSunElevation(rhs.theSunElevation),
85 theSatAzimuth(rhs.theSatAzimuth),
86 theIncidenceAngle(rhs.theIncidenceAngle),
87 theViewingAngle(rhs.theViewingAngle),
88 theViewingAngleAlongTrack(rhs.theViewingAngle),
89 theViewingAngleAcrossTrack(rhs.theViewingAngle),
90 theSceneOrientation(rhs.theSceneOrientation),
91 theImageSize(rhs.theImageSize),
92 theRefGroundPoint(rhs.theRefGroundPoint),
93 theRefImagePoint(rhs.theRefImagePoint),
94 theSubImageOffset(rhs.theSubImageOffset),
95 theRefLineTime(rhs.theRefLineTime),
96 theRefLineTimeLine(rhs.theRefLineTimeLine),
97 theLineSamplingPeriod(rhs.theLineSamplingPeriod),
98 thePolynomialLookAngleX(rhs.thePolynomialLookAngleX),
99 thePolynomialLookAngleY(rhs.thePolynomialLookAngleY),
100 theAttitudeSamples(rhs.theAttitudeSamples),
101 theAttSampTimes(rhs.theAttSampTimes),
102 thePosEcfSamples(rhs.thePosEcfSamples),
103 theVelEcfSamples(rhs.theVelEcfSamples),
104 theEphSampTimes(rhs.theEphSampTimes),
105 theStarTrackerUsed(rhs.theStarTrackerUsed),
106 theNumBands(rhs.theNumBands),
107 theAcquisitionDate(rhs.theAcquisitionDate),
108 theFrameVertexPosImagePoints(rhs.theFrameVertexPosImagePoints),
109 theFrameVertexPosGroundPoints(rhs.theFrameVertexPosGroundPoints),
110 theGeoPosImagePoints(rhs.theGeoPosImagePoints),
111 theGeoPosGroundPoints(rhs.theGeoPosGroundPoints)
118 theMetadataVersion(OSSIM_FORMOSAT_METADATA_VERSION_UNKNOWN),
120 theMetadataFile (dimapFile),
122 theSoftwareVersion(),
124 theInstrumentIndex(0),
126 theSunElevation(0.0),
128 theIncidenceAngle(0.0),
129 theViewingAngle(0.0),
130 theViewingAngleAlongTrack(0.0),
131 theViewingAngleAcrossTrack(0.0),
132 theSceneOrientation(0.0),
133 theImageSize(0.0, 0.0),
134 theRefGroundPoint(0.0, 0.0, 0.0),
135 theRefImagePoint(0.0, 0.0),
136 theSubImageOffset(0.0, 0.0),
138 theRefLineTimeLine(0.0),
139 theLineSamplingPeriod(0.0),
140 thePolynomialLookAngleX(),
141 thePolynomialLookAngleY(),
142 theAttitudeSamples(),
147 theStarTrackerUsed(false),
149 theAcquisitionDate(),
150 theFrameVertexPosImagePoints(),
151 theFrameVertexPosGroundPoints(),
152 theGeoPosImagePoints(),
153 theGeoPosGroundPoints()
158 <<
"ossimFormosatDimapSupportData::ossimFormosatDimapSupportData: entering..." 168 <<
"ossimFormosatDimapSupportData::ossimFormosatDimapSupportData: leaving..." 238 static const char MODULE[] =
"ossimFormosatDimapSupportData::loadXmlFile";
243 << MODULE <<
" DEBUG:Entering ..." 244 <<
"\nFile: " << file << std::endl;
251 std::vector<char> fullBuffer;
253 if(in.good()&&(fileSize > 0))
256 fullBuffer.resize(fileSize);
265 in.read(&fullBuffer.front(), (std::streamsize)fullBuffer.size());
269 fullBuffer.begin()+in.gcount());
283 if(bufferedIo.
empty())
292 if(!xmlDocument->
read(inStringStream))
303 << MODULE <<
" DEBUG:" 304 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 305 <<
"\nUnable to parse xml file" << std::endl;
314 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
316 ossimString xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/MISSION";
317 xmlDocument->
findNodes(xpath, xml_nodes);
318 if (xml_nodes.size() == 0)
324 <<
"DEBUG:\n Not a FORMOSAT DIMAP file format."<< std::endl;
329 if ( xml_nodes[0]->getText() !=
"FORMOSAT" && xml_nodes[0]->getText() !=
"Formosat" && xml_nodes[0]->getText() !=
"formosat" )
334 <<
"DEBUG:\n Not a FORMOSAT DIMAP file format."<< std::endl;
348 << MODULE <<
" DEBUG:" 349 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 350 <<
"\nMetadata initialization failed. Returning false" 362 << MODULE <<
" DEBUG:" 363 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 364 <<
"\nImageId initialization failed. Returning false" 374 << MODULE <<
" DEBUG:" 375 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 376 <<
"\nScene source initialization failed. Returning false" 385 << MODULE <<
" DEBUG:" 386 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 387 <<
"\nFrame point initialization failed. Returning false" 395 << MODULE <<
" DEBUG:" 396 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 397 <<
"\nPart 1 initialization failed. Returning false" 405 << MODULE <<
" DEBUG:" 406 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 407 <<
"\nPart 2 initialization failed. Returning false" 415 << MODULE <<
" DEBUG:" 416 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 417 <<
"\nPart 3 initialization failed. Returning false" 425 << MODULE <<
" DEBUG:" 426 <<
"ossimFormosatDimapSupportData::loadXmlFile:" 427 <<
"\nPart 4 initialization failed. Returning false" 437 << MODULE <<
" DEBUG: leaving..." 511 double tempIdx = 0.0;
512 double tempIdxFraction = 0.0;
522 if(idxStart > idxEnd)
621 const std::vector<ossim_float64>& angles,
626 if (angles.size() != 4 )
632 la = angles[0] + angles[1] * p + angles[2] * p * p + angles[3] * p * p * p ;
637 const std::vector<ossimDpt3d>& V,
638 const std::vector<ossim_float64>& T,
642 while ((samp0 < T.size()) && (T[samp0] < time)) ++samp0;
648 else if(samp0 == T.size())
654 double t = (T[samp0-1]-time)/(T[samp0-1] - T[samp0]);
656 li = V[samp0-1] + (V[samp0]-V[samp0-1])*t;
662 const std::vector<ossimDpt3d>& V,
663 const std::vector<ossim_float64>& T,
676 if(T.size() <= filter_size)
679 lagrange_half_filter = filter_size/2;
681 if ((time < T[lagrange_half_filter]) ||
682 (time >= T[T.size()-lagrange_half_filter] ))
694 while ((samp0 < T.size()) && (T[samp0] < time)) ++samp0;
703 samp0 -= lagrange_half_filter;
709 for (
ossim_uint32 j=samp0; j<(samp0+filter_size+bump); ++j)
717 if (bump && (j == (samp0+lagrange_half_filter) ))
723 for (
ossim_uint32 i=samp0; i<(samp0+filter_size+bump); ++i)
728 if (bump && (i == (samp0+lagrange_half_filter) ))
733 numerator *= time - T[i];
734 denominator *= T[j] - T[i];
757 int year, month, day, hour, minute;
763 int converted = sscanf(time_stamp,
764 "%4d-%2d-%2d %2d:%2d:%9lf",
766 &hour, &minute, &second);
775 ti = (((((year-2002.0)*12.0 + month - 1.0)*365.0 + day - 1.0)*24.0
776 + hour)*60.0 + minute)*60.0 + second;
797 os <<
"\n----------------- Info on Formosat Image -------------------" 813 <<
"\n Corrected Attitude: " << corr_att
822 <<
"\n---------------------------------------------------------" 823 <<
"\n " << std::endl;
986 const char* prefix)
const 990 "ossimFormosatDimapSupportData",
1009 "sat_azimuth_angle",
1025 "reference_ground_point",
1033 "reference_image_point",
1045 "reference_line_time",
1050 "reference_line_time_line",
1055 "line_sampling_period",
1069 "pixel_lookat_angle_x",
1074 "number_of_pixel_lookat_angle_x",
1084 "pixel_lookat_angle_y",
1088 "number_of_pixel_lookat_angle_y",
1105 "number_of_attitude_samples",
1115 "attitude_sample_times",
1119 "number_of_attitude_sample_times",
1131 "position_ecf_samples",
1135 "number_of_position_ecf_samples",
1147 "velocity_ecf_samples",
1151 "number_of_velocity_ecf_samples",
1162 "ephemeris_sample_times",
1166 "number_of_ephemeris_sample_times",
1171 "star_tracker_used_flag",
1221 "viewing_angle_along_track",
1226 "viewing_angle_across_track",
1231 "scene_orientation",
1282 if(type !=
"ossimFormosatDimapSupportData")
1299 const char* lookup = kwl.
find(prefix,
"reference_line_time_line");
1313 tempString = kwl.
find(prefix,
"pixel_lookat_angle_x");
1314 if(tempString !=
"")
1325 total =
ossimString(kwl.
find(prefix,
"number_of_pixel_lookat_angle_y")).toUInt32();
1327 tempString = kwl.
find(prefix,
"pixel_lookat_angle_y");
1328 if(tempString !=
"")
1340 total =
ossimString(kwl.
find(prefix,
"number_of_attitude_samples")).toUInt32();
1342 tempString = kwl.
find(prefix,
"attitude_samples");
1343 if(tempString !=
"")
1354 total =
ossimString(kwl.
find(prefix,
"number_of_attitude_sample_times")).toUInt32();
1356 tempString = kwl.
find(prefix,
"attitude_sample_times");
1357 if(tempString !=
"")
1368 total =
ossimString(kwl.
find(prefix,
"number_of_position_ecf_samples")).toUInt32();
1370 tempString = kwl.
find(prefix,
"position_ecf_samples");
1371 if(tempString !=
"")
1382 total =
ossimString(kwl.
find(prefix,
"number_of_velocity_ecf_samples")).toUInt32();
1384 tempString = kwl.
find(prefix,
"velocity_ecf_samples");
1385 if(tempString !=
"")
1396 total =
ossimString(kwl.
find(prefix,
"number_of_ephemeris_sample_times")).toUInt32();
1398 tempString = kwl.
find(prefix,
"ephemeris_sample_times");
1399 if(tempString !=
"")
1436 tempString = kwl.
find(prefix,
"physical_bias");
1437 if(tempString !=
"")
1449 tempString = kwl.
find(prefix,
"physical_gain");
1450 if(tempString !=
"")
1462 tempString = kwl.
find(prefix,
"solar_irradiance");
1463 if(tempString !=
"")
1483 in >> lat >> lon >> height >> code;
1507 static const char MODULE[] =
"ossimFormosatDimapSupportData::parsePart1";
1510 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1516 xpath =
"/Dimap_Document/Raster_Dimensions/NCOLS";
1517 xmlDocument->
findNodes(xpath, xml_nodes);
1518 if (xml_nodes.size() == 0)
1524 << MODULE <<
" DEBUG:" 1525 <<
"\nCould not find: " << xpath
1533 xpath =
"/Dimap_Document/Raster_Dimensions/NROWS";
1534 xmlDocument->
findNodes(xpath, xml_nodes);
1535 if (xml_nodes.size() == 0)
1541 << MODULE <<
" DEBUG:" 1542 <<
"\nCould not find: " << xpath
1560 xpath =
"/Dimap_Document/Data_Strip/Time_Stamp/REFERENCE_LINE";
1561 xmlDocument->
findNodes(xpath, xml_nodes);
1562 if (xml_nodes.size() == 0)
1568 << MODULE <<
" DEBUG:" 1569 <<
"\nCould not find: " << xpath
1580 xpath =
"/Dimap_Document/Data_Processing/Regions_Of_Interest/Region_Of_Interest/COL_MIN";
1581 xmlDocument->
findNodes(xpath, xml_nodes);
1582 if (xml_nodes.size() == 0)
1592 xpath =
"/Dimap_Document/Data_Processing/Regions_Of_Interest/Region_Of_Interest/ROW_MIN";
1593 xmlDocument->
findNodes(xpath, xml_nodes);
1594 if (xml_nodes.size() == 0)
1607 xpath =
"/Dimap_Document/Data_Strip/Time_Stamp/REFERENCE_TIME";
1608 xmlDocument->
findNodes(xpath, xml_nodes);
1609 if (xml_nodes.size() == 0)
1615 << MODULE <<
" DEBUG:" 1616 <<
"\nCould not find: " << xpath
1628 xpath =
"/Dimap_Document/Production/DATASET_PRODUCTION_DATE";
1629 xmlDocument->
findNodes(xpath, xml_nodes);
1630 if (xml_nodes.size() == 0)
1636 << MODULE <<
" DEBUG:" 1637 <<
"\nCould not find: " << xpath
1648 xpath =
"/Dimap_Document/Production/Production_Facility/SOFTWARE_VERSION";
1649 xmlDocument->
findNodes(xpath, xml_nodes);
1650 if (xml_nodes.size() == 0)
1656 << MODULE <<
" DEBUG:" 1657 <<
"\nCould not find: " << xpath
1667 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/INSTRUMENT";
1668 xmlDocument->
findNodes(xpath, xml_nodes);
1669 if (xml_nodes.size() == 0)
1675 << MODULE <<
" DEBUG:" 1676 <<
"\nCould not find: " << xpath
1687 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/INSTRUMENT_INDEX";
1688 xmlDocument->
findNodes(xpath, xml_nodes);
1689 if (xml_nodes.size() == 0)
1695 << MODULE <<
" DEBUG:" 1696 <<
"\nCould not find: " << xpath
1709 static const char MODULE[] =
"ossimFormosatDimapSupportData::parsePart2";
1712 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1713 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1714 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
1721 xpath =
"/Dimap_Document/Data_Strip/Time_Stamp/LINE_PERIOD";
1723 xmlDocument->
findNodes(xpath, xml_nodes);
1724 if (xml_nodes.size() == 0)
1730 << MODULE <<
" DEBUG:" 1731 <<
"\nCould not find: " << xpath
1743 xpath =
"/Dimap_Document/Raster_Dimensions/NBANDS";
1744 xmlDocument->
findNodes(xpath, xml_nodes);
1745 if (xml_nodes.size() == 0)
1751 << MODULE <<
" DEBUG:" 1752 <<
"\nCould not find: " << xpath
1774 << MODULE <<
" DEBUG:" 1789 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/" 1790 "Instrument_Look_Angles_List/Instrument_Look_Angles/";
1791 xmlDocument->
findNodes(xpath, xml_nodes);
1794 if(xml_nodes.size() == 0)
1800 << MODULE <<
" DEBUG:" 1801 <<
"\nCould not find: " << xpath
1807 node = xml_nodes.
begin();
1808 while (node != xml_nodes.end())
1811 xpath =
"BAND_INDEX";
1812 (*node)->findChildNodes(xpath, sub_nodes);
1813 if (sub_nodes.size() == 0)
1819 << MODULE <<
" DEBUG:" 1820 <<
"\nCould not find: " << xpath
1828 if( (bandIndex >= static_cast<int>(
theNumBands) ) || (bandIndex<0) )
1834 if(bandIndex == band_index)
1837 xpath =
"Polynomial_Look_Angles/XLOS_0";
1838 (*node)->findChildNodes(xpath, sub_nodes);
1839 if (sub_nodes.size() == 0)
1847 xpath =
"Polynomial_Look_Angles/XLOS_1";
1848 (*node)->findChildNodes(xpath, sub_nodes);
1849 if (sub_nodes.size() == 0)
1857 xpath =
"Polynomial_Look_Angles/XLOS_2";
1858 (*node)->findChildNodes(xpath, sub_nodes);
1859 if (sub_nodes.size() == 0)
1867 xpath =
"Polynomial_Look_Angles/XLOS_3";
1868 (*node)->findChildNodes(xpath, sub_nodes);
1869 if (sub_nodes.size() == 0)
1877 xpath =
"Polynomial_Look_Angles/YLOS_0";
1878 (*node)->findChildNodes(xpath, sub_nodes);
1879 if (sub_nodes.size() == 0)
1887 xpath =
"Polynomial_Look_Angles/YLOS_1";
1888 (*node)->findChildNodes(xpath, sub_nodes);
1889 if (sub_nodes.size() == 0)
1897 xpath =
"Polynomial_Look_Angles/YLOS_2";
1898 (*node)->findChildNodes(xpath, sub_nodes);
1899 if (sub_nodes.size() == 0)
1907 xpath =
"Polynomial_Look_Angles/YLOS_3";
1908 (*node)->findChildNodes(xpath, sub_nodes);
1909 if (sub_nodes.size() == 0)
1926 xpath =
"/Dimap_Document/Data_Strip/Attitudes/Corrected_Attitudes/ECF_Attitude/Angle_List/Angle";
1927 xmlDocument->
findNodes(xpath, xml_nodes);
1928 if (xml_nodes.size() == 0)
1934 << MODULE <<
" DEBUG:" 1935 <<
"\nCould not find: " << xpath
1941 node = xml_nodes.
begin();
1942 while (node != xml_nodes.end())
1948 (*node)->findChildNodes(xpath, sub_nodes);
1949 if (sub_nodes.size() == 0)
1954 V.
x = sub_nodes[0]->getText().toDouble();
1958 (*node)->findChildNodes(xpath, sub_nodes);
1959 if (sub_nodes.size() == 0)
1964 V.
y = sub_nodes[0]->getText().toDouble();
1968 (*node)->findChildNodes(xpath, sub_nodes);
1969 if (sub_nodes.size() == 0)
1974 V.
z = sub_nodes[0]->getText().toDouble();
1980 (*node)->findChildNodes(xpath, sub_nodes);
1981 if (sub_nodes.size() == 0)
1998 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1999 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2000 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2002 static const char MODULE[] =
"ossimFormosatDimapSupportData::parsePart3";
2012 xpath =
"/Dimap_Document/Data_Strip/Ephemeris/Raw_Ephemeris/Point_List/Point";
2013 xmlDocument->
findNodes(xpath, xml_nodes);
2014 if (xml_nodes.size() == 0)
2020 << MODULE <<
" DEBUG:" 2021 <<
"\nCould not find: " << xpath
2026 node = xml_nodes.
begin();
2028 while (node != xml_nodes.end())
2032 xpath =
"Location/X";
2033 (*node)->findChildNodes(xpath, sub_nodes);
2034 if (sub_nodes.size() == 0)
2039 VP.
x = sub_nodes[0]->getText().toDouble();
2042 xpath =
"Location/Y";
2043 (*node)->findChildNodes(xpath, sub_nodes);
2044 if (sub_nodes.size() == 0)
2049 VP.
y = sub_nodes[0]->getText().toDouble();
2052 xpath =
"Location/Z";
2053 (*node)->findChildNodes(xpath, sub_nodes);
2054 if (sub_nodes.size() == 0)
2059 VP.
z = sub_nodes[0]->getText().toDouble();
2065 xpath =
"Velocity/X";
2066 (*node)->findChildNodes(xpath, sub_nodes);
2067 if (sub_nodes.size() == 0)
2072 VV.
x = sub_nodes[0]->getText().toDouble();
2075 xpath =
"Velocity/Y";
2076 (*node)->findChildNodes(xpath, sub_nodes);
2077 if (sub_nodes.size() == 0)
2082 VV.
y = sub_nodes[0]->getText().toDouble();
2085 xpath =
"Velocity/Z";
2086 (*node)->findChildNodes(xpath, sub_nodes);
2087 if (sub_nodes.size() == 0)
2092 VV.
z = sub_nodes[0]->getText().toDouble();
2098 (*node)->findChildNodes(xpath, sub_nodes);
2099 if (sub_nodes.size() == 0)
2113 xpath =
"/Dimap_Document/Data_Strip/Satellite_Attitudes/Corrected_Attitudes/" 2114 "STAR_TRACKER_USED";
2115 xmlDocument->
findNodes(xpath, xml_nodes);
2116 if (xml_nodes.size() == 0)
2124 if (xml_nodes[0]->getText() ==
"Y")
2134 xpath =
"/Dimap_Document/Geoposition/Geoposition_Points/Tie_Point";
2135 xmlDocument->
findNodes(xpath, xml_nodes);
2136 node = xml_nodes.begin();
2137 while (node != xml_nodes.end())
2143 xpath =
"TIE_POINT_DATA_Y";
2144 (*node)->findChildNodes(xpath, sub_nodes);
2145 if (sub_nodes.size() == 0)
2150 ipt.
line = sub_nodes[0]->getText().toDouble() - 1.0;
2153 xpath =
"TIE_POINT_DATA_X";
2154 (*node)->findChildNodes(xpath, sub_nodes);
2155 if (sub_nodes.size() == 0)
2160 ipt.
samp = sub_nodes[0]->getText().toDouble() - 1.0;
2163 xpath =
"TIE_POINT_CRS_Y";
2164 (*node)->findChildNodes(xpath, sub_nodes);
2165 if (sub_nodes.size() == 0)
2170 gpt.
lat = sub_nodes[0]->getText().toDouble();
2173 xpath =
"TIE_POINT_CRS_X";
2174 (*node)->findChildNodes(xpath, sub_nodes);
2175 if (sub_nodes.size() == 0)
2180 gpt.
lon = sub_nodes[0]->getText().toDouble();
2183 xpath =
"TIE_POINT_CRS_Z";
2184 (*node)->findChildNodes(xpath, sub_nodes);
2185 if (sub_nodes.size() != 0)
2187 gpt.
hgt = sub_nodes[0]->getText().toDouble();
2202 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2203 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2204 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2206 static const char MODULE[] =
"ossimFormosatDimapSupportData::parsePart4";
2215 xpath =
"/Dimap_Document/Data_Strip/Sensor_Calibration/Calibration/Band_Parameters/";
2217 xmlDocument->
findNodes(xpath, xml_nodes);
2218 if(xml_nodes.size() == 0)
2224 << MODULE <<
" DEBUG:" 2225 <<
"\nCould not find: " << xpath
2231 node = xml_nodes.
begin();
2232 while (node != xml_nodes.end())
2235 xpath =
"BAND_INDEX";
2236 (*node)->findChildNodes(xpath, sub_nodes);
2237 if (sub_nodes.size() == 0)
2243 << MODULE <<
" DEBUG:" 2244 <<
"\nCould not find: " << xpath
2253 if( (bandIndex >= static_cast<int>(
theNumBands) ) || (bandIndex<0) )
2260 xpath =
"Gain_Section_List/Gain_Section/PHYSICAL_BIAS";
2261 (*node)->findChildNodes(xpath, sub_nodes);
2262 if (sub_nodes.size() == 0)
2270 xpath =
"Gain_Section_List/Gain_Section/PHYSICAL_GAIN";
2271 (*node)->findChildNodes(xpath, sub_nodes);
2272 if (sub_nodes.size() == 0)
2284 xpath =
"/Dimap_Document/Data_Strip/Sensor_Calibration/Solar_Irradiance/Band_Solar_Irradiance";
2285 xmlDocument->
findNodes(xpath, xml_nodes);
2286 node = xml_nodes.begin();
2287 while (node != xml_nodes.end())
2290 xpath =
"BAND_INDEX";
2291 (*node)->findChildNodes(xpath, sub_nodes);
2292 if (sub_nodes.size() == 0)
2298 ossim_int32 bandIndex = sub_nodes[0]->getText().toInt32() - 1;
2300 if((bandIndex >= static_cast<ossim_int32>(
theNumBands) ) || (bandIndex<0))
2307 xpath =
"SOLAR_IRRADIANCE_VALUE";
2308 (*node)->findChildNodes(xpath, sub_nodes);
2309 if (sub_nodes.size() == 0)
2325 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2330 xpath =
"/Dimap_Document/Metadata_Id/METADATA_FORMAT";
2331 xmlDocument->
findNodes(xpath, xml_nodes);
2332 if (xml_nodes.size() == 0)
2338 <<
"DEBUG:\nCould not find: " << xpath
2346 xml_nodes[0]->getAttributeValue(value, attribute);
2351 else if (value ==
"1.1")
2362 <<
"WARNING: metadata version not found!" 2374 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2379 xpath =
"/Dimap_Document/Production/JOB_ID";
2380 xmlDocument->
findNodes(xpath, xml_nodes);
2381 if (xml_nodes.size() == 0)
2387 <<
"DEBUG:\nCould not find: " << xpath
2400 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2407 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/MISSION_INDEX";
2408 xmlDocument->
findNodes(xpath, xml_nodes);
2409 if (xml_nodes.size() == 0)
2415 <<
"DEBUG:\nCould not find: " << xpath
2420 if (xml_nodes[0]->getText() ==
"1")
2422 if (xml_nodes[0]->getText() ==
"2")
2429 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SUN_AZIMUTH";
2430 xmlDocument->
findNodes(xpath, xml_nodes);
2431 if (xml_nodes.size() == 0)
2437 <<
"DEBUG:\nCould not find: " << xpath
2448 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE_ALONG_TRACK";
2449 xmlDocument->
findNodes(xpath, xml_nodes);
2450 if (xml_nodes.size() == 0)
2456 <<
"DEBUG:\nCould not find: " << xpath
2467 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE_ACROSS_TRACK";
2468 xmlDocument->
findNodes(xpath, xml_nodes);
2469 if (xml_nodes.size() == 0)
2475 <<
"DEBUG:\nCould not find: " << xpath
2486 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SUN_ELEVATION";
2487 xmlDocument->
findNodes(xpath, xml_nodes);
2488 if (xml_nodes.size() == 0)
2494 <<
"DEBUG:\nCould not find: " << xpath
2505 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SATELLITE_INCIDENCE_ANGLE";
2506 xmlDocument->
findNodes(xpath, xml_nodes);
2507 if (xml_nodes.size() == 0)
2513 <<
"DEBUG:\nCould not find: " << xpath
2524 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SATELLITE_AZIMUTH_ANGLE";
2525 xmlDocument->
findNodes(xpath, xml_nodes);
2526 if (xml_nodes.size() == 0)
2532 <<
"DEBUG:\nCould not find: " << xpath
2552 xpath =
"/Dimap_Document/Data_Strip/Ephemeris/SATELLITE_ALTITUDE";
2555 xmlDocument->
findNodes(xpath, xml_nodes);
2556 if (xml_nodes.size() == 0)
2562 <<
"DEBUG:\nCould not find: " << xpath
2568 double theSatelliteAltitude = xml_nodes[0]->getText().
toDouble();
2569 double RT = 63710087714.0;
2579 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2585 xpath =
"/Dimap_Document/Dataset_Frame/Vertex";
2586 xmlDocument->
findNodes(xpath, xml_nodes);
2587 if (xml_nodes.size() != 4)
2592 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
2593 while (node != xml_nodes.end())
2598 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2599 xpath =
"FRAME_LAT";
2600 (*node)->findChildNodes(xpath, sub_nodes);
2601 if (sub_nodes.size() == 0)
2606 gpt.
lat = sub_nodes[0]->getText().toDouble();
2609 xpath =
"FRAME_LON";
2610 (*node)->findChildNodes(xpath, sub_nodes);
2611 if (sub_nodes.size() == 0)
2616 gpt.
lon = sub_nodes[0]->getText().toDouble();
2620 xpath =
"FRAME_ROW";
2621 (*node)->findChildNodes(xpath, sub_nodes);
2622 if (sub_nodes.size() == 0)
2627 ipt.
line = sub_nodes[0]->getText().toDouble() - 1.0;
2630 xpath =
"FRAME_COL";
2631 (*node)->findChildNodes(xpath, sub_nodes);
2632 if (sub_nodes.size() == 0)
2637 ipt.
samp = sub_nodes[0]->getText().toDouble() - 1.0;
2651 xpath =
"/Dimap_Document/Dataset_Frame/Scene_Center/FRAME_LON";
2652 xmlDocument->
findNodes(xpath, xml_nodes);
2653 if (xml_nodes.size() != 1)
2661 xpath =
"/Dimap_Document/Dataset_Frame/Scene_Center/FRAME_LAT";
2662 xmlDocument->
findNodes(xpath, xml_nodes);
2663 if (xml_nodes.size() != 1)
2675 xpath =
"/Dimap_Document/Dataset_Frame/SCENE_ORIENTATION";
2676 xmlDocument->
findNodes(xpath, xml_nodes);
2677 if (xml_nodes.size() == 0)
2683 <<
"DEBUG:\nCould not find: " << xpath
virtual const ossimDatum * create(const ossimString &code) const
create method
void clear()
Erases the entire container.
static const char * IMAGE_DATE_KW
double lond() const
Will convert the radian measure to degrees.
Represents serializable keyword/value map.
std::basic_ifstream< char > ifstream
Class for char input file streams.
const char * find(const char *key) const
ossim_int64 fileSize() const
double nan()
Method to return ieee floating point double precision NAN.
bool contains(char aChar) const
virtual const ossimString & code() const
static ossimString toString(bool aValue)
Numeric to string methods.
ossim_float64 hgt
Height in meters above the ellipsiod.
double latd() const
Will convert the radian measure to degrees.
static const char * TYPE_KW
const ossimDatum * datum() const
datum().
ossim_int32 toInt32() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void clearErrorStatus() const
std::string::iterator begin()
unsigned int ossim_uint32
static ossimDatumFactory * instance()
static const char * NUMBER_BANDS_KW
static const char * AZIMUTH_ANGLE_KW
virtual ossimErrorCode getErrorStatus() const
virtual void setErrorStatus() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
bool read(std::istream &in)
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
std::basic_istringstream< char > istringstream
Class for char input memory streams.
static const char * ELEVATION_ANGLE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.