Skip to content

Commit

Permalink
Simplify reading serial numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-alexandrov committed Dec 16, 2023
1 parent 9e23442 commit 069c314
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/asp/Camera/BundleAdjustIsis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ void readSerialNumbers(std::string const& outputPrefix,
serialNumbers.clear();

try {
// Create a list of cub files. Need this to find the serial numbers
std::string cubeList = outputPrefix + "-list.txt";
vw::vw_out() << "Writing image list: " << cubeList << std::endl;
asp::write_list(cubeList, image_files);
Isis::SerialNumberList serial_list(QString::fromStdString(cubeList));
Isis::SerialNumberList serial_list;
for (size_t i = 0; i < image_files.size(); i++) {
QString fileName = QString::fromStdString(image_files[i]);
serial_list.add(fileName);
}
for (size_t i = 0; i < image_files.size(); i++) {
QString fileName = serial_list.fileName(i);
QString serialNumber = serial_list.serialNumber(i);
serialNumbers.push_back(serialNumber.toStdString());
}
} catch (...) {
// The above will fail for non-ISIS images.
serialNumbers.clear();
for (size_t i = 0; i < image_files.size(); i++) {
serialNumbers.push_back(image_files[i]);
}
Expand Down

0 comments on commit 069c314

Please sign in to comment.