torchref.refinement.targets.adp.scaler_log_scale module
- class torchref.refinement.targets.adp.scaler_log_scale.ScalerLogScaleTrendTarget(scaler, n_reflections, verbose=0)[source]
Bases:
TargetPin out the Debye-Waller-like trend in the per-bin
log_scale.Per-bin scales exist to absorb localized data-quality issues — an outlier bin, a slightly mis-merged shell. They are not supposed to absorb the global resolution-dependent attenuation envelope; that is what atomic B-factors are for. A
log_scale[i] ≈ a + b·s²[i]structure with nonzerobis exactly a B-factor masquerading as a per-bin scale: it shiftsB_eff = B_atom − 4·b, letting atoms drift broader or sharper while the overallF_scaledamplitudes stay unchanged.The target fits the least-squares slope of
log_scaleagainst the bin-mean|s|²and penalizesslope². The intercepta(the overall scale) is free. Residuals off the fit line are also free — those encode the outlier absorption the scales are supposed to do.Penalty
slope² · N_ref / nbins— the/ nbinsmatches how xray gradient on a singlelog_scale[i]scales; theN_reffactor brings the total into xray’s order of magnitude.