void GraphDrawer::plotReflectionFromMtzs(std::vector<MtzPtr> mtzs, int h, int k, int l) { int index = Reflection::reflectionIdForCoordinates(h, k, l); std::cout << "filename,intensity,+-,resolution" << std::endl; for (int i = 0; i < mtzs.size(); i++) { MtzPtr mtz = mtzs[i]; for (int j = 0; j < mtz->reflectionCount(); j++) { Reflection *refl = mtz->reflection(j); long unsigned int thisID = refl->getReflId(); if (thisID != index) { continue; } std::cout << mtz->getFilename().substr(0, 4) << "\t" << refl->meanIntensity() << "\t" << refl->meanSigma() << "\t" << refl->miller(0)->getPhase() << "\t" << 1 / refl->getResolution() << std::endl; } } }
SpectrumBeam::SpectrumBeam(GaussianBeamPtr gaussianStart, MtzPtr mtzStart) { // double originalBandwidth = GaussianBeam::getBandwidthA(&*gaussianStart); double originalWavelength = GaussianBeam::getWavelengthA(&*gaussianStart); double lowRes = 1.9; double highRes = 1.6; for (int i = 0; i < mtzStart->reflectionCount(); i++) { Reflection *single = mtzStart->reflection(i); if (!single->acceptedCount()) continue; if (!single->betweenResolutions(lowRes, highRes)) continue; MtzManager *reference = MtzManager::getReferenceManager(); Reflection *holder; reference->findReflectionWithId(single->getReflId(), &holder); if (!holder) continue; double merged = holder->meanIntensity(); double unmerged = single->acceptedMiller(0)->getRawIntensity(); double ratio = unmerged / merged; double wavelength = single->acceptedMiller(0)->getWavelength(); if (!(wavelength == wavelength && ratio == ratio)) continue; double value = gaussianStart->valueAtWavelength(wavelength); if (ratio < 0) ratio = 0; spectrum[wavelength] = value;// * ratio; // std::cout << wavelength << "," << spectrum[wavelength] << std::endl; } /* for (double i = originalWavelength - 3 * originalBandwidth; i <= originalWavelength + 3 * originalBandwidth; i += originalBandwidth / 6) { double value = gaussianStart->valueAtWavelength(i); // std::cout << value << ", "; spectrum[i] = value; } */ // std::cout << std::endl; wavelength = originalWavelength; }