Skip to content

Commit

Permalink
enable online reco for files with sub periods
Browse files Browse the repository at this point in the history
  • Loading branch information
jusack committed Apr 26, 2024
1 parent 4cb45f5 commit 1c54b27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Brukerfile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -433,20 +433,22 @@ function measData(b::BrukerFileMeas, frames=1:acqNumFrames(b), periods=1:acqNumP
if numSubPeriods(b) == 1
raw = Mmap.mmap(s, Array{dType,4},
(rxNumSamplingPoints(b),rxNumChannels(b),acqNumPeriodsPerFrame(b),acqNumFrames(b)))
data = raw[:,receivers,periods,frames]
else
if b.handleSubPeriodsAsFrames
raw = Mmap.mmap(s, Array{dType,5}, (rxNumSamplingPoints(b),numSubPeriods(b),rxNumChannels(b),
acqNumPeriodsPerFrame(b), div(acqNumFrames(b),numSubPeriods(b))))

raw = reshape(permutedims(collect(raw), (1,3,4,2,5)), Val(4))
data = raw[:,receivers,periods,frames]
else
raw = Mmap.mmap(s, Array{dType,5},
(rxNumSamplingPoints(b),numSubPeriods(b),rxNumChannels(b),acqNumPeriodsPerFrame(b),acqNumFrames(b)))

raw = dropdims(sum(raw,dims=2),dims=2)
data = dropdims(sum(raw[:,:,receivers,periods,frames],dims=2),dims=2)
end
end
data = raw[:,receivers,periods,frames]

close(s)

return reshape(data, rxNumSamplingPoints(b), length(receivers),length(periods),length(frames))
Expand Down Expand Up @@ -770,5 +772,4 @@ function getBV(b; recChannels=1:rxNumChannels(b))
data = Mmap.mmap(s, Array{Float64,2}, (nFreq,rxNumChannels(b)))
close(s)
return data
end

end

0 comments on commit 1c54b27

Please sign in to comment.