示例#1
0
void Reflection::generateReflectionIds()
{
    if (millerCount() == 0)
    {
        std::cout << "Warning! Miller count is 0" << std::endl;
    }
    
    int h = miller(0)->getH();
    int k = miller(0)->getK();
    int l = miller(0)->getL();
    
    cctbx::miller::index<> cctbxMiller = cctbx::miller::index<>(h, k, l);
        for (int i = 0; i < ambiguityCount(); i++)
    {
        MatrixPtr ambiguityMat = matrixForAmbiguity(i);
        cctbx::miller::index<> cctbxTwinnedMiller = ambiguityMat->multiplyIndex(&cctbxMiller);
        
        asym_index asymmetricMiller = asym_index(spaceGroup, asymmetricUnit, cctbxTwinnedMiller);
        
    //    sym_equiv_indices equivMaker = sym_equiv_indices(spaceGroup, cctbxTwinnedMiller);
    //    cctbx::miller::index<> asymmetricMiller = equivMaker(0).h();
       
        int newId = reflectionIdForMiller(asymmetricMiller.h());
    //    int newId = reflectionIdForMiller(cctbxMiller);
        
        reflectionIds.push_back(newId);
    }
}
示例#2
0
void GraphDrawer::plotOrientationStats(vector<MtzPtr> mtzs)
{
    cctbx::miller::index<> genericIndex = cctbx::miller::index<>(0, 0, 1);
    cctbx::sgtbx::space_group *spaceGroup = mtzs[0]->reflection(0)->getSpaceGroup();
    
    vector<double> xs, ys, zs;
    
    for (int i = 0; i < mtzs.size(); i++)
    {
        MatrixPtr matrix = mtzs[i]->getMatrix();
        
        cctbx::miller::sym_equiv_indices indices = cctbx::miller::sym_equiv_indices(*spaceGroup, genericIndex);
        
        cctbx::miller::index<double> position = matrix->multiplyIndex(&genericIndex);
        
        vec pos = new_vector(position[0], position[1], position[2]);
        scale_vector_to_distance(&pos, 1);
        
        std::cout << mtzs[i]->getFilename() << "\t" << pos.h << "\t" << pos.k << "\t" << pos.l << std::endl;
    }

    for (int i = 0; i < mtzs.size(); i++)
    {
        MatrixPtr matrix = mtzs[i]->getMatrix();
        
        cctbx::miller::sym_equiv_indices indices = cctbx::miller::sym_equiv_indices(*spaceGroup, genericIndex);
        
   //     unsigned long size = indices.indices().size();
        
   //     cctbx::miller::index<double> position = matrix->multiplyIndex(&genericIndex);
        
     //   double h = position[0];
     //   double k = position[1];
     //   double l = position[2];
        
        /*
        for (int i = 0; i < size; i++)
        {
            cctbx::miller::index<> asymIndex = indices.indices()[i].h();
            cctbx::miller::index<double> position = matrix->multiplyIndex(&asymIndex);
            
            xs.push_back(position[0]);
            ys.push_back(position[1]);
            zs.push_back(position[2]);
            
            std::cout << position[0] << "\t" << position[1] << "\t" << position[2] << std::endl;
            std::cout << -position[0] << "\t" << -position[1] << "\t" << -position[2] << std::endl;
        }*/
    }
}