31 static ossimTrace traceDebug (
"ossimSpotDimapSupportData:debug");
38 theMetadataVersion(OSSIM_SPOT_METADATA_VERSION_UNKNOWN),
43 theInstrumentIndex(0),
46 theIncidenceAngle(0.0),
48 theSceneOrientation(0.0),
49 theImageSize(0.0, 0.0),
50 theRefGroundPoint(0.0, 0.0, 0.0),
51 theRefImagePoint(0.0, 0.0),
52 theSubImageOffset(0.0, 0.0),
54 theRefLineTimeLine(0.0),
55 theLineSamplingPeriod(0.0),
64 theStarTrackerUsed(false),
65 theSwirDataFlag(false),
73 theGeoPosImagePoints(),
74 theGeoPosGroundPoints()
79 theMetadataVersion(rhs.theMetadataVersion),
80 theImageID(rhs.theImageID),
81 theMetadataFile (rhs.theMetadataFile),
82 theProductionDate(rhs.theProductionDate),
83 theInstrument(rhs.theInstrument),
84 theInstrumentIndex(rhs.theInstrumentIndex),
85 theSunAzimuth(rhs.theSunAzimuth),
86 theSunElevation(rhs.theSunElevation),
87 theIncidenceAngle(rhs.theIncidenceAngle),
88 theViewingAngle(rhs.theViewingAngle),
89 theSceneOrientation(rhs.theSceneOrientation),
90 theImageSize(rhs.theImageSize),
91 theRefGroundPoint(rhs.theRefGroundPoint),
92 theRefImagePoint(rhs.theRefImagePoint),
93 theSubImageOffset(rhs.theSubImageOffset),
94 theRefLineTime(rhs.theRefLineTime),
95 theRefLineTimeLine(rhs.theRefLineTimeLine),
96 theLineSamplingPeriod(rhs.theLineSamplingPeriod),
97 theDetectorCount(rhs.theDetectorCount),
98 thePixelLookAngleX(rhs.thePixelLookAngleX),
99 thePixelLookAngleY(rhs.thePixelLookAngleY),
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 theSwirDataFlag (rhs.theSwirDataFlag),
107 theNumBands(rhs.theNumBands),
108 theAcquisitionDate(rhs.theAcquisitionDate),
109 theStepCount(rhs.theStepCount),
110 theUlCorner(rhs.theUlCorner),
111 theUrCorner(rhs.theUrCorner),
112 theLrCorner(rhs.theLrCorner),
113 theLlCorner(rhs.theLlCorner),
114 theGeoPosImagePoints(rhs.theGeoPosImagePoints),
115 theGeoPosGroundPoints(rhs.theGeoPosGroundPoints)
122 theMetadataVersion(OSSIM_SPOT_METADATA_VERSION_UNKNOWN),
124 theMetadataFile (dimapFile),
127 theInstrumentIndex(0),
129 theSunElevation(0.0),
130 theIncidenceAngle(0.0),
131 theViewingAngle(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),
141 thePixelLookAngleX(),
142 thePixelLookAngleY(),
143 theAttitudeSamples(),
148 theStarTrackerUsed(false),
149 theSwirDataFlag (processSwir),
151 theAcquisitionDate(),
157 theGeoPosImagePoints(),
158 theGeoPosGroundPoints()
163 <<
"ossimSpotDimapSupportData::ossimSpotDimapSupportData: entering..." 173 <<
"ossimSpotDimapSupportData::ossimSpotDimapSupportData: leaving..." 243 static const char MODULE[] =
"ossimSpotDimapSupportData::loadXmlFile";
248 << MODULE <<
" DEBUG:" 249 <<
"\nFile: " << file << std::endl;
257 std::vector<char> fullBuffer;
259 if(in.good()&&(fileSize > 0))
262 fullBuffer.resize(fileSize);
271 in.read(&fullBuffer.front(), (std::streamsize)fullBuffer.size());
275 fullBuffer.begin()+in.gcount());
289 if(bufferedIo.
empty())
298 if(!xmlDocument->
read(inStringStream))
308 << MODULE <<
" DEBUG:" 309 <<
"ossimSpotDimapSupportData::loadXmlFile:" 310 <<
"\nUnable to parse xml file" << std::endl;
319 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
321 ossimString xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/MISSION";
322 xmlDocument->
findNodes(xpath, xml_nodes);
323 if (xml_nodes.size() == 0)
329 <<
"DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
333 if ( xml_nodes[0]->getText() !=
"SPOT" && xml_nodes[0]->getText() !=
"Spot" && xml_nodes[0]->getText() !=
"spot" )
338 <<
"DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
353 << MODULE <<
" DEBUG:" 354 <<
"ossimSpotDimapSupportData::loadXmlFile:" 355 <<
"\nMetadata initialization failed. Returning false" 367 << MODULE <<
" DEBUG:" 368 <<
"ossimSpotDimapSupportData::loadXmlFile:" 369 <<
"\nImageId initialization failed. Returning false" 379 << MODULE <<
" DEBUG:" 380 <<
"ossimSpotDimapSupportData::loadXmlFile:" 381 <<
"\nScene source initialization failed. Returning false" 390 << MODULE <<
" DEBUG:" 391 <<
"ossimSpotDimapSupportData::loadXmlFile:" 392 <<
"\nFrame point initialization failed. Returning false" 400 << MODULE <<
" DEBUG:" 401 <<
"ossimSpotDimapSupportData::loadXmlFile:" 402 <<
"\nPart 1 initialization failed. Returning false" 410 << MODULE <<
" DEBUG:" 411 <<
"ossimSpotDimapSupportData::loadXmlFile:" 412 <<
"\nPart 2 initialization failed. Returning false" 420 << MODULE <<
" DEBUG:" 421 <<
"ossimSpotDimapSupportData::loadXmlFile:" 422 <<
"\nPart 3 initialization failed. Returning false" 430 << MODULE <<
" DEBUG:" 431 <<
"ossimSpotDimapSupportData::loadXmlFile:" 432 <<
"\nPart 4 initialization failed. Returning false" 442 << MODULE <<
" DEBUG: exited..." 459 double tempIdx = 0.0;
460 double tempIdxFraction = 0.0;
461 t =
static_cast<double>(sample)/
471 if(idxStart > idxEnd)
518 double tempIdx = 0.0;
519 double tempIdxFraction = 0.0;
520 t =
static_cast<double>(sample)/
530 if(idxStart > idxEnd)
578 double tempIdx = 0.0;
579 double tempIdxFraction = 0.0;
589 if(idxStart > idxEnd)
734 const std::vector<ossim_float64>& angles,
749 la = angles[(int) p0];
756 la = (angle_0*(p1-p) + angle_1*(p-p0))/(p1-p0);
762 const std::vector<ossimDpt3d>& V,
763 const std::vector<ossim_float64>& T,
767 while ((samp0 < T.size()) && (T[samp0] < time)) ++samp0;
773 else if(samp0 == T.size())
779 double t = (T[samp0-1]-time)/(T[samp0-1] - T[samp0]);
781 li = V[samp0-1] + (V[samp0]-V[samp0-1])*t;
787 const std::vector<ossimDpt3d>& V,
788 const std::vector<ossim_float64>& T,
801 if(T.size() <= filter_size)
804 lagrange_half_filter = filter_size/2;
806 if ((time < T[lagrange_half_filter]) ||
807 (time >= T[T.size()-lagrange_half_filter] ))
819 while ((samp0 < T.size()) && (T[samp0] < time)) ++samp0;
828 samp0 -= lagrange_half_filter;
834 for (
ossim_uint32 j=samp0; j<(samp0+filter_size+bump); ++j)
842 if (bump && (j == (samp0+lagrange_half_filter) ))
848 for (
ossim_uint32 i=samp0; i<(samp0+filter_size+bump); ++i)
853 if (bump && (i == (samp0+lagrange_half_filter) ))
858 numerator *= time - T[i];
859 denominator *= T[j] - T[i];
882 int year, month, day, hour, minute;
888 int converted = sscanf(time_stamp,
889 "%4d-%2d-%2dT%2d:%2d:%9lf",
891 &hour, &minute, &second);
900 ti = (((((year-2002.0)*12.0 + month - 1.0)*365.0 + day - 1.0)*24.0
901 + hour)*60.0 + minute)*60.0 + second;
922 os <<
"\n----------------- Info on SPOT5 Image -------------------" 936 <<
"\n Corrected Attitude: " << corr_att
943 <<
"\n Corner Points:" 949 <<
"\n---------------------------------------------------------" 950 <<
"\n " << std::endl;
1122 const char* prefix)
const 1126 "ossimSpotDimapSupportData",
1160 "reference_ground_point",
1168 "reference_image_point",
1180 "reference_line_time",
1185 "reference_line_time_line",
1190 "line_sampling_period",
1204 "pixel_lookat_angle_x",
1209 "number_of_pixel_lookat_angle_x",
1219 "pixel_lookat_angle_y",
1223 "number_of_pixel_lookat_angle_y",
1240 "number_of_attitude_samples",
1250 "attitude_sample_times",
1254 "number_of_attitude_sample_times",
1266 "position_ecf_samples",
1270 "number_of_position_ecf_samples",
1282 "velocity_ecf_samples",
1286 "number_of_velocity_ecf_samples",
1297 "ephemeris_sample_times",
1301 "number_of_ephemeris_sample_times",
1306 "star_tracker_used_flag",
1356 "scene_orientation",
1444 if(type !=
"ossimSpotDimapSupportData")
1453 const char* lookup = kwl.
find(prefix,
"detector_count");
1466 lookup = kwl.
find(prefix,
"reference_line_time_line");
1480 tempString = kwl.
find(prefix,
"pixel_lookat_angle_x");
1481 if(tempString !=
"")
1487 in >> tempValue.
string();
1492 total =
ossimString(kwl.
find(prefix,
"number_of_pixel_lookat_angle_y")).toUInt32();
1494 tempString = kwl.
find(prefix,
"pixel_lookat_angle_y");
1495 if(tempString !=
"")
1501 in >> tempValue.
string();
1506 total =
ossimString(kwl.
find(prefix,
"number_of_attitude_samples")).toUInt32();
1508 tempString = kwl.
find(prefix,
"attitude_samples");
1509 if(tempString !=
"")
1515 in >>
x.string() >>
y.string() >> z.string();
1520 total =
ossimString(kwl.
find(prefix,
"number_of_attitude_sample_times")).toUInt32();
1522 tempString = kwl.
find(prefix,
"attitude_sample_times");
1523 if(tempString !=
"")
1529 in >> tempValue.
string();
1534 total =
ossimString(kwl.
find(prefix,
"number_of_position_ecf_samples")).toUInt32();
1536 tempString = kwl.
find(prefix,
"position_ecf_samples");
1537 if(tempString !=
"")
1543 in >>
x.string() >>
y.string() >> z.string();
1548 total =
ossimString(kwl.
find(prefix,
"number_of_velocity_ecf_samples")).toUInt32();
1550 tempString = kwl.
find(prefix,
"velocity_ecf_samples");
1551 if(tempString !=
"")
1557 in >>
x.string() >>
y.string() >> z.string();
1562 total =
ossimString(kwl.
find(prefix,
"number_of_ephemeris_sample_times")).toUInt32();
1564 tempString = kwl.
find(prefix,
"ephemeris_sample_times");
1565 if(tempString !=
"")
1571 in >> tempValue.
string();
1604 tempString = kwl.
find(prefix,
"physical_bias");
1605 if(tempString !=
"")
1611 in >> tempValue.
string();
1617 tempString = kwl.
find(prefix,
"physical_gain");
1618 if(tempString !=
"")
1624 in >> tempValue.
string();
1630 tempString = kwl.
find(prefix,
"solar_irradiance");
1631 if(tempString !=
"")
1637 in >> tempValue.
string();
1651 in >> lat.
string() >> lon.string() >> height.string() >> code.
string();
1666 in >>
x.string() >>
y.string();
1675 static const char MODULE[] =
"ossimSpotDimapSupportData::parsePart1";
1678 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1685 xpath =
"/Dimap_Document/Raster_Dimensions/NCOLS";
1686 xmlDocument->
findNodes(xpath, xml_nodes);
1687 if (xml_nodes.size() == 0)
1693 << MODULE <<
" DEBUG:" 1694 <<
"\nCould not find: " << xpath
1702 xpath =
"/Dimap_Document/Raster_Dimensions/NROWS";
1703 xmlDocument->
findNodes(xpath, xml_nodes);
1704 if (xml_nodes.size() == 0)
1710 << MODULE <<
" DEBUG:" 1711 <<
"\nCould not find: " << xpath
1734 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/Time_Stamp/SCENE_CENTER_LINE";
1735 xmlDocument->
findNodes(xpath, xml_nodes);
1736 if (xml_nodes.size() == 0)
1742 << MODULE <<
" DEBUG:" 1743 <<
"\nCould not find: " << xpath
1754 xpath =
"/Dimap_Document/Data_Processing/Regions_Of_Interest/Region_Of_Interest/COL_MIN";
1755 xmlDocument->
findNodes(xpath, xml_nodes);
1756 if (xml_nodes.size() == 0)
1766 xpath =
"/Dimap_Document/Data_Processing/Regions_Of_Interest/Region_Of_Interest/ROW_MIN";
1767 xmlDocument->
findNodes(xpath, xml_nodes);
1768 if (xml_nodes.size() == 0)
1788 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/Time_Stamp/SCENE_CENTER_TIME";
1789 xmlDocument->
findNodes(xpath, xml_nodes);
1790 if (xml_nodes.size() == 0)
1796 << MODULE <<
" DEBUG:" 1797 <<
"\nCould not find: " << xpath
1809 xpath =
"/Dimap_Document/Production/DATASET_PRODUCTION_DATE";
1810 xmlDocument->
findNodes(xpath, xml_nodes);
1811 if (xml_nodes.size() == 0)
1817 << MODULE <<
" DEBUG:" 1818 <<
"\nCould not find: " << xpath
1829 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/INSTRUMENT";
1830 xmlDocument->
findNodes(xpath, xml_nodes);
1831 if (xml_nodes.size() == 0)
1837 << MODULE <<
" DEBUG:" 1838 <<
"\nCould not find: " << xpath
1849 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/INSTRUMENT_INDEX";
1850 xmlDocument->
findNodes(xpath, xml_nodes);
1851 if (xml_nodes.size() == 0)
1857 << MODULE <<
" DEBUG:" 1858 <<
"\nCould not find: " << xpath
1871 static const char MODULE[] =
"ossimSpotDimapSupportData::parsePart2";
1874 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1875 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1876 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
1877 unsigned int band_index;
1883 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/Time_Stamp/LINE_PERIOD";
1885 xmlDocument->
findNodes(xpath, xml_nodes);
1886 if (xml_nodes.size() == 0)
1892 << MODULE <<
" DEBUG:" 1893 <<
"\nCould not find: " << xpath
1909 xpath =
"/Dimap_Document/Raster_Dimensions/NBANDS";
1910 xmlDocument->
findNodes(xpath, xml_nodes);
1911 if (xml_nodes.size() == 0)
1917 << MODULE <<
" DEBUG:" 1918 <<
"\nCould not find: " << xpath
1928 << MODULE <<
" DEBUG:" 1942 << MODULE <<
" DEBUG:" 1943 <<
"\nSWIR band error..." 1971 << MODULE <<
" DEBUG:" 1984 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/" 1985 "Instrument_Look_Angles_List/Instrument_Look_Angles/";
1986 xmlDocument->
findNodes(xpath, xml_nodes);
1989 if(xml_nodes.size() == 0)
1995 << MODULE <<
" DEBUG:" 1996 <<
"\nCould not find: " << xpath
2007 xpath =
"Look_Angles_List/Look_Angles/PSI_X";
2009 xml_nodes[band_index]->findChildNodes(xpath, sub_nodes);
2034 std::vector<double> tempV(sub_nodes.size());
2036 double tempIdx = 0.0;
2037 double tempIdxFraction = 0.0;
2041 for(idx = 0; idx < sub_nodes.size();++idx)
2043 tempV[idx] = sub_nodes[idx]->getText().toDouble();
2048 tempIdx = (sub_nodes.size()-1)*t;
2057 thePixelLookAngleX.push_back(tempV[idxStart] + tempIdxFraction*(tempV[idxEnd] - tempV[idxStart]));
2069 xpath =
"Look_Angles_List/Look_Angles/PSI_Y";
2071 xml_nodes[band_index]->findChildNodes(xpath, sub_nodes);
2091 std::vector<double> tempV(sub_nodes.size());
2093 double tempIdx = 0.0;
2094 double tempIdxFraction = 0.0;
2098 for(idx = 0; idx < sub_nodes.size();++idx)
2100 tempV[idx] = sub_nodes[idx]->getText().toDouble();
2105 tempIdx = (sub_nodes.size()-1)*t;
2113 if(idxStart > idxEnd)
2117 thePixelLookAngleY.push_back(tempV[idxStart] + tempIdxFraction*(tempV[idxEnd] - tempV[idxStart]));
2134 xpath =
"/Dimap_Document/Data_Strip/Satellite_Attitudes/Corrected_Attitudes/" 2135 "Corrected_Attitude/Angles";
2136 xmlDocument->
findNodes(xpath, xml_nodes);
2137 if (xml_nodes.size() == 0)
2139 xpath =
"/Dimap_Document/Data_Strip/Satellite_Attitudes/Raw_Attitudes/Aocs_Attitude/Angles_List/Angles";
2141 xmlDocument->
findNodes(xpath, xml_nodes);
2142 if (xml_nodes.size() == 0)
2148 node = xml_nodes.begin();
2149 while (node != xml_nodes.end())
2153 xpath =
"OUT_OF_RANGE";
2154 (*node)->findChildNodes(xpath, sub_nodes);
2155 if (sub_nodes.size() == 0)
2160 if (sub_nodes[0]->getText() ==
"N")
2164 (*node)->findChildNodes(xpath, sub_nodes);
2165 if (sub_nodes.size() == 0)
2170 V.
x = sub_nodes[0]->getText().toDouble();
2174 (*node)->findChildNodes(xpath, sub_nodes);
2175 if (sub_nodes.size() == 0)
2180 V.
y = sub_nodes[0]->getText().toDouble();
2184 (*node)->findChildNodes(xpath, sub_nodes);
2185 if (sub_nodes.size() == 0)
2190 V.
z = sub_nodes[0]->getText().toDouble();
2196 (*node)->findChildNodes(xpath, sub_nodes);
2197 if (sub_nodes.size() == 0)
2214 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2215 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2216 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2225 xpath =
"/Dimap_Document/Data_Strip/Ephemeris/Points/Point";
2226 xmlDocument->
findNodes(xpath, xml_nodes);
2227 if (xml_nodes.size() == 0)
2232 node = xml_nodes.begin();
2234 while (node != xml_nodes.end())
2238 xpath =
"Location/X";
2239 (*node)->findChildNodes(xpath, sub_nodes);
2240 if (sub_nodes.size() == 0)
2245 VP.
x = sub_nodes[0]->getText().toDouble();
2248 xpath =
"Location/Y";
2249 (*node)->findChildNodes(xpath, sub_nodes);
2250 if (sub_nodes.size() == 0)
2255 VP.
y = sub_nodes[0]->getText().toDouble();
2258 xpath =
"Location/Z";
2259 (*node)->findChildNodes(xpath, sub_nodes);
2260 if (sub_nodes.size() == 0)
2265 VP.
z = sub_nodes[0]->getText().toDouble();
2271 xpath =
"Velocity/X";
2272 (*node)->findChildNodes(xpath, sub_nodes);
2273 if (sub_nodes.size() == 0)
2278 VV.
x = sub_nodes[0]->getText().toDouble();
2281 xpath =
"Velocity/Y";
2282 (*node)->findChildNodes(xpath, sub_nodes);
2283 if (sub_nodes.size() == 0)
2288 VV.
y = sub_nodes[0]->getText().toDouble();
2291 xpath =
"Velocity/Z";
2292 (*node)->findChildNodes(xpath, sub_nodes);
2293 if (sub_nodes.size() == 0)
2298 VV.
z = sub_nodes[0]->getText().toDouble();
2304 (*node)->findChildNodes(xpath, sub_nodes);
2305 if (sub_nodes.size() == 0)
2319 xpath =
"/Dimap_Document/Data_Strip/Satellite_Attitudes/Corrected_Attitudes/" 2320 "STAR_TRACKER_USED";
2321 xmlDocument->
findNodes(xpath, xml_nodes);
2322 if (xml_nodes.size() == 0)
2330 if (xml_nodes[0]->getText() ==
"Y")
2340 xpath =
"/Dimap_Document/Geoposition/Geoposition_Points/Tie_Point";
2341 xmlDocument->
findNodes(xpath, xml_nodes);
2342 node = xml_nodes.begin();
2343 while (node != xml_nodes.end())
2349 xpath =
"TIE_POINT_DATA_Y";
2350 (*node)->findChildNodes(xpath, sub_nodes);
2351 if (sub_nodes.size() == 0)
2356 ipt.
line = sub_nodes[0]->getText().toDouble() - 1.0;
2359 xpath =
"TIE_POINT_DATA_X";
2360 (*node)->findChildNodes(xpath, sub_nodes);
2361 if (sub_nodes.size() == 0)
2366 ipt.
samp = sub_nodes[0]->getText().toDouble() - 1.0;
2369 xpath =
"TIE_POINT_CRS_Y";
2370 (*node)->findChildNodes(xpath, sub_nodes);
2371 if (sub_nodes.size() == 0)
2376 gpt.
lat = sub_nodes[0]->getText().toDouble();
2379 xpath =
"TIE_POINT_CRS_X";
2380 (*node)->findChildNodes(xpath, sub_nodes);
2381 if (sub_nodes.size() == 0)
2386 gpt.
lon = sub_nodes[0]->getText().toDouble();
2389 xpath =
"TIE_POINT_CRS_Z";
2390 (*node)->findChildNodes(xpath, sub_nodes);
2391 if (sub_nodes.size() == 0)
2396 gpt.
hgt = sub_nodes[0]->getText().toDouble();
2410 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2411 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2412 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
2422 xpath =
"/Dimap_Document/Image_Interpretation/Spectral_Band_Info";
2423 xmlDocument->
findNodes(xpath, xml_nodes);
2424 node = xml_nodes.begin();
2425 while (node != xml_nodes.end())
2428 xpath =
"BAND_INDEX";
2429 (*node)->findChildNodes(xpath, sub_nodes);
2430 if (sub_nodes.size() == 0)
2436 ossim_int32 bandIndex = sub_nodes[0]->getText().toInt32() - 1;
2438 if( (bandIndex >= static_cast<int>(
theNumBands) ) || (bandIndex<0) )
2445 xpath =
"PHYSICAL_BIAS";
2446 (*node)->findChildNodes(xpath, sub_nodes);
2447 if (sub_nodes.size() == 0)
2455 xpath =
"PHYSICAL_GAIN";
2456 (*node)->findChildNodes(xpath, sub_nodes);
2457 if (sub_nodes.size() == 0)
2469 xpath =
"/Dimap_Document/Data_Strip/Sensor_Calibration/Solar_Irradiance/Band_Solar_Irradiance";
2470 xmlDocument->
findNodes(xpath, xml_nodes);
2471 node = xml_nodes.begin();
2472 while (node != xml_nodes.end())
2475 xpath =
"BAND_INDEX";
2476 (*node)->findChildNodes(xpath, sub_nodes);
2477 if (sub_nodes.size() == 0)
2483 ossim_int32 bandIndex = sub_nodes[0]->getText().toInt32() - 1;
2485 if((bandIndex >= static_cast<ossim_int32>(
theNumBands) ) || (bandIndex<0))
2492 xpath =
"SOLAR_IRRADIANCE_VALUE";
2493 (*node)->findChildNodes(xpath, sub_nodes);
2494 if (sub_nodes.size() == 0)
2511 std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2516 xpath =
"/Dimap_Document/Metadata_Id/METADATA_FORMAT";
2517 xmlDocument->
findNodes(xpath, xml_nodes);
2518 if (xml_nodes.size() == 0)
2524 <<
"DEBUG:\nCould not find: " << xpath
2532 xml_nodes[0]->getAttributeValue(value, attribute);
2537 else if (value ==
"1.1")
2548 <<
"WARNING: metadata version not found!" 2560 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2565 xpath =
"/Dimap_Document/Production/JOB_ID";
2566 xmlDocument->
findNodes(xpath, xml_nodes);
2567 if (xml_nodes.size() == 0)
2573 <<
"DEBUG:\nCould not find: " << xpath
2586 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2593 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/MISSION_INDEX";
2594 xmlDocument->
findNodes(xpath, xml_nodes);
2595 if (xml_nodes.size() == 0)
2601 <<
"DEBUG:\nCould not find: " << xpath
2606 if (xml_nodes[0]->getText() ==
"1")
2608 if (xml_nodes[0]->getText() ==
"2")
2610 if (xml_nodes[0]->getText() ==
"4")
2612 if (xml_nodes[0]->getText() ==
"5")
2619 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SUN_AZIMUTH";
2620 xmlDocument->
findNodes(xpath, xml_nodes);
2621 if (xml_nodes.size() == 0)
2627 <<
"DEBUG:\nCould not find: " << xpath
2638 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/SUN_ELEVATION";
2639 xmlDocument->
findNodes(xpath, xml_nodes);
2640 if (xml_nodes.size() == 0)
2646 <<
"DEBUG:\nCould not find: " << xpath
2657 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/INCIDENCE_ANGLE";
2658 xmlDocument->
findNodes(xpath, xml_nodes);
2659 if (xml_nodes.size() == 0)
2665 <<
"DEBUG:\nCould not find: " << xpath
2686 xpath =
"/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE";
2687 xmlDocument->
findNodes(xpath, xml_nodes);
2688 if (xml_nodes.size() == 0)
2694 <<
"DEBUG:\nCould not find: " << xpath
2704 xpath =
"/Dimap_Document/Data_Strip/Ephemeris/SATELLITE_ALTITUDE";
2707 xmlDocument->
findNodes(xpath, xml_nodes);
2708 if (xml_nodes.size() == 0)
2714 <<
"DEBUG:\nCould not find: " << xpath
2720 double theSatelliteAltitude = xml_nodes[0]->getText().
toDouble();
2721 double RT = 63710087714.0;
2729 xpath =
"/Dimap_Document/Data_Strip/Sensor_Configuration/Mirror_Position/STEP_COUNT";
2730 xmlDocument->
findNodes(xpath, xml_nodes);
2731 if (xml_nodes.size() == 0)
2737 <<
"DEBUG:\nCould not find: " << xpath
2751 vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2757 xpath =
"/Dimap_Document/Dataset_Frame/Vertex";
2758 xmlDocument->
findNodes(xpath, xml_nodes);
2759 if (xml_nodes.size() != 4)
2764 std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
2765 while (node != xml_nodes.end())
2770 std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2771 xpath =
"FRAME_LAT";
2772 (*node)->findChildNodes(xpath, sub_nodes);
2773 if (sub_nodes.size() == 0)
2778 gpt.
lat = sub_nodes[0]->getText().toDouble();
2781 xpath =
"FRAME_LON";
2782 (*node)->findChildNodes(xpath, sub_nodes);
2783 if (sub_nodes.size() == 0)
2788 gpt.
lon = sub_nodes[0]->getText().toDouble();
2792 xpath =
"FRAME_ROW";
2793 (*node)->findChildNodes(xpath, sub_nodes);
2794 if (sub_nodes.size() == 0)
2799 ipt.
line = sub_nodes[0]->getText().toDouble() - 1.0;
2802 xpath =
"FRAME_COL";
2803 (*node)->findChildNodes(xpath, sub_nodes);
2804 if (sub_nodes.size() == 0)
2809 ipt.
samp = sub_nodes[0]->getText().toDouble() - 1.0;
2831 xpath =
"/Dimap_Document/Dataset_Frame/Scene_Center/FRAME_LON";
2832 xmlDocument->
findNodes(xpath, xml_nodes);
2833 if (xml_nodes.size() != 1)
2841 xpath =
"/Dimap_Document/Dataset_Frame/Scene_Center/FRAME_LAT";
2842 xmlDocument->
findNodes(xpath, xml_nodes);
2843 if (xml_nodes.size() != 1)
2855 xpath =
"/Dimap_Document/Dataset_Frame/SCENE_ORIENTATION";
2856 xmlDocument->
findNodes(xpath, xml_nodes);
2857 if (xml_nodes.size() == 0)
2863 <<
"DEBUG:\nCould not find: " << xpath
void getGeoPosPoint(ossim_uint32 point, ossimDpt &ip, ossimGpt &gp) const
virtual const ossimDatum * create(const ossimString &code) const
create method
void clear()
Erases the entire container.
void getEphSampTime(ossim_uint32 sample, ossim_float64 &et) const
void extrapolateAttitude(const ossim_float64 &time, ossimDpt3d &at) const
ossim_float64 convertTimeStamp(const ossimString &time_stamp) const
bool parsePart2(ossimRefPtr< ossimXmlDocument > xmlDocument)
void getSceneOrientation(ossim_float64 &so) const
bool initFramePoints(ossimRefPtr< ossimXmlDocument > xmlDocument)
Frame points:
std::vector< ossimDpt3d > theAttitudeSamples
ossim_uint32 getNumAttSamples() const
bool loadXmlFile(const ossimFilename &file, bool processSwir=false)
std::vector< ossim_float64 > thePixelLookAngleY
void getPixelLookAngleX(ossim_uint32 sample, ossim_float64 &pa) const
ossimString getMetadataVersionString() const
ossim_uint32 getNumEphSamples() const
ossim_float64 theSceneOrientation
bool parsePart3(ossimRefPtr< ossimXmlDocument > xmlDocument)
ossimString theProductionDate
bool parsePart1(ossimRefPtr< ossimXmlDocument > xmlDocument)
Private parse methods called by loadXml.
static const char * IMAGE_DATE_KW
double lond() const
Will convert the radian measure to degrees.
void printInfo(ostream &os) const
Represents serializable keyword/value map.
ossim_float64 theSunAzimuth
std::basic_ifstream< char > ifstream
Class for char input file streams.
bool initImageId(ossimRefPtr< ossimXmlDocument > xmlDocument)
Initializes theImageId.
const char * find(const char *key) const
ossim_int64 fileSize() const
void getImageRect(ossimDrect &rect) const
Zero based image rectangle, sub image if there is one.
double nan()
Method to return ieee floating point double precision NAN.
bool contains(char aChar) const
virtual const ossimString & code() const
ossimSpotDimapSupportData()
void getInterpolatedLookAngle(const ossim_float64 &p, const std::vector< ossim_float64 > &angles, ossim_float64 &la) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossim_float64 theViewingAngle
bool isSwirDataUsed() const
ossim_float64 hgt
Height in meters above the ellipsiod.
void getSunAzimuth(ossim_float64 &az) const
ossim_uint32 toUInt32() const
std::vector< ossim_float64 > theEphSampTimes
void getRefImagePoint(ossimDpt &rp) const
zero base center point
ossimFilename theMetadataFile
void getViewingAngle(ossim_float64 &va) const
ossim_float64 theRefLineTime
relative to full image
double latd() const
Will convert the radian measure to degrees.
void getUrCorner(ossimGpt &pt) const
static const char * TYPE_KW
virtual ~ossimSpotDimapSupportData()
void getAttitude(ossim_uint32 sample, ossimDpt3d &at) const
ossim_uint32 theInstrumentIndex
ossimString getAcquisitionDate() const
void getVelocityEcf(ossim_uint32 sample, ossimEcefPoint &ve) const
void getPixelLookAngleY(ossim_uint32 sample, ossim_float64 &pa) const
void getImageSize(ossimDpt &sz) const
const ossimDatum * datum() const
datum().
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimString getInstrument() const
ossimDpt theRefImagePoint
Zero based center of frame.
std::vector< ossim_float64 > theSolarIrradiance
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it's the center of that.
ossim_float64 theRefLineTimeLine
relative to full image
void getUlCorner(ossimGpt &pt) const
virtual void clearErrorStatus() const
ossim_uint32 getNumberOfBands() const
ossim_float64 theIncidenceAngle
ossimDpt createDpt(const ossimString &s) const
void getLagrangeInterpolation(const ossim_float64 &t, const std::vector< ossimDpt3d > &V, const std::vector< ossim_float64 > &T, ossimDpt3d &li) const
ossimSpotMetadataVersion theMetadataVersion
ossim_uint32 theStepCount
std::vector< ossim_float64 > thePhysicalBias
callibration information for radiometric corrections
unsigned int ossim_uint32
void getSunElevation(ossim_float64 &el) const
std::vector< ossimDpt > theGeoPosImagePoints
ossimString getImageID() const
static ossimDatumFactory * instance()
ossimGpt createGround(const ossimString &s) const
bool isStarTrackerUsed() const
static const char * NUMBER_BANDS_KW
ossimString getProductionDate() const
void getRefLineTimeLine(ossim_float64 &rtl) const
relative to full frame.
void getRefGroundPoint(ossimGpt &gp) const
Center of frame, sub image if there is one.
bool initSceneSource(ossimRefPtr< ossimXmlDocument > xmlDocument)
From xml section: /Dimap_Document/Dataset_Sources/Source_Information/Scene_Source.
static const char * AZIMUTH_ANGLE_KW
bool parsePart4(ossimRefPtr< ossimXmlDocument > xmlDocument)
void getAttSampTime(ossim_uint32 sample, ossim_float64 &at) const
ossimString theAcquisitionDate
ossim_float64 theLineSamplingPeriod
ossimString theInstrument
void getLineSamplingPeriod(ossim_float64 &pe) const
std::vector< ossimDpt3d > thePosEcfSamples
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
std::vector< ossimDpt3d > theVelEcfSamples
virtual ossimErrorCode getErrorStatus() const
ossim_uint32 getStepCount() const
void getLlCorner(ossimGpt &pt) const
bool initMetadataVersion(ossimRefPtr< ossimXmlDocument > xmlDocument)
Initializes theMetadataVersion.
std::vector< ossim_float64 > thePixelLookAngleX
virtual void setErrorStatus() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
std::vector< ossimGpt > theGeoPosGroundPoints
bool read(std::istream &in)
ossimDpt theSubImageOffset
virtual ossimObject * dup() const
void getPositionEcf(ossim_uint32 sample, ossimEcefPoint &pe) const
void getIncidenceAngle(ossim_float64 &ia) const
ossim_uint32 getNumGeoPosPoints() const
ossimString getSensorID() const
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
std::basic_istringstream< char > istringstream
Class for char input memory streams.
static const char * ELEVATION_ANGLE_KW
ossimFilename getMetadataFile() const
ossim_uint32 theDetectorCount
holds the size of thePixelLookAngleX/Y
ossim_float64 theSunElevation
void getSubImageOffset(ossimDpt &offset) const
std::vector< ossim_float64 > theAttSampTimes
std::vector< ossim_float64 > thePhysicalGain
void getRefLineTime(ossim_float64 &rt) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void getBilinearInterpolation(const ossim_float64 &t, const std::vector< ossimDpt3d > &V, const std::vector< ossim_float64 > &T, ossimDpt3d &li) const
std::basic_ostream< char > ostream
Base class for char output streams.
void getLrCorner(ossimGpt &pt) const
ossim_uint32 getInstrumentIndex() const
const std::string & string() const