Skip to content

Conversation

@jokasimr
Copy link
Contributor

Addresses part of #217 by binning the McStas data by "pixel" after loading and adapting the workflow to handle the pixel-binned data structure.

@jokasimr
Copy link
Contributor Author

Questions that remain answering

  • what is the number of pixels in the detectors should be divided into?
  • probably we should load the detectors separately, with a type parameter determining which detector to load, like in other instruments with multiple detectors

Copy link
Member

@jl-wynen jl-wynen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don not see any pixel binning here, only binning by position. Is the detector aligned with the instrument coord system? And does the mcstas file not contain pixel ids?

sc.midpoints(da.coords['y']),
sc.midpoints(-da.coords['x'] if bank == 1 else da.coords['x']),
)
).transpose(da.dims)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining what is going on here?
Why are you using 'x' as the z component of the vector? (You should drop the 'x' coord to avoid confusions down the line.)

da.coords['Ltotal'] = L1 + L2
da.coords['two_theta'] = sc.acos(
(-da.coords['x'] if bank == 1 else da.coords['x']) / L2
(da.coords['position'] - da.coords['sample_position']).fields.z / L2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right because it doesn't account for the source position. Why don't you us tuse the predefined coord transform graph?

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.

3 participants