Commit a7fa69ad authored by Elisa Rebolini's avatar Elisa Rebolini
Browse files

Diffraction PAttern

parent c3f74fbe
......@@ -16,9 +16,10 @@ Cell.print_description()
SpG.print_description()
A.print_description()
power_pattern_simulation_conditions = CFML_api.PowderPatternSimulationConditions()
powder_pattern_simulation_conditions = CFML_api.PowderPatternSimulationConditions()
ReflectionList = CFML_api.ReflectionList(Cell, SpG, True, 0, power_pattern_simulation_conditions.getSinThetaOverLambdaMax())
ReflectionList = CFML_api.ReflectionList(
Cell, SpG, True, 0, powder_pattern_simulation_conditions.getSinThetaOverLambdaMax())
ReflectionList.compute_structure_factors(SpG, A)
#Pat = CFML_api.Calc_powder_pattern(PowPat_conditions, hkl)
\ No newline at end of file
Pat = CFML_api.DiffractionPattern(PowPat_conditions, ReflectionList)
......@@ -2,7 +2,7 @@
#
# CrysFML API Atoms
#
# @file Src/API_Atoms.py
# @file Src/API_Atom_Typedef.py
# @brief Atoms properties based on CrysFML
#
# @homepage https://code.ill.fr/scientific-software/crysfml
......@@ -20,8 +20,5 @@ class AtomList():
if address is not None:
self.__address = address
def as_fortran_object(self):
return self.__address
def print_description(self):
crysfml_api.atom_typedef_write_atom_list(self.__address)
# **************************************************************************
#
# CrysFML API IO Format
# CrysFML API Reflection Utilities
#
# @file Src/API_Reflections_Utilities.py
# @brief Reflections utilities based on CrysFML
......@@ -16,8 +16,10 @@ import CFML_api.crysfml_api as crysfml_api
class ReflectionList():
def __init__(self, cell, spg, lfriedel, value1, value2):
self.__address = crysfml_api.reflections_utilities_hkl_uni_reflist(cell.as_fortran_object(), spg.as_fortran_object(), lfriedel, value1, value2)["address"]
self.__address = crysfml_api.reflections_utilities_hkl_uni_reflist(
cell.as_fortran_object(), spg.as_fortran_object(), lfriedel, value1, value2)["address"]
def compute_structure_factors(self, space_group, atom_list):
crysfml_api.structure_factors_structure_factors(atom_list.as_fortran_object(), space_group.as_fortran_object(), self.__address)
crysfml_api.structure_factors_write_structure_factors(self.__address)
\ No newline at end of file
crysfml_api.structure_factors_structure_factors(
atom_list.as_fortran_object(), space_group.as_fortran_object(), self.__address)
crysfml_api.structure_factors_write_structure_factors(self.__address)
......@@ -16,6 +16,7 @@ add_library(${LIBRARY_NAME} SHARED
Extensions/API_Atom_TypeDef.f90
Extensions/API_Crystallographic_Symmetry.f90
Extensions/API_Crystal_Metrics.f90
Extensions/API_Diffraction_Patterns.f90
Extensions/API_IO_Formats.f90
Extensions/API_Reflections_Utilities.f90
Extensions/API_Structure_Factors.f90
......
......@@ -60,6 +60,9 @@ module API_init
use API_Reflections_Utilities, only: &
reflections_utilities_hkl_uni_reflist
use API_Diffraction_Patterns, only: &
diffraction_patterns_compute_powder_pattern
implicit none
......@@ -87,7 +90,15 @@ CONTAINS
integer :: ierror
ierror = forpy_initialize()
call method_table%init(32)
call method_table%init(33)
!--------------------------
! Diffraction Patterns (1)
!--------------------------
call method_table%add_method("diffraction_patterns_compute_powder_pattern", & ! method name
"compute the powder diffraction pattern from some experimental conditions and a set of reflections", & !doc-string
METH_VARARGS, & ! this method takes arguments but no keyword arguments
c_funloc(diffraction_patterns_compute_powder_pattern)) ! address of Fortran function to add
!--------------------------
! Crystallographic Symmetry (7)
!--------------------------
......
......@@ -15,6 +15,7 @@
from CFML_api.API_Atom_TypeDef import AtomList
from CFML_api.API_Crystal_Metrics import Cell
from CFML_api.API_Crystallographic_Symmetry import SpaceGroup
from CFML_api.API_Diffraction_Patterns import DiffractionPattern
from CFML_api.API_IO_Formats import CIFFile
from CFML_api.API_Reflections_Utilities import ReflectionList
from CFML_api.PowderPatternSimulation import PowderPatternSimulationConditions
......
......@@ -51,7 +51,7 @@ set(CRYSFML_COMMON_SOURCES
CFML_Chem_Scatt.f90
CFML_Conf_Calc.f90
CFML_Crystal_Metrics.f90
CFML_Diffpatt.f90
CFML_Diffraction_Patterns.f90
CFML_Export_Vtk.f90
CFML_Extinction_Correction.f90
CFML_FFTs.f90
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment