diff --git a/tests/meson.build b/tests/meson.build index 0c045fa..6a7379f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -16,4 +16,5 @@ subdir('network') # Subdirectories for sandbox tests subdir('dobj_sandbox') +subdir('opatIO_sandbox') diff --git a/tests/opatIO_sandbox/GS98hz.opat b/tests/opatIO_sandbox/GS98hz.opat new file mode 100644 index 0000000..43e5baf Binary files /dev/null and b/tests/opatIO_sandbox/GS98hz.opat differ diff --git a/tests/opatIO_sandbox/meson.build b/tests/opatIO_sandbox/meson.build new file mode 100644 index 0000000..095c09a --- /dev/null +++ b/tests/opatIO_sandbox/meson.build @@ -0,0 +1 @@ +executable('tryGS98', 'opacity.cpp', dependencies: [opatio_dep]) \ No newline at end of file diff --git a/tests/opatIO_sandbox/opacity.cpp b/tests/opatIO_sandbox/opacity.cpp new file mode 100644 index 0000000..72ddb04 --- /dev/null +++ b/tests/opatIO_sandbox/opacity.cpp @@ -0,0 +1,28 @@ +#include +#include +//#include +#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 = 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 index = {0.1, 0.001}; + OPATTable tab = opatIO.getTable(index); + +}