Some ways to calculate the radiation dose that a crystal has absorbed

From CCP4 wiki

This is James Holton's corrected explanation - too good to be buried in the CCP4BB archives:

Subject: Re: Dose in diffraction patterns?

From: James Holton <jmholton@LBL.GOV>

Date: Wed, 6 May 2020 16:04:18 -0700

In general?  No.

I believe a few places put "flux" into the header, but as Andreas just mentioned that is only one of the bits of information you need to calculate dose.  If all you want is a rough estimate, then the numbers you need are:
f = flux (photons/s)
t = exposure time (s)
w = wavelength (A)
a = beam area (um^2)

The dose (D) to a sample of protein/water/plastic under a given beam will be roughly:
D = f*t*w^2/a/2000  (in Gy)

For example: a crystal under a square 100 um x 100 um beam at 1 A wavelength with flux 1e12 ph/s will get 1 MGy dose in 20 s.

The 2000/w^2 is a fudge factor that fits the true curve of metal-free protein crystals to within 15% for the wavelength range 0.5 < w < 3.  The error induced by not knowing if the beam was round or square and just multiplying together the width and height to get the area (a), is 21%.  The error from not realizing you had 100 mM uranium in your sample is about a factor of two at 1 A.  Smaller concentrations and lighter atoms have less impact on accuracy.

If you don't know the flux, or beam size, you can try looking them up at http://biosync.sbkb.org/ . I scraped these for my little dose calculator here:
bl831.als.lbl.gov/xtallife.html
Some of the biosync numbers are more accurate than others, however, depending on how often beamline scientists remember to update the site, and how well they know themselves.  And attenuation is not always written into the header either.

In a pinch, you can estimate the flux by the total number of photons on the image (P).  This is assuming that you know the sample thickness (L) in microns.  You must also assume that the total scattering cross section of the atoms in the sample is close to that of oxygen (0.2 cm^2/g), that the sample density is 1.2 g/cm^3 and that about 50% of the scattered photons reach the detector.  None of these are terrible assumptions. The equation then becomes:

f = P/t/L/1.2e-5

Where 1.2e-5 = 0.2 cm^2/g * 1.2 g/cm^3 * 1e-4 cm/micron * 50%, f=flux and t=exposure (as above).

Getting P from a pixel array is easy: you just add up all the pixel values.  From a CCD you want to be careful to subtract the baseline value from each pixel first (40 on ADSC, 10 on Mar/Rayonix), and then divide by the "gain", which near 1 A is ~1 on Mar/Rayonix, 0.6 for ADSC Q315 (swbin) and 1.8 for Q315r (hwbin).  A few considerations, yes, but it can be a good sanity check.

For example, if you see an average pixel value of 20 photons on a Pilatus 6M, then that is P=120e6 photons.  If that was a t=0.1 s 
exposure from a sample 100 microns thick, then the beamline flux was about 1e12 photons/s.  Note that this is the flux after any attenuation, not before.

Oh, and if you want a reference for that 2000 ph/um^2 = 1 Gy rule, it is 
here:
https://doi.org/10.1107/S0909049509004361

And, of course, if you are lucky enough to have accurate flux, size and shape information for the beam and sample, plus chemical composition the most accurate dose you'll get from raddose-3D: https://www.raddo.se/

-James Holton
MAD Scientist