v1.0.0-rc.179 (#90)
Build Packages / Create release (push) Successful in 8s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m11s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m32s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 18m26s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 22m11s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 23m32s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 25m36s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 27m28s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 28m10s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 28m10s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m24s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 21m45s
Build Packages / Generate python client (push) Successful in 31s
Build Packages / Build documentation (push) Successful in 1m21s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 24m2s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 29m25s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 30m27s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 27m12s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 32m20s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 33m36s
Build Packages / Unit tests (push) Successful in 2h7m18s
Build Packages / Validation Battery (push) Successful in 33m19s
Build Packages / Create release (push) Successful in 8s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m11s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m32s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 18m26s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 22m11s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 23m32s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 25m36s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 27m28s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 28m10s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 28m10s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m24s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 21m45s
Build Packages / Generate python client (push) Successful in 31s
Build Packages / Build documentation (push) Successful in 1m21s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 24m2s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 29m25s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 30m27s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 27m12s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 32m20s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 33m36s
Build Packages / Unit tests (push) Successful in 2h7m18s
Build Packages / Validation Battery (push) Successful in 33m19s
* Rugnux: Stills processing needs only the unit cell and space group beyond what the file records - detector distance, beam centre, tilt, panel placement, saturation level, gain and polarisation plane are found from the images - and is up to twice as fast. * Rugnux: Stills can be indexed without a GPU, with a CPU implementation of the fast-feedback indexer (macOS, computers without a GPU). * Rugnux: Rotation and stills data are integrated in the detector's own units with one gain model, improving data from CCD detectors. * Web frontend: The Rugnux live page shows the placed model with its electron density and anomalous difference map in a Mol* viewer. Reviewed-on: #90 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #90.
This commit is contained in:
1 parent
afbe844b20
commit
b00c668e3a
394 files changed
+57778
-2178
No files matched your search
@@ -106,6 +106,11 @@ MXAnalysisWithoutFPGA::MXAnalysisWithoutFPGA(const DiffractionExperiment &in_exp
|
||||
}
|
||||
adaptiveSpotFinder = std::move(cpu);
|
||||
}
|
||||
// The panels the image is made of: the spot finders' windows and components, and the squares read
|
||||
// about a spot, stay inside one (one, the whole image, without a module table).
|
||||
adaptiveSpotFinder->SetPanels(experiment.GetModules());
|
||||
preprocessor_buffer->SetPanels(PanelBoxes(experiment.GetModules(), experiment.GetXPixelsNum(),
|
||||
experiment.GetYPixelsNum()));
|
||||
}
|
||||
|
||||
void MXAnalysisWithoutFPGA::Analyze(DataMessage &output,
|
||||
@@ -221,6 +226,7 @@ void MXAnalysisWithoutFPGA::Analyze(DataMessage &output,
|
||||
probe_counts.profile_fallback += after.profile_fallback - before.profile_fallback;
|
||||
probe_counts.overlapped += after.overlapped - before.overlapped;
|
||||
probe_counts.overlapped_major += after.overlapped_major - before.overlapped_major;
|
||||
probe_counts.overloads_kept += after.overloads_kept - before.overloads_kept;
|
||||
return ret;
|
||||
};
|
||||
|
||||
@@ -230,22 +236,40 @@ void MXAnalysisWithoutFPGA::Analyze(DataMessage &output,
|
||||
// soon as it has detected - so this must be called after detection and before integration.
|
||||
// Where no such background exists (no adaptive finder), auto leaves the correction off: the
|
||||
// plain profile carries the Bragg peaks and cannot support an absolute threshold.
|
||||
//
|
||||
// On stills - and wherever the correction is set for the whole run rather than left to auto, as
|
||||
// rugnux's pre-scan sets it on a rotation run whose empty apertures ask for it - the correction
|
||||
// takes its CURVE from that background, and on stills auto applies it to every image that has one
|
||||
// (the pre-scan turns it off for a run whose empty apertures say the radial model does not hold
|
||||
// there). A serial frame has a few dozen predicted reflections, so their own
|
||||
// ring pixels - where the curve comes from otherwise - sample the radial background sparsely,
|
||||
// while the finder's rings hold every pixel of the frame. And the correction is the measured
|
||||
// curvature itself: where the background has none it is zero, so there is nothing for a gate
|
||||
// to decide. The ice score is the wrong gate there: a smooth hump that is not ice - the
|
||||
// solvent or a carrier medium - curves the background as much as an ice ring does, and the
|
||||
// score does not see it.
|
||||
const auto decide_radial_background = [this, &spot_finding_settings, &output]() {
|
||||
if (!bragg_engine->IsBackgroundRadialAuto())
|
||||
return;
|
||||
// Same condition as the score at the end of this function: the adaptive finder holds its
|
||||
// ring background from whenever it last ran, so requiring that it ran for THIS image is
|
||||
// what keeps a stale curve out.
|
||||
if (!spot_finding_settings.adaptive_threshold)
|
||||
return;
|
||||
const std::vector<float> &ring_bkg = adaptiveSpotFinder->GetRingBackground();
|
||||
if (ring_bkg.empty())
|
||||
const std::vector<float> no_rings;
|
||||
const std::vector<float> &ring_bkg = spot_finding_settings.adaptive_threshold
|
||||
? adaptiveSpotFinder->GetRingBackground() : no_rings;
|
||||
const bool stills = !experiment.IsRotationIndexing();
|
||||
if (stills || !bragg_engine->IsBackgroundRadialAuto())
|
||||
bragg_engine->RadialBackgroundFromRings(ring_bkg, integration.GetQBinCount(),
|
||||
integration.Settings().GetLowQ_recipA(),
|
||||
integration.Settings().GetQSpacing_recipA());
|
||||
if (!bragg_engine->IsBackgroundRadialAuto() || ring_bkg.empty())
|
||||
return;
|
||||
output.ice_ring_score = AzimuthalIntegrationProfile::IceRingScore(
|
||||
ring_bkg, integration.GetQBinCount(), integration.Settings(),
|
||||
spot_finding_settings.ice_ring_width_Q_recipA);
|
||||
bragg_engine->BackgroundRadial(*output.ice_ring_score
|
||||
>= experiment.GetScalingSettings().GetIceMinScore());
|
||||
if (stills)
|
||||
bragg_engine->BackgroundRadial(!bragg_engine->GetRadialBackground().empty());
|
||||
else
|
||||
bragg_engine->BackgroundRadial(*output.ice_ring_score
|
||||
>= experiment.GetScalingSettings().GetIceMinScore());
|
||||
};
|
||||
|
||||
// A missing min-pix (std::nullopt) means "choose it per image". This applies only to the stills
|
||||
@@ -387,6 +411,7 @@ ImageSpotFinder &MXAnalysisWithoutFPGA::FixedThresholdFinder() {
|
||||
#endif
|
||||
spotFinder = std::make_unique<ImageSpotFinderCPU>(experiment.GetXPixelsNum(),
|
||||
experiment.GetYPixelsNum());
|
||||
spotFinder->SetPanels(experiment.GetModules());
|
||||
// It missed every mask update that happened before it existed, so it takes the current one
|
||||
// now. Without this it would find spots outside the resolution limits.
|
||||
if (mask_resolution)
|
||||
@@ -478,6 +503,7 @@ BraggIntegrationCounts MXAnalysisWithoutFPGA::BraggCounts() const {
|
||||
c.profile_fallback -= probe_counts.profile_fallback;
|
||||
c.overlapped -= probe_counts.overlapped;
|
||||
c.overlapped_major -= probe_counts.overlapped_major;
|
||||
c.overloads_kept -= probe_counts.overloads_kept;
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -513,20 +539,31 @@ std::vector<Reflection> MXAnalysisWithoutFPGA::IntegrateOnImage(const std::vecto
|
||||
return bragg_engine->Run(*preprocessor_buffer, predicted, npredicted, image_number);
|
||||
|
||||
// Predictions are where the reflections fall on the detector plane; the engine reads the image, so
|
||||
// each goes to where its module put those pixels, and comes back to the plane once integrated.
|
||||
std::vector<Reflection> on_image(predicted.begin(), predicted.begin() + static_cast<int64_t>(npredicted));
|
||||
for (auto &r: on_image) {
|
||||
const auto [x, y] = modules.PlaneToImage(r.predicted_x, r.predicted_y);
|
||||
r.predicted_x = static_cast<float>(x);
|
||||
r.predicted_y = static_cast<float>(y);
|
||||
// each goes to where its panel put those pixels, and comes back to the plane once integrated. One in
|
||||
// a gap, or off every panel, has no pixels and is not integrated. The engine finds a reflection's
|
||||
// panel from its image position, as the way back below does; a position that rounding to float put
|
||||
// on another panel's edge is dropped, so that the two agree.
|
||||
std::vector<Reflection> on_image;
|
||||
on_image.reserve(npredicted);
|
||||
for (size_t i = 0; i < npredicted; i++) {
|
||||
const auto p = modules.PlaneToPanel(predicted[i].predicted_x, predicted[i].predicted_y);
|
||||
if (!p)
|
||||
continue;
|
||||
Reflection r = predicted[i];
|
||||
r.predicted_x = static_cast<float>(p->x);
|
||||
r.predicted_y = static_cast<float>(p->y);
|
||||
if (modules.ModuleOfImagePixel(r.predicted_x, r.predicted_y) != p->panel)
|
||||
continue;
|
||||
on_image.push_back(r);
|
||||
}
|
||||
auto ret = bragg_engine->Run(*preprocessor_buffer, on_image, npredicted, image_number);
|
||||
auto ret = bragg_engine->Run(*preprocessor_buffer, on_image, on_image.size(), image_number);
|
||||
for (auto &r: ret) {
|
||||
const auto [px, py] = modules.ImageToPlane(r.predicted_x, r.predicted_y);
|
||||
const int64_t panel = modules.ModuleOfImagePixel(r.predicted_x, r.predicted_y);
|
||||
const auto [px, py] = modules.ImageToPlane(panel, r.predicted_x, r.predicted_y);
|
||||
r.predicted_x = static_cast<float>(px);
|
||||
r.predicted_y = static_cast<float>(py);
|
||||
if (std::isfinite(r.observed_x) && std::isfinite(r.observed_y)) {
|
||||
const auto [ox, oy] = modules.ImageToPlane(r.observed_x, r.observed_y);
|
||||
const auto [ox, oy] = modules.ImageToPlane(panel, r.observed_x, r.observed_y);
|
||||
r.observed_x = static_cast<float>(ox);
|
||||
r.observed_y = static_cast<float>(oy);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user