double Reflection::meanIntensityWithExclusion(std::string *filename, int start, int end) { if (filename == NULL) return meanIntensity(start, end); if (end == 0) end = acceptedCount(); double total_intensity = 0; double weight = 0; int accepted = acceptedCount(); for (int i = start; i < end; i++) { MillerPtr miller = this->acceptedMiller(i); if (accepted > 2 && miller->getFilename() == *filename) continue; total_intensity += miller->intensity(); weight += 1; } total_intensity /= weight; return total_intensity; }
double Reflection::meanIntensity(bool withCutoff, int start, int end) { if (end == 0) end = withCutoff ? acceptedCount() : millerCount(); double total_intensity = 0; double total_weights = 0; for (int i = start; i < end; i++) { MillerPtr miller = withCutoff ? this->acceptedMiller(i) : this->miller(i); double weight = miller->getWeight(withCutoff); double intensity = miller->intensity(withCutoff); if (weight <= 0) continue; total_intensity += intensity * weight; total_weights += weight; } total_intensity /= total_weights; return total_intensity; }
double Reflection::meanIntensity(int start, int end) { if (end == 0) end = acceptedCount(); double total_intensity = 0; double weight = 0; for (int i = start; i < end; i++) { MillerPtr miller = this->acceptedMiller(i); total_intensity += miller->intensity(); weight += 1; } total_intensity /= weight; return total_intensity; }