RawFile is now using RawMasterFile

This commit is contained in:
Erik Fröjdh
2024-11-06 09:10:09 +01:00
parent 654c1db3f4
commit 25812cb291
20 changed files with 511 additions and 408 deletions

View File

@ -1,5 +1,5 @@
# Make the compiled classes that live in _aare available from aare.
from . import _aare
from ._aare import VarClusterFinder, File
from ._aare import VarClusterFinder, File, RawMasterFile
from .CtbRawFile import CtbRawFile

View File

@ -26,7 +26,8 @@ fpath = Path('/Users/erik/data/Moench05/moench05_multifile_master_0.json')
with CtbRawFile(fpath, transform = transform.moench05) as f:
for header, image in f:
print(f'Frame number: {header["frameNumber"]}')
# with CtbRawFile(fpath, transform = transform.moench05) as f:
# for header, image in f:
# print(f'Frame number: {header["frameNumber"]}')
f = aare.RawMasterFile(fpath)

View File

@ -1,4 +1,5 @@
#include "aare/CtbRawFile.hpp"
#include "aare/RawMasterFile.hpp"
#include "aare/File.hpp"
#include "aare/Frame.hpp"
#include "aare/defs.hpp"
@ -149,6 +150,25 @@ void define_file_io_bindings(py::module &m) {
return "<FileConfig: " + a.to_string() + ">";
});
py::class_<RawMasterFile>(m, "RawMasterFile")
.def(py::init<const std::filesystem::path &>())
.def("data_fname", &RawMasterFile::data_fname)
.def_property_readonly("version", &RawMasterFile::version)
.def_property_readonly("detector_type", &RawMasterFile::detector_type)
.def_property_readonly("timing_mode", &RawMasterFile::timing_mode)
.def_property_readonly("image_size_in_bytes",
&RawMasterFile::image_size_in_bytes)
.def_property_readonly("frames_in_file", &RawMasterFile::frames_in_file)
.def_property_readonly("pixels_y", &RawMasterFile::pixels_y)
.def_property_readonly("pixels_x", &RawMasterFile::pixels_x)
.def_property_readonly("max_frames_per_file",
&RawMasterFile::max_frames_per_file)
.def_property_readonly("bitdepth", &RawMasterFile::bitdepth)
.def_property_readonly("analog_samples", &RawMasterFile::analog_samples)
.def_property_readonly("digital_samples",
&RawMasterFile::digital_samples);
// py::class_<ClusterHeader>(m, "ClusterHeader")
// .def(py::init<>())
// .def_readwrite("frame_number", &ClusterHeader::frame_number)