feat(opatIO_sandbox): added opatIO sandbox for freeform testing

This commit is contained in:
2025-03-22 14:26:31 -04:00
parent f6f35996cc
commit f3e79d9366
4 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include <vector>
#include <iostream>
//#include <string>
#include "opatIO.h"
int main() {
std::string FILENAME = "GS98hz.opat";
OpatIO opatIO(FILENAME);
Header header = opatIO.getHeader();
std::cout << header.version << std::endl;
std::cout << header.comment << std::endl;
std::cout << header.numTables << std::endl;
std::vector<TableIndex> tableIndex = opatIO.getTableIndex();
//print out the X,Z pairs in the table
for (size_t i=0; i< tableIndex.size()-1; i++){
std::cout << "Table [" << i << "]: {" << tableIndex[i].index.at(0) << ", "
<< tableIndex[i].index.at(1) << "}" << std::endl;
}
//find the table index corresponding to X=0.1, Z=0.001
std::vector<double> index = {0.1, 0.001};
OPATTable tab = opatIO.getTable(index);
}