Skip to content

Commit

Permalink
Merge branch 'main' into lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeybrock authored Feb 4, 2025
2 parents f7ae345 + aadd0e6 commit 112edad
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/user-guide/chopper/processing-nexus-choppers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import scipp as sc"
]
},
Expand Down Expand Up @@ -164,15 +163,18 @@
"outputs": [],
"source": [
"def plot_plateaus(raw_data: sc.DataArray, plateaus: sc.DataArray) -> None:\n",
" fig, ax = plt.subplots(1)\n",
" raw_data.plot(ax=ax, markersize=2)\n",
" to_plot = sc.DataGroup({'Rotation Speed': raw_data})\n",
" for plateau in plateaus:\n",
" i = plateau.coords['plateau'].value\n",
" da = sc.DataArray(\n",
" to_plot[f'Plateau {i}'] = sc.DataArray(\n",
" plateau.data.broadcast(dims=['time'], shape=[2]),\n",
" coords={'time': plateau.coords['time']},\n",
" name=f'Plateau {i}')\n",
" da.plot(ax=ax, ls='-', marker='|', c=f'C{i + 1}')"
" coords={'time': plateau.coords['time']}\n",
" )\n",
" return to_plot.plot(\n",
" ls={f'Plateau {i}': '-' for i in range(len(plateaus))},\n",
" marker={f'Plateau {i}': '|' for i in range(len(plateaus))},\n",
" markersize={'Rotation Speed': 2},\n",
" )"
]
},
{
Expand Down Expand Up @@ -358,7 +360,7 @@
"metadata": {},
"outputs": [],
"source": [
"omega = 2*sc.constants.pi * frequency.data * sc.scalar(1, unit='rad')\n",
"omega = 2 * sc.constants.pi * frequency.data * sc.scalar(1, unit='rad')\n",
"phase = omega * (tdc_in_phase[0] + chopper['delay'].data - pulse_time)\n",
"phase = phase.to(unit='rad')\n",
"phase"
Expand Down

0 comments on commit 112edad

Please sign in to comment.