Gain: Difference between revisions

From XDSwiki
Jump to navigation Jump to search
New page: Q1: What is shown in GAIN.cbf? A1: A "gain map" which represents the value of the gain mapped on the detector. ---- Q2: How are the gain values calculated? A2: Each gain value is calcu...
 
correct contents, and link to documentation
 
Line 1: Line 1:
Q1: What is shown in GAIN.cbf?
Q1: What is shown in GAIN.cbf?


A1: A "gain map" which represents the value of the gain mapped on the
A1: A "gain map" which represents the value of the [https://xds.mr.mpg.de/html_doc/xds_parameters.html#GAIN= gain] mapped on the detector.
detector.


----
----
Line 8: Line 7:
Q2: How are the gain values calculated?
Q2: How are the gain values calculated?


A2: Each gain value is calculated for a (2*NBX+1)*(2*NBY+1) pixel sized
A2: Each gain value is calculated for a (2*NBX+1)*(2*NBY+1) pixel sized box (NBX and NBY can be adjusted in XDS.INP; their default is 3) centered on the position where that particular gain value is to be stored in GAIN.cbf . That gain value is calculated as the variance of the pixels in that box, divided by the average of the pixels in that box. The result is smoothed. NB: you can easily do this calculation for yourself, by reading e.g. a single frame with a self-written program written in Fortran or C, so there's nothing mysterious about it. It is just an empirical fact that all detectors seem to produce these deviations from homogeneity across their surface, in this calculation.
box (NBX and NBY can be adjusted in XDS.INP; their default is 3)
centered on the position where that particular gain value is to be
stored in GAIN.cbf . That gain value is calculated as the variance of
the pixels in that box, divided by the average of the pixels in that
box. The result is smoothed.
NB: you can easily do this calculation for yourself, by reading e.g. a
single frame with a self-written program written in Fortran or C, so
there's nothing mysterious about it. It is just an empirical fact that
all detectors seem to produce these deviations from homogeneity across
their surface, in this calculation.


----
----
Line 24: Line 13:
Q3: How are the gain values used inside XDS?
Q3: How are the gain values used inside XDS?


A3: They are used to calculate the variances of the intensities of the
A3: They are used to calculate the intensities and variances of the reflections in the dataset that XDS processes.
reflections in the dataset that XDS processes.


----
----


Q4: Why does XDS not use a fixed GAIN value for a specific detector,
Q4: Why does XDS not use a fixed GAIN value for a specific detector, like e.g. MOSFLM does?
like e.g. MOSFLM does?


A4: Because the gain is in reality variable, as shown in A2.
A4: Because the gain is in reality variable, as shown in A2. However note that you CAN specify a fixed GAIN, by [https://xds.mr.mpg.de/html_doc/xds_parameters.html#GAIN= GAIN=]


----
----


Q5: Does it matter? Is it important to use the values in GAIN.pck
Q5: Does it matter? Is it important to use the values in GAIN.pck instead of a single fixed value for the detector?
instead of a single fixed value for the detector?


A5: I don't know how big the influence is, but it is certainly related
A5: I don't know how big the influence is, but it is certainly related to the variation of the gain values themselves. As this variation is often more than 20% or so I'd guess that it is a good idea to take the information in GAIN.cbf into account.
to the variation of the gain values themselves. As this variation is
often more than 20% or so I'd guess that it is a good idea to take the
information in GAIN.cbf into account. Remember: only the variances of
the intensities are affected by the gain values, not the intensities
themselves.


----
----
Line 50: Line 31:
Q6: Why is the gain not constant across the detector?
Q6: Why is the gain not constant across the detector?


A6: This is something you should ask the detector manufacturer. I'd
A6: This is something you should ask the detector manufacturer. I'd guess that the detectors are calibrated in a flood-field experiment such that a homogeneous exposure produces the same readout everywhere on the detector. This does not seem to work perfectly for any wavelength and angle of incidence of the photons, and means that e.g. the fiber optics of CCD detectors can still be seen in the gain map.
guess that the detectors are calibrated in a flood-field experiment such
that a homogeneous exposure produces the same readout everywhere on the
detector. This would constitute an intensity calibration, but the
variance is not calibrated by this automatically at the same time! This
means that e.g. the fiber optics can still be seen in the gain map.

Latest revision as of 12:04, 22 August 2025

Q1: What is shown in GAIN.cbf?

A1: A "gain map" which represents the value of the gain mapped on the detector.


Q2: How are the gain values calculated?

A2: Each gain value is calculated for a (2*NBX+1)*(2*NBY+1) pixel sized box (NBX and NBY can be adjusted in XDS.INP; their default is 3) centered on the position where that particular gain value is to be stored in GAIN.cbf . That gain value is calculated as the variance of the pixels in that box, divided by the average of the pixels in that box. The result is smoothed. NB: you can easily do this calculation for yourself, by reading e.g. a single frame with a self-written program written in Fortran or C, so there's nothing mysterious about it. It is just an empirical fact that all detectors seem to produce these deviations from homogeneity across their surface, in this calculation.


Q3: How are the gain values used inside XDS?

A3: They are used to calculate the intensities and variances of the reflections in the dataset that XDS processes.


Q4: Why does XDS not use a fixed GAIN value for a specific detector, like e.g. MOSFLM does?

A4: Because the gain is in reality variable, as shown in A2. However note that you CAN specify a fixed GAIN, by GAIN=


Q5: Does it matter? Is it important to use the values in GAIN.pck instead of a single fixed value for the detector?

A5: I don't know how big the influence is, but it is certainly related to the variation of the gain values themselves. As this variation is often more than 20% or so I'd guess that it is a good idea to take the information in GAIN.cbf into account.


Q6: Why is the gain not constant across the detector?

A6: This is something you should ask the detector manufacturer. I'd guess that the detectors are calibrated in a flood-field experiment such that a homogeneous exposure produces the same readout everywhere on the detector. This does not seem to work perfectly for any wavelength and angle of incidence of the photons, and means that e.g. the fiber optics of CCD detectors can still be seen in the gain map.