Ticket #177 (closed: fixed)
Add a unit version from tof->wavelength that includes frame unwrapping
Reported by: | Nick Draper | Owned by: | Russell Taylor |
---|---|---|---|
Priority: | major | Milestone: | Iteration 11 |
Component: | Keywords: | ||
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
This may just be added as an option to the existing conversion. This should start by using a parameter input to give the lref.
Further details from Paolo Here is a brief summary of the unwrapping issue. This should be used for white-beam instruments with choppers. The chopper cut the range of wavelengths, so all detectors (including monitors) should be reduced to the same wavelength range. This is done using a “reference†flightpath, Lref, which is (usually, see below) the flightpath of the farthest detectors. If we call Tmin and Tmax the beginning and end of the frame, for each detector D at total flightpath Ld we can define the following times:
T1=Tmax-Tmin*(1-Ld/Lref)
T2=Ld/Lref*Tmax
If Ld<Lref then T1>T2
Neutron velocities (and hence wavelengths) for the detector D are calculated in the following way:
- Tmin<T<T2:
Velocities are calculated in the usual way: v=Ld/T
- T2<T<T1
Data at these times are ignored (i.e., they are not used in the wavelength-converted histograms)
- T1<T<Tmax
Velocities for these points are calculated using the formula v=Ld/(T-Tmax+Tmin)
Note that the maximum and maximum velocities for the points that are actually *used* are:
vmax=Ld/(T1-Tmax+Tmin)=Lref/Tmin
vmin=Ld/T2=Lref/Tmax
In other words, these velocities are the same for all detectors, so the wavelength range in the transformed histogram will correspondingly be the same.
Occasionally, it may be that some detectors (typically downstream monitors) may be at a *longer* flightpath than Lref. This depends entirely on the chopper aperture/setting. These detectors are “frame-overlapped†– in other words, there is an ambiguity in the definition of the wavelength for certain points, which should therefore be excluded. These points are at the very beginning and at the very end of the frame for a range Dt (equal on both sides) given by
Dt=(Tmax-Tmin)*(1-Lreg/Ld)
In other words, points between Tmin and Tmin+Dt and between Tmax-Dt and Tmax should be excluded. For all other points, velocities and wavelengths are calculated in the normal way (i.e., according to 1.)
Change History
comment:10 Changed 12 years ago by Russell Taylor
comment:11 Changed 12 years ago by Russell Taylor
comment:12 Changed 12 years ago by Russell Taylor
comment:13 Changed 12 years ago by Russell Taylor
comment:14 Changed 12 years ago by Russell Taylor
comment:15 Changed 12 years ago by Russell Taylor
- Status changed from assigned to closed
- Resolution set to fixed
This is done, though an extended test should be written. Also, Paolo has the following ideas for how this algorithm could be generalised a little:
With respect to the original algorithm, I think we should make a couple of very simple changes to make it more amenable for use with the geometry. I refer to the notations I used in my previous e-mail (I still have a copy if you need it). This approach should work with all white-beam instruments (most instruments at ISIS, except for the chopper spectrometers).
The input parameters are:
DeltaT, vmax, vmin, Lref. If Lref is present, vmax and vmin can have default values. If vmax and vmin are present, Lref is not used.
The default values are:
DeltaT=Tmax-Tmin (these being the min and max times in the TOF frame)
vmax=Lref/Tmin
vmin=Lref/Tmax
Then, the calculation proceeds in a very similar way as before, with the definitions:
T1=DeltaT+Ld/vmax or T1=DeltaT if vmax=infinity or a negative number
T2=Ld/vmin
Neutron velocities (and hence wavelengths) for the detector D at distance Ld are calculated in the following way:
- Tmin<T<T2:
Velocities are calculated in the usual way: v=Ld/T
- T2<T<T1
Data at these times are ignored (i.e., they are not used in the wavelength-converted histograms)
- T1<T<Tmax
Velocities for these points are calculated using the formula v=Ld/(T-DeltaT)
As I noted in the previous e-mail, some of the detectors (particularly transmission monitors) can be frame-overlapped. This happens for
Ld>DeltaT*(1/vmin-1/vmax)-1
In this case, T1<T2, and all the points between T1 and T2 should be masked out. This will result in a useful wavelength range that is smaller than for the other detectors.
Should we have access to geometrical/frequency/phase information of the choppers, the input values can all be calculated (and Lref becomes unnecessary) as follows (I write this for future reference):
vmax=d_chop/Topen
vmin=d_chop/Tclose
DeltaT=1/Frequency
Note that there could be more than one chopper, in which case vmax=min(vmax1, vmax2…), vmin=max(vmin1, vmin2…), and DeltaT=max(DeltaT1, DeltaT2…).
Topen and Tclose can be calculated from the chopper phase, which should be logged, and from the chopper opening angle alpha and the offset between the pick-up and the slit opening, which are geometrical properties.
Topen=phase+offset/(2*Pi*frequency)
Tclose=Topen+alpha/(2*Pi*frequency)
If Tclose>DeltaT then Tclose=Tclose-DeltaT and Topen=Topen-DeltaT (this can be iterated, although it is unlikely that anyone would set the choppers more than one frame ahead)
Note also that Topen can be zero or negative, in which case vmax=infinity or a negative number (the case is dealt with above).
comment:16 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 1025