Finding out ORGX ORGY: Difference between revisions

From XDSwiki
Jump to navigation Jump to search
No edit summary
 
(try to make clearer what "divide" refers to)
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The correct mathematical definition of ORGX ORGY is: the point of the detector (in pixels) closest to the crystal. However, in practice (namely for the standard setup of a beam perpendicular to the detector plane) the best way to come up with the correct values of ORGY ORGY is to find out where the direct beam would hit the detector.
The mathematically correct definition of ORGX ORGY is: "the point of the detector (in pixels) closest to the crystal". However, in practice (namely for the standard setup of a beam perpendicular to the detector plane) the best way to come up with good values of ORGX ORGY is to find out where the direct beam would hit the detector.


There are different possibilities to find out where the direct beam would hit the detector:
There are different possibilities to find out where the direct beam would hit the detector:


a) visualize a frame with [[VIEW]], and click (left-mouse) into the middle of the beamstop shadow (or the attenuated direct beam itself, if it is recorded). Use the pixel coordinates displayed by VIEW as ORGY ORGY (in principle you should add 1 to both numbers, because for VIEW the pixels go from 0 to NX-1 whereas for XDS they go from 1 to NX).
# use [[XDSGUI]] and load a frame. If you don't have XDS.INP, press the button generate_XDS.INP. There will be a green cross at ORGX,ORGY from XDS.INP. If that cross is not where you think it should be based on the beamstop shadow, just move the mouse to the correct position (middle of beamstop shadow), look at the X and Y position of the mouse in the upper right part of the panel, and transfer these values to XDS.INP, as ORGX and ORGY. When you go back to the Frame tab, the green cross should be at the correct position. 
# visualize BKGINIT.cbf (from [[INIT]]), or FRAME.cbf (from [[COLSPOT]]) with [[XDS-Viewer]], and click (left-mouse) into the middle of the beamstop shadow (or the attenuated direct beam itself, if it is recorded). Use the pixel coordinates displayed by [[XDS-Viewer]] as ORGX ORGY (in principle you should add 1 to both numbers, because for XDS-Viewer the pixels go from 0 to NX-1 whereas for XDS they go from 1 to NX).<br />Instead of these files written by XDS, one could directly use a measured frame. (If XDS-Viewer does not know the format, it will ask for NX, NY, and the size of the header. The latter is usually <size of frame in bytes>, minus 2*NX*NY .)
# use [[adxv]] for visualization. Otherwise the same as with XDS-Viewer. (1.9.7beta version works for the PILATUS detector at SLS)
# use MOSFLM for visualization. It prints out X BEAM and Y BEAM from the frame header, and you may click on the hypothetical direct beam position. However, ''x and y are swapped in MOSFLM when compared to XDS'', and the coordinates are in mm, not in pixels (so one has to divide by QX when going from MOSFLM units to XDS units). Sometimes the X BEAM and Y BEAM from the header are not reliable.
# use ice rings to find out (in [[XDS-Viewer]], and with paper and pencil) where the direct beam would be. This should be rather accurate but may be tedious.
# use the Unix command line tools to look at the header of the frame. E.g. "strings <frame-name>|more" would should you the (hopefully correct) information stored in the header, like wavelength, delta-phi, X and Y beamcentre and so on.


b) use adxv for visualization. Otherwise the same as with VIEW. (works for the PILATUS at SLS)
The error you make in the determination of ORGX ORGY should in principle be less than half of the distance between two spots. If you have a reasonable estimate (from one of the methods above), but the error is bigger than that, ''you can still find out the true ORGX ORGY by inspecting [[IDXREF.LP]] . This works best if [[COLSPOT]] has seen a significant fraction of all frames.'' This procedure is [[Thaumatin_ACA2014#Digression:_a_computational_investigation_into_the_robustness_of_the_indexing|documented]].


c) use MOSFLM for visualization. It prints out X BEAM and Y BEAM from the frame header, and you may click on the hypothetical direct beam position. However, ''x and y are swapped in MOSFLM when compared to XDS'', and the coordinates are in mm, not in pixels. Sometimes the X BEAM and Y BEAM from the header are not reliable.


d) use ice rings to find out where the direct beam would be. This should be rather accurate but may be tedious.
== The case of a swung-out detector ==


The error you make in the determination of ORGX ORGY should be less than half of the distance between two spots. If you have a reasonable estimate, but the error is bigger than that, you can still find out the true ORGY ORGY by inspecting [[IDXREF.LP]] . ''This works best if COLSPOT has seen a significant fraction of all frames.''
 
In the case of a swung-out detector, there is a large discrepancy between the direct beam position and (ORGX,ORGY). E.g. assuming the detector is swung out by 2theta in the horizontal, then ORGX has to be adjusted w.r.t. the value obtained in steps 1-5 (above), by an amount given by basic geometry:
# the third component of DIRECTION_OF_DETECTOR_X-AXIS= is sin(2theta), let's call this S2T.
# in the right-angled triangle of crystal, (ORGX,ORGY), and (Xbeam,Ybeam), we can find the distance (ORGX-Xbeam) by taking tan(2theta)*|DETECTOR_DISTANCE|/QX .
# now since sin(2theta)~tan(2theta) we can approximate the adjustment by S2T*|DETECTOR_DISTANCE|/QX
# for large 2theta one obviously has to take the arc sine of S2T, and calculate tan(2theta) from that.
 
