Dear Jacob,

To add one more thing to the many ones from James, despite air scattering noise 
being flat and easily subtractable over time, that noise wont be the same if 
you take images with and without the sample. Since some of the photons will be 
absorbed and diffracted by the crystal, the air noise will be different from 
what you recorded without the sample (with or without the loop/stuff) and you 
would like to subtract.

D

-----Original Message-----
From: CCP4 bulletin board [mailto:CCP4BB@JISCMAIL.AC.UK] On Behalf Of James 
Holton
Sent: 15 January 2015 17:00
To: ccp4bb
Subject: Re: [ccp4bb] X-ray Source Differences (WAS: RE: [ccp4bb] How far does 
rad dam travel?)

Jacob,

Background subtraction is unfortunately not as forgiving as you think it is.  
You can subtract the background, but you can't subtract the noise.  
This is because noise (by definition) is never the same twice. Yes, the 
"average" or "true" background under a spot may be flat, but any given 
observation of it will be noisy, and there is no way to separate the noise that 
came from the Bragg-scattered photons from the background-scattered photons 
that hit the same pixel.  Each photon is an independent event, after all.

   Consider an example: if you see 4 photons in an isolated spot after 1 second 
and there is zero background then sigma(I) = sqrt(I) = sqrt(4) = 2, and your 
I/sigma is most likely 2.  I write "most likely" because the "true" photon 
arrival rate (the thing that is proportional to F^2) doesn't have to be 4 
photons/s just because you counted four in one observation.  The long-term 
average could easily be something else, such as 3 photons/s, 5 photons/s or 
even 3.2 photons/s (on average).  
Observing 4 photons is not unlikely in all these scenarios.  However, if you 
consider all possible "true" rates, simulate millions of trials and isolate all 
the instances where you counted 4 photons you will find that the "true" rate of 
4.0 photons/s turns up more often than any other, so that's your best guess.

Nevertheless, if your "true" rate really is 4.0 photons/s, then the probability 
of actually seeing 4 photons is only ~20%!  The other 80% of the time you will 
see something else.  20% of the time you will count 3, there is a 15% chance 
you will only see 2, and a ~2% chance you will see zero.  There is also a 2% 
chance of seeing 11 photons in 1 second when the "true" rate is really 4. You 
just don't know.  Of course, with more observations you can narrow it down.  If 
you do 100 trials and see an average of 4.0, then you are obviously a lot more 
confident in the "true" rate of 4 photons/s.  But this isn't observing 4 
photons, this is observing 400 photons and dividing that number by 100.  
Because the error in counting 400 photons is sqrt(400)=20, your signal-to-noise 
is
400/sqrt(400) = 20!  This is why multiplicity is a good thing.  However, if all 
you have is one sample of 4 photons your best guess is I = 4 and
sigma(I) = 2.

Now consider the case where there is background.  Say the "true rate" 
for the background is 10 photons/pixel/s, and for simplicity lets say your 4 
photon/s spot lies entirely within one pixel. What is your signal-to-noise now? 
 Well, if you take 100 pixels in the neighborhood around your spot you will 
count ~1000 photons, giving you an excellent estimate of the "true" background 
rate: 10 photons/pixel/s with a sigma of sqrt(1000)/100 = 0.3, or a 
"signal-to-noise" of 31.6 for the estimate of the background level.  Looking at 
the one pixel containing your spot, let's say you saw 14 photons in it, that 
means you have a "sigma" of 2 from the 4 "spot photons" and a "sigma" of 0.3 
from the background photons for a total sigma of sqrt(2^2+0.3^2) = 2.02 and 
I/sigma = 1.97, right?  Wrong.

The reality of the situation is the 14 photons that landed in your spot pixel 
were independent events from all the photons that landed in the nearby 
background pixels.  Yes, you know that there "should" be 10, but the 
probability of actually getting 10 exactly is only 12.4%.  You are just as 
likely to see 11 or 9, and there is a 5% chance of 14 background photons 
hitting the spot area.  In that case the Bragg intensity could easily be zero, 
and the 14 photons you saw were just a random fluctuation from the average of 
10.  You just don't know!  And your error bars should reflect that.  The 
correct value for sigma(I) turns out to be the square root of the TOTAL number 
of photons that hit the spot area: sqrt(14) = 3.7 and the I/sigma of your 
4-photon spot is now 1.07. With 100 background photons/pixel, your I/sigma = 
0.4.  This is how background degrades your resolution limit.

