scipp / tof

A simple tool to create time-of-flight chopper cascade diagrams
https://tof.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Allow plotting of blocked rays (rays that don't make it to the end detector) #17

Closed nvaytet closed 1 year ago

nvaytet commented 1 year ago

Use

model.plot(max_rays=100, blocked_rays=1000)

Figure 1 (1)

and

choppers[1].tofs.visible.plot()

Screenshot at 2023-04-25 15-04-02

choppers[1].tofs.blocked.plot()

Screenshot at 2023-04-25 15-04-41

choppers[1].tofs.plot()

Screenshot at 2023-04-25 15-05-13

Note: to access the chopper data, you now have to use

choppers[1].tofs.visible.data
YooSunYoung commented 1 year ago

It looks really nice...! Can we have the blocked also a Group...? So that we can see where they were blocked...? Or is it too much

nvaytet commented 1 year ago

It looks really nice...! Can we have the blocked also a Group...? So that we can see where they were blocked...? Or is it too much

hmmm I am not sure how to achieve this because you get the .tofs on a component, not for the whole beamline. However, it got me thinking about what .tofs.blocked actually means for a chopper. Is it the list of blocked rays that have been blocked by all choppers before it and including itself (which is the current implementation), or is it the list of rays that this particular chopper in question is blocking?

I think the latter makes a lot more sense and is more useful in terms of information...

We should be able to see in the .blocked data that the first chopper blocks lots, and the last one very little. Right now you don't see this...

YooSunYoung commented 1 year ago

It looks really nice...! Can we have the blocked also a Group...? So that we can see where they were blocked...? Or is it too much

hmmm I am not sure how to achieve this because you get the .tofs on a component, not for the whole beamline. However, it got me thinking about what .tofs.blocked actually means for a chopper. Is it the list of blocked rays that have been blocked by all choppers before it and including itself (which is the current implementation), or is it the list of rays that this particular chopper in question is blocking?

I think the latter makes a lot more sense and is more useful in terms of information...

We should be able to see in the .blocked data that the first chopper blocks lots, and the last one very little. Right now you don't see this...

Yes that is what I was wondering. That'll be very useful...! But I the plot itself already roughly shows that information, right?

nvaytet commented 1 year ago

With the update, I get this plot for the last chopper, which makes much more sense! Screenshot at 2023-04-25 17-47-56

nvaytet commented 1 year ago

This was the old plot Screenshot at 2023-04-25 17-23-13