Skip to content

Commit

Permalink
🔀 Fix typo & fix return syntax (#56)
Browse files Browse the repository at this point in the history
* Fix typo in `make_arbitrary_rf.py`
* Fix return syntax in `make_arbitrary_rf.py`

Co-authored-by: Keerthi Sravan Ravi <[email protected]>
Co-authored-by: veldmannm <[email protected]>
  • Loading branch information
3 people authored Jun 22, 2021
1 parent de4b3eb commit 2548f0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/readthedocs_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
furo==2021.4.11b34
7 changes: 5 additions & 2 deletions pypulseq/make_arbitrary_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def make_arbitrary_rf(signal: np.ndarray, flip_angle: float, bandwidth: float =
signal = np.squeeze(signal)
if signal.ndim > 1:
raise ValueError(f'signal should have ndim=1. Passed ndim={signal.ndim}')
signal = signal / bp.abs(np.sum(signal * system.rf_raster_time)) * flip_angle / (2 * np.pi)
signal = signal / np.abs(np.sum(signal * system.rf_raster_time)) * flip_angle / (2 * np.pi)

N = len(signal)
duration = N * system.rf_raster_time
Expand Down Expand Up @@ -121,4 +121,7 @@ def make_arbitrary_rf(signal: np.ndarray, flip_angle: float, bandwidth: float =
rf.t = np.concatenate((rf.t, rf.t[-1] + t_fill))
rf.signal = np.concatenate((rf.signal, np.zeros(len(t_fill))))

return rf, gz if return_gz else rf
if return_gz:
return rf, gz
else:
return rf

0 comments on commit 2548f0d

Please sign in to comment.