The bright side of it is that the degradation of I/sigma rises only with the 
square root of the background level, not the background level itself.  As a 
general rule: it takes 3x the Bragg photons to cut I/sigma in half, 15x the 
Bragg photons to cut it to 1/4, etc.  So, a factor of 2 in background is at 
worst a 40% hit in I/sigma.  Not bad, but not good either.

Now, since the noise from background is proportional to the square root of the 
background level, the background level is proportional to the illuminated area, 
and the illuminated area, in turn, is the square of the beam size (for a square 
beam), the extra noise from a beam-crystal size miss-match is equal to the 
excess linear dimension of the beam.  
That is, if you have a situation where you would get 16 Bragg photons and 48 
background photons into a given spot from a 10 micron crystal with a 10 micron 
beam, that will give you I/sigma = 2.  But if you use a
20x20 micron beam you have quadrupled the illuminated area.  Assuming your 10 
micron crystal is embedded in a block of vitrified water, for the same dose to 
the crystal (photons/area) you will still get 16 Bragg photons but 192 
background photons in the spot area pixels, reducing your I/sigma to 1.1.  Most 
people would rather not do that.

So, yes, smaller beams are better if your crystal is actually small, and it is 
surrounded by "stuff" of similar thickness, density and elemental composition.  
You also need to bear in mind the "stuff" that is in the beam path before and 
after your crystal because this is part of the illuminated volume too.  
Ideally, you want your crystal sticking out into the air, then any beam size is 
more or less equivalent because
air/N2 scatters 1000x less than the solid stuff in the loop.  The only problem 
with that is a lot of crystals hate surface tension.  This is why I recommend 
having surrounding "stuff", but no too much.  A factor of 2 in volume is a good 
compromise.

Yes, there is such a thing as big crystals with a "sweet spot" that can only be 
accessed with a small beam and there is definitely a lot of excitement about 
that.  What I keep wondering is: what went wrong in the rest of that crystal?

   Brighter beams are better for getting your experiment over more quickly, but 
if you're attenuating then those extra photons are going to waste.  Faster 
detectors can help with this, but if they are too fast they will start picking 
up high-frequency noise in the beam.  This is a problem for anomalous, but not 
for resolution.  5% error when you are only counting 4 photons is a minor 
consideration.  Background is the primary enemy of resolution.  After disorder, 
of course!

As for where to put resources, I try not to think about which aspect of 
structural biology should be cut in favor of some other part because I think 
structural biology as a whole is important! Especially when you consider how 
much money is wasted on <insert random political statement 
here>.

Detectors can always be better, but at the moment low-end noise levels and 
speed are not limiting factors.  The challenges are either 1) detecting weak 
spots (aka resolution) or 2) accurately measuring small differences between 
strong spots (aka anomalous differences).  1) is limited by pixel count and 2) 
by calibration.  I say pixel count because larger active areas are always 
better for background reduction (inverse square law), but only if your spots 
take up more than a few pixels.  If your spots are all smaller than a pixel 
then your pixels are too big.  
Colin Nave (JSR, 2014) has calculated that the ideal MX detector would have 
about 1e9 pixels in it.  Only problem with that is the going rate for a pixel 
these days is ~$0.25 each.  For anomalous, the biggest problem with detectors 
is calibration, which is a lot harder to deal with than you might think.  The 
best evidence of this fact is that if you simulate data with every kind of 
noise you can think of you still get low-resolution R-meas values of ~0.5% 
(Holton et al, FEBS 2014, Diederichs, 2009).  I have never seen a real dataset 
like that.  
Nevertheless, if you count 1,000,000 photons, the sigma of that count is 1000, 
or 0.1% error.  Something else is getting in the way.  Unfortunate really, 
because if we could routinely get R-meas = 0.1% we would never need to make 
metal derivatives again.

-James Holton
MAD Scientist

