Repository navigation
Conversation
Construct bank A/B pixel IDs and positions independently of event loading. Reuse the common EmptyDetector type and McStasToX placement transform, with the MAGIC reference shared-plane cassette geometry. Add reference-coordinate, placement, metadata-validation, and workflow tests, plus user-guide documentation.
jokasimr
left a comment
There was a problem hiding this comment.
Looks good overall 👍 I think the docs page should be trimmed of the details a bit. Especially those about the detector geometry in the McStas simulation.
We also don't need to list the variance separately in the list of fields, or comment about the assumptions of the estimate, because it is part of the data variable and uses the standard McStas variance estimate.
|
|
||
| For comparison with Mantid's sample-centred instrument definition, subtract the global sample position from these pixel positions. | ||
| Mantid fixes bank A's radius, length and spacing to 1 m, 0.53 m and 1.05 degrees; comparisons with other values require adapting the reference model. | ||
| This provider constructs geometry only; assigning the raw events to these pixels is a separate step. |
There was a problem hiding this comment.
It seems a bit superfluous to mention this again, it's already inn the first line after the heading.
| Both banks require their absorption logger's position and rotation. | ||
| Missing parameters are not replaced with defaults. | ||
|
|
||
| For comparison with Mantid's sample-centred instrument definition, subtract the global sample position from these pixel positions. |
There was a problem hiding this comment.
Generally we don't assume a specific coordinate system. The workflows should be written to work as long as the components are positioned in a common coordinate system.
I also don't think the loader docs need to tell the user how to convert the positions to the mantid convention, unless this is particularly relevant in this package? (Is the workflow using mantid?)
Similarly, below it is mentioned that mantid fixes some geometry parameters of the bank. Does mantid determine the geometry of the bank in the McStas model? I think I might be missing some context here.
| component = _LOGGERS[bank] | ||
| filename = Path(filename) | ||
| with mcstastox.Read(filename.parent, filename.name) as reader: | ||
| translation, rotation = reader.get_component_placement(component) |
There was a problem hiding this comment.
Seems to me the translation and rotation are only read to be validated. Can't we leave that to McStasToX, since it is anyway used to apply the positioning later?
| weights = values.pop('p') | ||
| data = sc.array(dims=['event'], values=weights, variances=weights**2, unit='counts') | ||
| del weights | ||
| return RawMcStasEvents[RunType]( |
There was a problem hiding this comment.
Is t converted to event_time_offset by the Mantid event data loader?
The benefit of using event_time_offset instead of the McStas time is that it makes the data more realistic and forces us to deal with the frame-unwrapping issues. But that can also be done later.
(We can still keep both t and event_time_offset in the dataset if t is useful for diagnostics.)
| detector_b = 'detector_b' | ||
|
|
||
|
|
||
| class RawMcStasEvents(sl.Scope[RunType, sc.DataArray], sc.DataArray): |
There was a problem hiding this comment.
Typically we try to keep most "McStas concepts" contained in a mcstas module, and the McStas loader returns RawDetectorData just like a regular nexus detector.
That way the workflow does not need to know if it operates on McStas data or real nexus data.
Which one is used depends on what provider is used for the raw detector data domain type.
No description provided.