Skip to content

Commit

Permalink
Updated python_script.yaml with babelscan script
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPorter committed Aug 14, 2024
1 parent 92556f2 commit 730b21c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions python_script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ spec:
command: ["python"]
source: |
import numpy as np
import time
import h5py
import matplotlib.pyplot as plt
import babelscan
from babelscan.plotting_matplotlib import set_plot_defaults
set_plot_defaults() # set custom matplotlib rcParams
i16 = babelscan.instrument_from_config('i16')
filename = '{{workflow.parameters.visitdir}}/{{inputs.parameters.scanno}}.nxs'
print(filename)
scan = i16.scan(filename)
print(scan)
cmd = scan('cmd')

with h5py.File(filename, 'r') as hdf:
dataset = hdf['entry1/scan_command']
cmd = dataset.asstr()[()]
{{inputs.parameters.python-code}}

0 comments on commit 730b21c

Please sign in to comment.