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

WIP: Layers #310

Closed
wants to merge 5 commits into from
Closed

WIP: Layers #310

wants to merge 5 commits into from

Conversation

takluyver
Copy link
Member

The idea of this is that you can 'overlay' raw & proc data and still be able to access either:

In [2]: run = open_run(2734, 182, data=('raw', 'proc'))

# Find the source in the first data section where it exists (here raw):
In [5]: run['SPB_DET_AGIPD1M-1/DET/10CH0:xtdf', 'image.data'].dtype
Out[5]: dtype('uint16')

# Get the source from a specific layer (syntax up for discussion):
In [7]: run.layer('raw')['SPB_DET_AGIPD1M-1/DET/10CH0:xtdf', 'image.data'].dtype
Out[7]: dtype('uint16')

In [8]: run.layer('proc')['SPB_DET_AGIPD1M-1/DET/10CH0:xtdf', 'image.data'].dtype
Out[8]: dtype('<f4')

I'm not sure about this yet - it makes bits of the code rather more complex, and it might not be used that often.

The aim is that you can have a combined view of the data - e.g. to do .select(..., require_all=True) - and specifically access e.g. AGIPD proc data, telling it that you want proc data so it fails if that's missing rather than quietly switching to raw (#292). We could even make data=('raw', 'proc') the default without changing things that already work (mostly).

@philsmt this would be an alternative to your #298. In this PR, the first named origin containing a source 'wins', as opposed to the last in your PR.

@takluyver
Copy link
Member Author

It looks like we're going to move forwards with making new source names for corrected data, in which case this approach is unnecessary. We'll press ahead with #298 & #468 to handle that.

@takluyver takluyver closed this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant