mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-04 00:50:42 +02:00
minor
This commit is contained in:
parent
77c1ffffb1
commit
248306d570
@ -5,11 +5,19 @@ sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
||||
from sls_detector import Eiger
|
||||
from sls_detector import ExperimentalDetector
|
||||
|
||||
from _sls_detector.io import read_ctb_file
|
||||
from _sls_detector.io import read_my302_file
|
||||
|
||||
d = Eiger()
|
||||
e = ExperimentalDetector()
|
||||
|
||||
|
||||
# for i in range(200):
|
||||
# a = read_my302_file('/home/l_frojdh/Downloads/run_d0_5.raw', i, 24)
|
||||
# print(f'{i}: {(a==5).sum()}')
|
||||
|
||||
|
||||
|
||||
a = read_my302_file('/home/l_frojdh/Downloads/run_d0_5.raw', 104, 24)
|
||||
# ncols = 192
|
||||
# start = 600
|
||||
# end = 1800
|
||||
|
@ -286,7 +286,7 @@ py::class_<multiSlsDetector> multiDetectorApi(m, "multiDetectorApi");
|
||||
;
|
||||
|
||||
py::module io = m.def_submodule("io", "Submodule for io");
|
||||
io.def("read_ctb_file", &read_ctb_file, "some");
|
||||
io.def("read_my302_file", &read_my302_file, "some");
|
||||
|
||||
|
||||
#ifdef VERSION_INFO
|
||||
|
@ -55,10 +55,10 @@ std::vector<int> ExtractBits(const std::vector<uint64_t> &data, int dr = 24) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<uint64_t> ReadFile(const std::string &fname, int offset = 8,
|
||||
std::vector<uint64_t> ReadFile(const std::string &fname, int byte_offset = 8,
|
||||
int dr = 24) {
|
||||
const int element_size = static_cast<int>(sizeof(uint64_t));
|
||||
const int byte_offset = element_size * offset;
|
||||
// const int byte_offset = element_size * offset;
|
||||
const int expected_size = dr * element_size * 32 * 3;
|
||||
std::ifstream fs(fname, std::ios::binary | std::ios::ate);
|
||||
if (!fs.is_open()) {
|
||||
@ -78,7 +78,7 @@ std::vector<uint64_t> ReadFile(const std::string &fname, int offset = 8,
|
||||
return data;
|
||||
}
|
||||
|
||||
py::array_t<uint64_t> read_ctb_file(const std::string &fname, int offset = 8,
|
||||
py::array_t<uint64_t> read_my302_file(const std::string &fname, int offset = 8,
|
||||
int dr = 24) {
|
||||
auto data = ExtractBits<17, 6>(ReadFile(fname, offset, dr));
|
||||
return py::array(data.size(), data.data());
|
||||
|
@ -62,7 +62,7 @@ SCENARIO("Multi detector operation", "[detector]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Set and get partialFramesPadding", "[detector]"){
|
||||
TEST_CASE("Set and get partialFramesPadding", "[detector][somenewtag]"){
|
||||
|
||||
multiSlsDetector::freeSharedMemory(20, -1);
|
||||
multiSlsDetector m(20);
|
||||
|
Loading…
x
Reference in New Issue
Block a user