From fc78b43a4057be4216b55c3f8999f8f4296c04d9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 21 Feb 2024 14:11:46 +0100 Subject: Julia: chunkread: Expose option for reconstructing image data arrays/detgeom It makes a big performance difference to avoid creating these arrays. We will just need to deal with the fact that an Image might not have a DetGeom or data arrays. This commit also sets sensible chunkread options for allcrystals(). --- julia/CrystFEL/src/streams.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/julia/CrystFEL/src/streams.jl b/julia/CrystFEL/src/streams.jl index 798663e1..ce75c906 100644 --- a/julia/CrystFEL/src/streams.jl +++ b/julia/CrystFEL/src/streams.jl @@ -106,11 +106,11 @@ function chunkwrite(st::Stream, image::Image; peaks=true, reflections=true) end -function chunkread(st::Stream; peaks=true, reflections=true) +function chunkread(st::Stream; peaks=true, reflections=true, datageom=true) st.internalptr == C_NULL && throw(ErrorException("Stream is closed")) - flags = streamflags(peaks, reflections, true) + flags = streamflags(peaks, reflections, datageom) out = @ccall libcrystfel.stream_read_chunk(st.internalptr::Ptr{InternalStream}, flags::Cint)::Ptr{InternalImage} out == C_NULL && return nothing @@ -125,7 +125,7 @@ end function allcrystals(st) Channel() do ch while true - image = chunkread(st) + image = chunkread(st, peaks=false, reflections=true, datageom=false) image === nothing && break for cr in image.crystals put!(ch, (cr.crystal, cr.reflections)) -- cgit v1.2.3