jfjoch_extract_hkl: Work in progress

This commit is contained in:
2026-01-22 11:53:58 +01:00
parent 688729f979
commit ec3419eb7f
3 changed files with 59 additions and 33 deletions

View File

@@ -26,24 +26,28 @@ IntegrateMap ParseXdsIntegrateHkl(const std::string& filename) {
std::istringstream iss(line);
int32_t h, k, l;
double I, sigma;
double xcal, ycal, zcal, rlp, peak, corr;
int32_t maxc;
if (!(iss >> l >> k >> h >> I >> sigma)) {
if (!(iss >> l >> k >> h >> I >> sigma >> xcal >> ycal >> zcal >> rlp >> peak >> corr >> maxc)) {
continue;
}
HKLData entry;
entry.h = h;
entry.h = -h;
entry.k = k;
entry.l = l;
entry.I = I;
entry.sigma = sigma;
entry.rlp = rlp;
entry.image_number = zcal;
double v = 0.0;
while (iss >> v) {
entry.tail.push_back(v);
}
result[hkl_key_16(h, k, l)].push_back(std::move(entry));
result[hkl_key_16(-h, k, l)].push_back(std::move(entry));
}
return result;
@@ -87,30 +91,34 @@ CcHalfByResolutionResult ComputeCcByResolution(
const auto& xds_list = it->second;
double i_ours = SumIntensity(ours_list);
double i_xds = SumIntensity(xds_list);
for (const auto &i_x: xds_list) {
for (const auto &i_o: ours_list) {
if (std::fabs(i_x.image_number - i_o.image_number) > 30.0)
continue;
int64_t h = ours_list.front().h;
int64_t k = ours_list.front().k;
int64_t l = ours_list.front().l;
int64_t h = i_x.h;
int64_t k = i_x.k;
int64_t l = i_x.l;
Coord recip = astar * h + bstar * k + cstar * l;
double recip_len = std::sqrt(recip.x * recip.x + recip.y * recip.y + recip.z * recip.z);
if (recip_len <= 0.0)
continue;
Coord recip = astar * h + bstar * k + cstar * l;
double recip_len = std::sqrt(recip.x * recip.x + recip.y * recip.y + recip.z * recip.z);
if (recip_len <= 0.0)
continue;
float d = static_cast<float>(1.0 / recip_len);
auto shell = shells.GetShell(d);
if (!shell)
continue;
float d = static_cast<float>(1.0 / recip_len);
auto shell = shells.GetShell(d);
if (!shell)
continue;
int idx = shell.value();
n[idx] += 1;
sum_x[idx] += i_ours;
sum_y[idx] += i_xds;
sum_x2[idx] += i_ours * i_ours;
sum_y2[idx] += i_xds * i_xds;
sum_xy[idx] += i_ours * i_xds;
int idx = shell.value();
n[idx] += 1;
sum_x[idx] += i_o.I;
sum_y[idx] += i_x.I;
sum_x2[idx] += i_o.I * i_o.I;
sum_y2[idx] += i_x.I * i_x.I;
sum_xy[idx] += i_o.I * i_x.I;
}
}
}
CcHalfByResolutionResult result;