27 arma::vec &x, arma::vec &y)
33 H5File file(filename, H5F_ACC_RDONLY);
35 DataSet ds = file.openDataSet(
"Spectra");
36 DataSpace dspace = ds.getSpace();
38 dspace.getSimpleExtentDims(dims);
39 spectra.set_size(dims[0], dims[1]);
40 ds.read(spectra.memptr(), PredType::NATIVE_DOUBLE);
42 ds = file.openDataSet(
"x");
43 dspace = ds.getSpace();
44 dspace.getSimpleExtentDims(dims);
47 ds.read(x.memptr(), PredType::NATIVE_DOUBLE);
50 ds = file.openDataSet(
"y");
51 dspace = ds.getSpace();
52 dspace.getSimpleExtentDims(dims);
55 ds.read(y.memptr(), PredType::NATIVE_DOUBLE);
58 ds = file.openDataSet(
"Spectral Abscissa");
59 dspace = ds.getSpace();
60 dspace.getSimpleExtentDims(dims);
62 abscissa.set_size(dims[0]);
63 ds.read(abscissa.memptr(), PredType::NATIVE_DOUBLE);
73 arma::uvec sorted_indices = arma::stable_sort_index(abscissa);
74 abscissa = abscissa.rows(sorted_indices);
75 spectra = spectra.rows(sorted_indices);
84 arma::vec &x, arma::vec &y)
87 arma::field<arma::mat> input_data;
88 bool success = input_data.load(filename);
89 std::cout << (success ?
"success" :
"failure") << std::endl;
91 spectra = input_data(0);
92 abscissa = input_data(1);
VESPUCCI_EXPORT bool ImportVespucciBinary(std::string filename, arma::mat &spectra, arma::vec &abscissa, arma::vec &x, arma::vec &y)
VESPUCCI_EXPORT bool ImportOldVespucciBinary(std::string filename, arma::mat &spectra, arma::vec &abscissa, arma::vec &x, arma::vec &y)
VESPUCCI_EXPORT void ResetDataset(arma::mat &spectra, arma::vec &x, arma::vec &y, arma::vec &abscissa)