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

DREAM detector diagnostics tool #178

Closed
SimonHeybrock opened this issue Apr 18, 2023 · 5 comments
Closed

DREAM detector diagnostics tool #178

SimonHeybrock opened this issue Apr 18, 2023 · 5 comments
Assignees
Labels
DREAM ESS ESS-specific requirement

Comments

@SimonHeybrock
Copy link
Member

https://confluence.esss.lu.se/display/DAM/DREAM+-+Detectors+diagnostic+tools

@SimonHeybrock SimonHeybrock added the ESS ESS-specific requirement label Apr 18, 2023
@nvaytet nvaytet self-assigned this Apr 18, 2023
@nvaytet
Copy link
Member

nvaytet commented May 15, 2023

After discussion with @celinedurniak, we concluded that probably the most useful and flexible way of approaching this is to make helper function to manipulate and shape the loaded data into a form which makes it easy to then just plot it using default plopp instead of having some custom plotting functions in ess.dream.

First off, it seems it would be useful to have the loader return the data in the file in the form of a DataGroup with the entries for the instrument mantle, endcap, frontcap. This is apprently already in the DREAM nexus geometry and should therfore be straightforward.

Secondly, it will be essential to view the data long its logical (wire, strip, segment, module) dimensions. So what we need to implement in ess is something like ess.dream.to_logical_dims(da).

Below are some examples of pseudo-code we came up with for usability:

from ess import dream
from ess.dream import tools as tls

dg = dream.load('filename.nxs')
dg.keys() # 'mantle', 'end-cap', ...

mantle = tls.to_logical_dims(dg['mantle'])
# or ?
dg = tls.to_logical_dims(dg) # -> new DataGroup

# Additional helpers? calls to_logical_dims internally and sums over module and segment?
tls.wire_vs_strip(dg['mantle']).plot()

# Could then do
pp.slicer(mantle.sum('module'), keep=['strip', 'wire'])


# To show both mantle and endcap at once ?
both = sc.concat([dg['mantle'], dg['endcap']], dim='pixel')

@SimonHeybrock
Copy link
Member Author

Secondly, it will be essential to view the data long its logical (wire, strip, segment, module) dimensions.

Yes, this is definitely the plan. Note that we have previously requested from ECDC to store NXdetector with the logical dims, we should follow-up on the status of that.

@nvaytet
Copy link
Member

nvaytet commented Jun 28, 2023

This for now cannot easily be done for the Nexus files for DREAM because we lack the information about logical dimensions. The list of pixels for each bank has only one dimension.
ECDC have promised to store in future nexus files the logical shapes of the pixel arrangement.

@nvaytet nvaytet added the DREAM label Jun 28, 2023
@SimonHeybrock
Copy link
Member Author

This for now cannot easily be done for the Nexus files for DREAM because we lack the information about logical dimensions. The list of pixels for each bank has only one dimension. ECDC have promised to store in future nexus files the logical shapes of the pixel arrangement.

I think we will end up with a DREAM file loader (wrapper for scippnexus) anyway. For now, we can manually inject the shape info there, i.e., reshape/fold after loading.

@SimonHeybrock
Copy link
Member Author

ECDC have decided to not provide information about logical dimensions. We will therefore have to hard-code this in our loader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DREAM ESS ESS-specific requirement
Projects
Status: Done
Development

No branches or pull requests

2 participants