On 1/8/2015 9:47 AM, Keller, Jacob wrote:
> Yes, this is great info and thoughts. What I still do not understand, 
> however, is why the noise from air/loop scattering is so bad--why not make 
> sure only the top of the Gaussian is engulfing the crystal, and the tails can 
> hit air or loop? Isn't the air scattering noise easily subtractable, being 
> essentially flat over time, whereas uneven illumination of the crystal is 
> highly difficult to correct?
>
> Also, in light of these considerations, it would seem to me a much better use 
> of resources not to make brighter and smaller beams but instead concentrate 
> on making better low-intensity big beam profiles (top-hats?) and lower-noise, 
> faster detectors (like Pilatus and the new ADSC).
>
> Jacob
>
> -----Original Message-----
> From: James Holton [mailto:jmhol...@lbl.gov]
> Sent: Tuesday, December 30, 2014 3:57 PM
> To: Keller, Jacob;CCP4BB@JISCMAIL.AC.UK
> Subject: Re: [ccp4bb] How far does rad dam travel?
>
>
> Yes, bigger is okay, and perhaps a little better if you consider the effects 
> of beam/crystal vibration and two sharp-edged boundaries dancing over each 
> other.  But bigger is better only to a point.  That point is when the 
> illuminated area of non-good-stuff is about equal to the area of the good 
> stuff.  This is because the total background noise is equal to the square 
> root of the number of photons and equal volumes of any given "stuff" (good or 
> non-good) yield about the same number of background-scattered photons.  So, 
> since you're taking the square root, completely eliminating the 
> non-good-stuff only buys you a gain of 40% in total noise.  Given that other 
> sources of noise come into play when the beam and crystal are exactly matched 
> (flicker), 40% is a reasonable compromise.  This is why I recommend loop 
> sizes that are about 40% bigger than the crystal itself.  Much less risk of 
> surface-tension injury, and the air around the loop scatters 1000x less than 
> the non-crystal stuff in the
>   loop: effectively defining the "beam size".
>
> As for what beam profiles look like at different beamlines, there are some 
> sobering mug-shots in this paper:
> http://dx.doi.org/10.1107/S0909049511008235
>
> Some interesting quirks in a few of them, but in general optimally focused 
> beams are Gaussian.  Almost by definition! (central limit theorem and all 
> that).  It is when you "de-focus" that things get really embarrassing.  X-ray 
> mirrors all have a "fingerprint" in the de-focused region that leads to 
> striations and other distortions.  The technology is improving, but good 
> solutions for "de focusing" are still not widely available.  Perhaps because 
> they are hard to fund.
>
> Genuine top-hat beams are rare, but there are a few of them. Petra-III is 
> particularly proud of theirs.  But top-hats are usually defined by 
> collimation of a Gaussian and the more x-rays you have hitting the back of 
> the aperture the more difficult it is to control the background generated by 
> the collimator.  If you can see the shadow of your pin on the detector, then 
> you know there is a significant amount of "background" that is coming from 
> upstream of your crystal!  My solution is to collimate at roughly the FWHM.  
> This chops off the tails and gives you a tolerably "flat" beam in the middle.
>
> How much more intense is the peak than the tails?  Well, at the FWHM, 
> the intensity is, well, half of that at the center.  At twice that 
> distance from the center, you are down to 6.2%.  The equation is
> exp(-log(16)*(x/hwhm)**2) where "hwhm" is 1/2 of the FHWM.
>
> HTH!
>
> -James Holton
> MAD Scientist
>
> On 12/30/2014 12:10 PM, Keller, Jacob wrote:
>>> Yes, it gets complicated, doesn't it?  This is why I generally 
>>> recommend
>> trying to use a beam that matches your crystal size.
>>
>> ...or is bigger, right? Diffuse scattering, yes, but more even illumination 
>> might be worth it?
>>
>> Generally, James, I have a question: what is the nature of the intensity 
>> cross-sections at most beamlines--are they usually Gaussian, or are some 
>> flatter? Or I guess, if Gaussian, how much more intense is the peak than the 
>> tails?
>>
>> JPK
>>
>>

-- 
This e-mail and any attachments may contain confidential, copyright and or 
privileged material, and are for the use of the intended addressee only. If you 
are not the intended addressee or an authorised recipient of the addressee 
please notify us of receipt by returning the e-mail and do not use, copy, 
retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not 
necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments 
are free from viruses and we cannot accept liability for any damage which you 
may sustain as a result of software viruses which may be transmitted in or with 
the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and 
Wales with its registered office at Diamond House, Harwell Science and 
Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

Reply via email to