Newer
Older
int main(int argc, char const *argv[])
{
// -------------------------------------------------------------------------
// --- Grabbing the input args
// -------------------------------------------------------------------------
if( argc < 3 ){
std::cerr << "Wrong number of arguments given." << std::endl
<< "Specify input ODF file and output HDF5 file." << std::endl;
return -1;
}
std::string odfFilename = argv[1];
std::string hdf5Filename = argv[2];
std::cout << "Reading from file: " << odfFilename << std::endl;
std::cout << "Writing to file: " << hdf5Filename << std::endl;
// -------------------------------------------------------------------------
// --- Read ODF file
// -------------------------------------------------------------------------
std::vector<std::vector<double>> data;
// --- Open file ---
std::ifstream in( odfFilename, std::ios::in | std::ios::binary );
// --- kill bad open ---
if( !in.is_open() ){
std::cerr << "Error opening file: " << odfFilename << std::endl;
return 1;
}
in.close();
// -------------------------------------------------------------------------
// --- Output HDF5 file
// -------------------------------------------------------------------------
sammy::Hdf5IO h5writer;
h5writer.writeODFtoHDF5(odf.getHeader(),data,hdf5Filename);