Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct number of dimension names in Xspress3ExternalFileReference #175

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions nslsii/areadetector/xspress3.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ class Xspress3ExternalFileReference(Signal):

"""

def __init__(self, *args, dtype_str="uint32", bin_count=4096, dim_name="bin_count", **kwargs):
def __init__(self, *args, dtype_str="uint32", bin_count=4096, dim_name=("frame_number", "number_channels", "bin_count"), **kwargs):
super().__init__(*args, **kwargs)
self.dtype_str = dtype_str
self.shape = (bin_count,)
self.dims = (dim_name,)
if isinstance(dim_name, str):
self.dims = (dim_name,) # Keeping this option for backward compatibility with some beamlines
elif isinstance(dim_name, list):
self.dims = (*dim_name,)
jmaruland marked this conversation as resolved.
Show resolved Hide resolved
jmaruland marked this conversation as resolved.
Show resolved Hide resolved
else:
self.dims = dim_name

def describe(self):
res = super().describe()
Expand Down
2 changes: 1 addition & 1 deletion nslsii/tests/test_xspress3.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_instantiate_channel_class():

assert channel_2.image.dtype_str == "uint32"
assert channel_2.image.shape == (4096,)
assert channel_2.image.dims == ("bin_count",)
assert channel_2.image.dims == ("frame_number", "number_channels", "bin_count",)
assert channel_2.get_external_file_ref().name == "channel_2_image"

assert channel_2.sca.clock_ticks.pvname == "Xsp3:C2SCA:0:Value_RBV"
Expand Down