Second method: if you feel you would rather like to find ORGX, ORGY by smart trial-and-error, then you just need to realize that in the output of IDXREF.LP you can check the lines
 
DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM    361.92    533.30 ! should be close to XDS-Viewer findings
DETECTOR ORIGIN (PIXELS) AT                      512.37    533.63 ! should be close to specified ORGX, ORGY
 
i.e. you have to ''change ORGX, ORGY in XDS.INP to make the upper line show the values you expect'' from clicking the direct beam position in XDS-Viewer.

Latest revision as of 09:37, 28 July 2017

The mathematically correct definition of ORGX ORGY is: "the point of the detector (in pixels) closest to the crystal". However, in practice (namely for the standard setup of a beam perpendicular to the detector plane) the best way to come up with good values of ORGX ORGY is to find out where the direct beam would hit the detector.

There are different possibilities to find out where the direct beam would hit the detector:

  1. use XDSGUI and load a frame. If you don't have XDS.INP, press the button generate_XDS.INP. There will be a green cross at ORGX,ORGY from XDS.INP. If that cross is not where you think it should be based on the beamstop shadow, just move the mouse to the correct position (middle of beamstop shadow), look at the X and Y position of the mouse in the upper right part of the panel, and transfer these values to XDS.INP, as ORGX and ORGY. When you go back to the Frame tab, the green cross should be at the correct position.
  2. visualize BKGINIT.cbf (from INIT), or FRAME.cbf (from COLSPOT) with XDS-Viewer, and click (left-mouse) into the middle of the beamstop shadow (or the attenuated direct beam itself, if it is recorded). Use the pixel coordinates displayed by XDS-Viewer as ORGX ORGY (in principle you should add 1 to both numbers, because for XDS-Viewer the pixels go from 0 to NX-1 whereas for XDS they go from 1 to NX).
    Instead of these files written by XDS, one could directly use a measured frame. (If XDS-Viewer does not know the format, it will ask for NX, NY, and the size of the header. The latter is usually <size of frame in bytes>, minus 2*NX*NY .)
  3. use adxv for visualization. Otherwise the same as with XDS-Viewer. (1.9.7beta version works for the PILATUS detector at SLS)
  4. use MOSFLM for visualization. It prints out X BEAM and Y BEAM from the frame header, and you may click on the hypothetical direct beam position. However, x and y are swapped in MOSFLM when compared to XDS, and the coordinates are in mm, not in pixels (so one has to divide by QX when going from MOSFLM units to XDS units). Sometimes the X BEAM and Y BEAM from the header are not reliable.
  5. use ice rings to find out (in XDS-Viewer, and with paper and pencil) where the direct beam would be. This should be rather accurate but may be tedious.
  6. use the Unix command line tools to look at the header of the frame. E.g. "strings <frame-name>|more" would should you the (hopefully correct) information stored in the header, like wavelength, delta-phi, X and Y beamcentre and so on.

The error you make in the determination of ORGX ORGY should in principle be less than half of the distance between two spots. If you have a reasonable estimate (from one of the methods above), but the error is bigger than that, you can still find out the true ORGX ORGY by inspecting IDXREF.LP . This works best if COLSPOT has seen a significant fraction of all frames. This procedure is documented.


The case of a swung-out detector

In the case of a swung-out detector, there is a large discrepancy between the direct beam position and (ORGX,ORGY). E.g. assuming the detector is swung out by 2theta in the horizontal, then ORGX has to be adjusted w.r.t. the value obtained in steps 1-5 (above), by an amount given by basic geometry:

  1. the third component of DIRECTION_OF_DETECTOR_X-AXIS= is sin(2theta), let's call this S2T.
  2. in the right-angled triangle of crystal, (ORGX,ORGY), and (Xbeam,Ybeam), we can find the distance (ORGX-Xbeam) by taking tan(2theta)*|DETECTOR_DISTANCE|/QX .
  3. now since sin(2theta)~tan(2theta) we can approximate the adjustment by S2T*|DETECTOR_DISTANCE|/QX
  4. for large 2theta one obviously has to take the arc sine of S2T, and calculate tan(2theta) from that.

Second method: if you feel you would rather like to find ORGX, ORGY by smart trial-and-error, then you just need to realize that in the output of IDXREF.LP you can check the lines

DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM     361.92    533.30 ! should be close to XDS-Viewer findings
DETECTOR ORIGIN (PIXELS) AT                      512.37    533.63 ! should be close to specified ORGX, ORGY

i.e. you have to change ORGX, ORGY in XDS.INP to make the upper line show the values you expect from clicking the direct beam position in XDS-Viewer.