double Reflection::meanIntensityWithExclusion(std::string *filename, int start, int end) { if (filename == NULL) return meanIntensity(true, 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() * miller->getPartiality(); weight += miller->getPartiality(); } total_intensity /= weight; return total_intensity; }
void Reflection::reflectionDescription() { int acceptedCount = 0; std::ostringstream logged; for (int i = 0; i < millerCount(); i++) { MillerPtr miller = this->miller(i); logged << miller->getH() << "\t" << miller->getK() << "\t" << miller->getL() << "\t" << miller->getRawIntensity() << "\t" << miller->getPartiality() << "\t" << miller->getSigma() << "\t" << miller->getFilename() << std::endl; if (miller->accepted()) acceptedCount++; } logged << std::endl; Logger::mainLogger->addStream(&logged); }
double Reflection::meanPartiality(bool withCutoff) { int num = millerCount(); double total_partiality = 0; int count = 0; for (int i = 0; i < num; i++) { MillerPtr miller = millers[i]; if ((miller->accepted() && withCutoff) || !withCutoff) { total_partiality += miller->getPartiality(); count++; } } total_partiality /= count; return total_partiality; }