コード例 #1
0
/** Execute the algorithm.
   */
void PoldiCreatePeaksFromCell::exec() {
  // Get all user input regarding the unit cell
  SpaceGroup_const_sptr spaceGroup = getSpaceGroup(getProperty("SpaceGroup"));
  PointGroup_sptr pointGroup =
      PointGroupFactory::Instance().createPointGroupFromSpaceGroup(spaceGroup);
  UnitCell unitCell = getConstrainedUnitCell(getUnitCellFromProperties(),
                                             pointGroup->crystalSystem(),
                                             pointGroup->getCoordinateSystem());

  g_log.information() << "Constrained unit cell is: " << unitCellToStr(unitCell)
                      << '\n';

  CompositeBraggScatterer_sptr scatterers = CompositeBraggScatterer::create(
      IsotropicAtomBraggScattererParser(getProperty("Atoms"))());

  // Create a CrystalStructure-object for use with PoldiPeakCollection
  CrystalStructure crystalStructure(unitCell, spaceGroup, scatterers);

  double dMin = getProperty("LatticeSpacingMin");
  double dMax = getDMaxValue(unitCell);

  // Create PoldiPeakCollection using given parameters, set output workspace
  PoldiPeakCollection_sptr peaks =
      boost::make_shared<PoldiPeakCollection>(crystalStructure, dMin, dMax);

  setProperty("OutputWorkspace", peaks->asTableWorkspace());
}
コード例 #2
0
ファイル: PointGroupFactory.cpp プロジェクト: DanNixon/mantid
/// Returns the Hermann-Mauguin symbols of all point groups that belong to a
/// certain crystal system.
std::vector<std::string> PointGroupFactoryImpl::getPointGroupSymbols(
    const PointGroup::CrystalSystem &crystalSystem) {
  std::vector<std::string> pointGroups;

  for (auto &generator : m_generatorMap) {
    PointGroup_sptr pointGroup = getPrototype(generator.first);

    if (pointGroup->crystalSystem() == crystalSystem) {
      pointGroups.push_back(generator.first);
    }
  }

  return pointGroups;
}
コード例 #3
0
ファイル: PointGroupFactory.cpp プロジェクト: nimgould/mantid
/// Returns the Hermann-Mauguin symbols of all point groups that belong to a
/// certain crystal system.
std::vector<std::string> PointGroupFactoryImpl::getPointGroupSymbols(
    const PointGroup::CrystalSystem &crystalSystem) {
  std::vector<std::string> pointGroups;

  for (auto it = m_generatorMap.begin(); it != m_generatorMap.end(); ++it) {
    PointGroup_sptr pointGroup = getPrototype(it->first);

    if (pointGroup->crystalSystem() == crystalSystem) {
      pointGroups.push_back(it->first);
    }
  }

  return pointGroups;
}
コード例 #4
0
/** Execute the algorithm.
   */
void PoldiCreatePeaksFromCell::exec() {
  // Get all user input regarding the unit cell
  SpaceGroup_const_sptr spaceGroup = getSpaceGroup(getProperty("SpaceGroup"));
  PointGroup_sptr pointGroup =
      PointGroupFactory::Instance().createPointGroupFromSpaceGroupSymbol(
          spaceGroup->hmSymbol());
  UnitCell unitCell = getConstrainedUnitCell(getUnitCellFromProperties(),
                                             pointGroup->crystalSystem());
  CompositeBraggScatterer_sptr scatterers = getScatterers(getProperty("Atoms"));

  // Create a CrystalStructure-object for use with PoldiPeakCollection
  CrystalStructure_sptr crystalStructure =
      boost::make_shared<CrystalStructure>(unitCell, spaceGroup, scatterers);

  double dMin = getProperty("LatticeSpacingMin");
  double dMax = getDMaxValue(unitCell);

  // Create PoldiPeakCollection using given parameters, set output workspace
  PoldiPeakCollection_sptr peaks =
      boost::make_shared<PoldiPeakCollection>(crystalStructure, dMin, dMax);

  setProperty("OutputWorkspace", peaks->asTableWorkspace());
}