rs-station / meteor

bringing you the best difference maps
MIT License
2 stars 1 forks source link

consume intensities #75

Open tjlane opened 1 week ago

tjlane commented 1 week ago

We should allow users to input MTZs with intensity columns, so that e.g. MTZs straight out of crystFEL can be diffmap'd.

This leads to a question, though: if meteor discovers an MTZ has both an intensity and SFA column, what do we do? Options:

  1. Read and use the user's SFAs preferentially, ignore intensities
  2. Trust the rs French-Wilson is better than whatever the user did: recompute SFAs, then use those
  3. Throw an error and require the user to specify

@alisiafadini, @kmdalton opinions?

tjlane commented 1 week ago

Good news is @kmdalton says there is a sweet implementation of French-Wilson in rs already, and referred us to this:

https://rs-station.github.io/reciprocalspaceship/examples/4_anomalousmap.html#Computing-Structure-Factor-Amplitudes

kmdalton commented 1 week ago

The actual Bayesian integral in that implementation is solved numerically using quadrature integration vectorized across every reflection. It is reasonably performant while being more accurate than the traditional approximations (or even the newer more accurate ones that CCTBX uses). I will say that there is one weakness in the implementation which is in the estimation of local, resolution-dependent scales. The way that estimator works is by a simple kernel-based smoothing approach which is susceptible to some artifacts at the edges of the resolution range. I'm not saying there's anything wrong, but i just want to be as transparent as possible. If you run into issues, I can probably implement a more traditional approach based on binning.