mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
3 - Jf rawdataprocess wildcards (#723)
* Fix ROI mapping * Formatting * Minor edit * intial draft of cmake for jungfrau executables Makefile.rawdataprocess * added the cmake file * missed Makefile * added libfmt * Fix some compiler warnings * Fix some compiler warnings * Create filename usining fmt::format * Rewrite command line parsing with std::string and fmt::format * Fix file reading * Fix root string extraction * Fix ifstream file reading * Clean up comments * Add version of rawdataprocess with bash wildcards * Add version of rawdataprocess that reads inputs from txt-file, still buggy * fixing missing cstdint --------- Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain> Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch> Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
@ -41,6 +41,7 @@
|
||||
#include <ctime>
|
||||
#include <fmt/core.h>
|
||||
|
||||
|
||||
std::string getRootString( const std::string& filepath ) {
|
||||
size_t pos1 = filepath.find_last_of("/");
|
||||
size_t pos2 = filepath.find_last_of(".");
|
||||
@ -56,14 +57,16 @@ std::string getRootString( const std::string& filepath ) {
|
||||
// mindex: module index ("d0" in standard)
|
||||
// findex: file index for one acquisition ("f0")
|
||||
// aindex: acquisition index (i.e. "run number")
|
||||
|
||||
std::string createFileName( const std::string& dir, const std::string& fprefix="run", const std::string& fsuffix="", const std::string& fext="raw", int aindex=0, int mindex=0, int findex=0, int outfilecounter=-1 ) {
|
||||
std::string filename{};
|
||||
if (outfilecounter >= 0)
|
||||
return fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}_f{:05d}.{:s}", dir, fprefix, mindex, findex, aindex, outfilecounter, fext);
|
||||
filename = fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}_f{:05d}.{:s}", dir, fprefix, mindex, findex, aindex, outfilecounter, fext);
|
||||
else if (fsuffix.length()!=0)
|
||||
return fmt::format("{:s}/{:s}_{:s}.{:s}", dir, fprefix, fsuffix, fext);
|
||||
filename = fmt::format("{:s}/{:s}_{:s}.{:s}", dir, fprefix, fsuffix, fext);
|
||||
else
|
||||
return fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}.{:s}", dir, fprefix, mindex, findex, aindex, fext);
|
||||
filename = fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}.{:s}", dir, fprefix, mindex, findex, aindex, fext);
|
||||
return filename;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
Reference in New Issue
Block a user