Skip to content

Commit

Permalink
Update ge_read_pfile.py
Browse files Browse the repository at this point in the history
- Updated the `mult` and `multw` factors to match the current ones used in Gannet [NOTE: These have still not been completely finalized and may need to be adjusted in the future]
- Some cosmetic edits
  • Loading branch information
markmikkelsen committed Mar 11, 2024
1 parent 284fe9a commit 88df411
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spec2nii/GE/ge_read_pfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,18 +1247,17 @@ def read_data(self):
tempData = tempData.view(np.complex64)

if nechoes == 1:
tempData = tempData.reshape((1, 1, 1, nreceivers, totalframes, npoints))
self.raw_data = np.swapaxes(tempData, -1, -3)

if (dataframes + refframes) != nframes:
if int(dataframes + refframes) != nframes:
mult = 1
dataframes *= nex
refframes = int(nframes - dataframes)
else:
mult = 1 / nex

self.raw_unsuppressed = self.raw_data[:, :, :, :, 1:(refframes + 1), :]
self.raw_suppressed = self.raw_data[:, :, :, :, (refframes + 1):, :]
tempData = tempData.reshape((1, 1, 1, nreceivers, totalframes, npoints))
self.raw_data = np.swapaxes(tempData, -1, -3)
self.raw_unsuppressed = self.raw_data[:, :, :, :, 1:(refframes + 1), :] * mult
self.raw_suppressed = self.raw_data[:, :, :, :, (refframes + 1):, :] * mult / 2

else:
if int(dataframes + refframes) != nframes:
Expand All @@ -1268,7 +1267,11 @@ def read_data(self):
dataframes *= nex
refframes = nframes - dataframes
else:
mult = nex / 2
# MM: Change mult to match latest code in Gannet (2020)
# Previous factors:
# mult: 1 (RTN 2017), nex / 2 (RTN 2016)
# multw: 1 / nex (RTN 2017), 1 (RTN 2016)
mult = 1 / nex
multw = 1
noadd = 0

Expand Down

0 comments on commit 88df411

Please sign in to comment.