Feature/reactivate python bindings (#74)

major changes:
- add python bindings for all c++ features except network_io
- changes to cross compile on windows,linux and macos
- fix bugs with cluster_finder
- use Dtype in Frame instead of bitdepth
- remove boost::program_options and replace with our implementation 
- add Transforms class that applies a sequence of functions (c++ or
python functions) on a Frame.
- remove frame reorder and flip from SubFile.cpp. use Transforms instead
- Test clusterFinder and Pedestal results in comparison with
slsDetectorCalibration

---------

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
Bechir Braham
2024-07-04 11:51:48 +02:00
committed by GitHub
parent 5b7ab5a810
commit 68dcfca74e
107 changed files with 11451 additions and 1476 deletions

View File

@ -1,39 +1,19 @@
#include "aare.hpp"
#include "aare/examples/defs.hpp"
#include <boost/program_options.hpp>
#include <cassert>
#include <fmt/core.h>
#include <string>
using namespace aare;
namespace po = boost::program_options;
using namespace std;
int main(int argc, char **argv) {
aare::logger::set_verbosity(aare::logger::DEBUG);
po::options_description desc("options");
desc.add_options()("help", "produce help message")("port,p", po::value<uint16_t>()->default_value(5555),
"port number");
po::positional_options_description pd;
pd.add("port", 1);
po::variables_map vm;
try {
auto parsed = po::command_line_parser(argc, argv).options(desc).positional(pd).run();
po::store(parsed, vm);
po::notify(vm);
} catch (const boost::program_options::error &e) {
cout << e.what() << "\n";
cout << desc << "\n";
return 1;
}
if (vm.count("help")) {
cout << desc << "\n";
return 1;
}
auto port = vm["port"].as<uint16_t>();
ArgParser parser("Zmq receiver example");
parser.add_option("port", "p", true, false, "5555", "port number");
auto args = parser.parse(argc, argv);
int port = std::stoi(args["port"]);
std::string const endpoint = "tcp://127.0.0.1:" + std::to_string(port);
aare::ZmqSocketReceiver socket(endpoint);
@ -43,7 +23,7 @@ int main(int argc, char **argv) {
aare::logger::info("Received ", v.size(), " frames");
aare::logger::info("acquisition:", v[0].header.acqIndex);
aare::logger::info("Header size:", v[0].header.to_string().size());
aare::logger::info("Frame size:", v[0].frame.size());
aare::logger::info("Frame size:", v[0].frame.bytes());
aare::logger::info("Header:", v[0].header.to_string());
// for (ZmqFrame zmq_frame : v) {