diff --git a/docs/src/index.rst b/docs/src/index.rst index d34d5e3b..588d6517 100644 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -25,6 +25,16 @@ AARE pyVarClusterFinder +.. toctree:: + :caption: Python API + :maxdepth: 1 + + pyFile + pyCtbRawFile + pyRawMasterFile + pyVarClusterFinder + + .. toctree:: :caption: C++ API :maxdepth: 1 diff --git a/include/aare/RawFile.hpp b/include/aare/RawFile.hpp index b3fa7ccc..eb044e36 100644 --- a/include/aare/RawFile.hpp +++ b/include/aare/RawFile.hpp @@ -64,6 +64,7 @@ class RawFile : public FileInterface { void read_into(std::byte *image_buf, DetectorHeader *header); void read_into(std::byte *image_buf, size_t n_frames, DetectorHeader *header); + size_t frame_number(size_t frame_index) override; size_t bytes_per_frame() override; size_t pixels_per_frame() override; @@ -74,13 +75,13 @@ class RawFile : public FileInterface { size_t rows() const override; size_t cols() const override; size_t bitdepth() const override; - xy geometry(); size_t n_mod() const; RawMasterFile master() const; + DetectorType detector_type() const override; private: diff --git a/include/aare/RawMasterFile.hpp b/include/aare/RawMasterFile.hpp index 268de31d..f65d3078 100644 --- a/include/aare/RawMasterFile.hpp +++ b/include/aare/RawMasterFile.hpp @@ -70,6 +70,7 @@ struct ROI{ size_t width() const { return xmax - xmin; } }__attribute__((packed)); + /** * @brief Class for parsing a master file either in our .json format or the old * .raw format diff --git a/python/examples/play.py b/python/examples/play.py index 7e4eb579..43d585c3 100644 --- a/python/examples/play.py +++ b/python/examples/play.py @@ -78,6 +78,8 @@ def get_Mh02_frames(fname): # # cols = 1024-roi.xmin # # sf = RawSubFile(base / raw, DetectorType.Jungfrau, rows, cols, 16) +from aare import RawFile + from aare import RawFile, File @@ -87,6 +89,7 @@ def get_Mh02_frames(fname): # fname = Path(base / 'jungfrau/jungfrau_single_master_0.json') # fname = base / 'Stacked/241024_JF10_m450_m367_KnifeEdge_TestBesom_9keV_750umFilter_PedestalStart_ZPos_-6_master_0.json' + f = RawFile(fname) h,img = f.read_frame() print(f'{h["frameNumber"]}') diff --git a/python/src/file.hpp b/python/src/file.hpp index a7c3a9c8..79c0148a 100644 --- a/python/src/file.hpp +++ b/python/src/file.hpp @@ -169,7 +169,7 @@ void define_file_io_bindings(py::module &m) { }); - + py::class_(m, "ScanParameters") .def(py::init()) .def(py::init()) @@ -199,6 +199,7 @@ void define_file_io_bindings(py::module &m) { + py::class_(m, "RawSubFile") .def(py::init()) diff --git a/src/RawFile.cpp b/src/RawFile.cpp index c1b9c521..0e4c8b84 100644 --- a/src/RawFile.cpp +++ b/src/RawFile.cpp @@ -49,6 +49,7 @@ void RawFile::read_into(std::byte *image_buf) { void RawFile::read_into(std::byte *image_buf, DetectorHeader *header) { + return get_frame_into(m_current_frame++, image_buf, header); }; @@ -61,6 +62,7 @@ void RawFile::read_into(std::byte *image_buf, size_t n_frames, DetectorHeader *h if(header) header+=n_mod(); } + }; size_t RawFile::n_mod() const { return n_subfile_parts; } @@ -128,7 +130,6 @@ DetectorHeader RawFile::read_header(const std::filesystem::path &fname) { return h; } - int RawFile::find_number_of_subfiles() { int n_files = 0; // f0,f1...fn How many files is the data split into? @@ -219,6 +220,7 @@ void RawFile::update_geometry_with_roi() { } else { if ((roi.ymin > m.y) && (roi.ymin < m.y + m.height)) { m.height -= roi.ymin - m.y; + } if (roi.ymax < m.y + m.height) { m.height -= m.y + original_height - roi.ymax;