Skip to content

Commit

Permalink
updated the pilatus profile to be compatible with the tiled environment
Browse files Browse the repository at this point in the history
  • Loading branch information
dleshchev authored and estavitski committed Jul 2, 2024
1 parent 7784157 commit 4b6f248
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions startup/p01_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Check version of bluesky and act accordingly
from distutils.version import LooseVersion
from datetime import datetime
from xview.spectra_db.db_io import get_spectrum_catalog
# from xview.spectra_db.db_io import get_spectrum_catalog
import json
import time as ttime
import numpy as np
Expand Down Expand Up @@ -107,7 +107,7 @@ def wait_for_connection(self, timeout=DEFAULT_CONNECTION_TIMEOUT):
db_archive = Broker.named('iss')
db = Broker.named('iss-local')

db_proc = get_spectrum_catalog()
# db_proc = get_spectrum_catalog()
nslsii.configure_base(get_ipython().user_ns, db, pbar=False)
nslsii.configure_kafka_publisher(RE, "iss")

Expand Down
48 changes: 24 additions & 24 deletions startup/p34-apb_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,28 @@ def collect_asset_docs(self):
apb_trigger_pil100k = AnalogPizzaBoxTrigger(prefix="XF:08IDB-CT{PBA:1}:Pulse:3:", name="apb_trigger_pil100k")
# apb_trigger_pil100k = AnalogPizzaBoxTrigger(prefix="XF:08IDB-CT{PBA:1}:Pulse:3:", name="apb_trigger_pil100k")



class APBTriggerFileHandler(HandlerBase):
"Read APB trigger *.bin files"
def __init__(self, fpath):
raw_data = np.fromfile(fpath, dtype=np.int32)
raw_data = raw_data.reshape((raw_data.size // 3, 3))
columns = ['timestamp', 'transition']
derived_data = np.zeros((raw_data.shape[0], 2))
derived_data[:, 0] = raw_data[:, 1] + raw_data[:, 2] * 8.0051232 * 1e-9 # Unix timestamp with nanoseconds
derived_data[:, 1] = raw_data[:, 0]

self.df = pd.DataFrame(data=derived_data, columns=columns)
self.raw_data = raw_data

def __call__(self):
return self.df




db.reg.register_handler('APB_TRIGGER',
APBTriggerFileHandler, overwrite=True)

#
#
# class APBTriggerFileHandler(HandlerBase):
# "Read APB trigger *.bin files"
# def __init__(self, fpath):
# raw_data = np.fromfile(fpath, dtype=np.int32)
# raw_data = raw_data.reshape((raw_data.size // 3, 3))
# columns = ['timestamp', 'transition']
# derived_data = np.zeros((raw_data.shape[0], 2))
# derived_data[:, 0] = raw_data[:, 1] + raw_data[:, 2] * 8.0051232 * 1e-9 # Unix timestamp with nanoseconds
# derived_data[:, 1] = raw_data[:, 0]
#
# self.df = pd.DataFrame(data=derived_data, columns=columns)
# self.raw_data = raw_data
#
# def __call__(self):
# return self.df
#
#
#
#
# db.reg.register_handler('APB_TRIGGER',
# APBTriggerFileHandler, overwrite=True)
#

10 changes: 5 additions & 5 deletions startup/p36-pilatus100k.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ def pil_count(acq_time:int = 1, num_frames:int =1, open_shutter:bool=True):
# # return_dict['image'] = self._image_data[frame, :, :].squeeze()
# return return_dict
# # return self._roi_data


from xas.handlers import ISSPilatusHDF5Handler
db.reg.register_handler('PIL100k_HDF5',
ISSPilatusHDF5Handler, overwrite=True)
#
#
# from xas.handlers import ISSPilatusHDF5Handler
# db.reg.register_handler('PIL100k_HDF5',
# ISSPilatusHDF5Handler, overwrite=True)

0 comments on commit 4b6f248

Please sign in to comment.