aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-02-21 14:11:46 +0100
committerThomas White <taw@physics.org>2024-02-21 14:13:46 +0100
commitfc78b43a4057be4216b55c3f8999f8f4296c04d9 (patch)
tree5ccf241f9285082101b61f5c2170e10023c4a617
parentc75b2030b9c040c07c507f47822257879399e85d (diff)
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().
-rw-r--r--julia/CrystFEL/src/streams.jl6
1 files 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))