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

Plot interface cannot support line-profile datasets #1549

Open
matbryan52 opened this issue Nov 9, 2023 · 1 comment
Open

Plot interface cannot support line-profile datasets #1549

matbryan52 opened this issue Nov 9, 2023 · 1 comment
Labels
enhancement New feature or request UDFs Anything related to the user-defined functions interface

Comments

@matbryan52
Copy link
Member

matbryan52 commented Nov 9, 2023

Came across this when working with some user data:

  File "C:\ProgramData\Miniconda3\envs\GMS_LIBERTEM\lib\site-packages\libertem\viz\base.py", line 158, in __init__
    channel, eligible_channels
ValueError: channel intensity not found or not plottable, have: []

as the dataset has a shape (1, 600, sy, sx). The issue comes from our filtering of plottable buffers to those with a 2D shape after a .squeeze.

def get_plottable_2D_channels(buffers):
return [
k
for k, buf in buffers.items()
# 2D data, removing axes of size 1
if len(buf.data.squeeze().shape) == 2
]

I think we could afford to be more selective in this function, for example 2D nav or sig buffers with no extra_shape or a 'squeezeable' extra shape can remain 2D even if any of their first two dimensions are 1.

Of course it's not necessarily useful to plot a (1, 600) image, but supporting it would prevent the need for special-casing in user code unless that's desired (to get a graph-style plot, for example)!

@matbryan52 matbryan52 added enhancement New feature or request UDFs Anything related to the user-defined functions interface labels Nov 9, 2023
@matbryan52
Copy link
Member Author

Would also need to supported in the default extract, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UDFs Anything related to the user-defined functions interface
Projects
None yet
Development

No branches or pull requests

1 participant