AzIntEngine: Fixes
This commit is contained in:
@@ -7,29 +7,5 @@ AzIntEngineCPU::AzIntEngineCPU(const AzimuthalIntegrationMapping &integration)
|
||||
: AzIntEngine(integration) {}
|
||||
|
||||
void AzIntEngineCPU::Run(const ImagePreprocessorBuffer &image, AzimuthalIntegrationProfile &profile){
|
||||
|
||||
for (int i = 0; i < azint_count.size(); i++) {
|
||||
azint_sum[i] = 0.0f;
|
||||
azint_sum2[i] = 0.0f;
|
||||
azint_count[i] = 0;
|
||||
}
|
||||
|
||||
if (image.size() != npixel)
|
||||
throw std::runtime_error("ImageSpotFinder::AzimIntegration: Mismatch in size");
|
||||
|
||||
const uint16_t *pixel_to_bin = integration.GetPixelToBin().data();
|
||||
const float *corrections = integration.Corrections().data();
|
||||
|
||||
for (int i = 0; i < image.size(); i++) {
|
||||
const uint16_t bin = pixel_to_bin[i];
|
||||
if (bin < azint_bins) {
|
||||
float val = static_cast<float>(image[i]) * corrections[i];
|
||||
azint_sum[bin] += val;
|
||||
azint_sum2[bin] += val * val;
|
||||
++azint_count[bin];
|
||||
}
|
||||
}
|
||||
|
||||
profile.Clear(integration);
|
||||
profile.Add(azint_sum, azint_sum2, azint_count);
|
||||
RunAzint(image, profile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user