Welcome to c3dp’s documentation!
- c3dp
- Installation
- Usage
- Modules
- Peak_detection : Detecting local maxima and minima in a signal
- atomicPercentage_from_weightPercentage : Calculating the atomic percentage from weight percentage
- cad : converting .xml file to .scad file
- convert2nxs : converting Numpy (.npy) file to Events Nexus (.nxs) file
- from_d_toTOF : conversion to time of flight from d-spacing
- gauge_volume : Creating the gauge volume by the collimator
- normalization_by_area : normalizing the curve by integrated area
- sampleassembly_program : Creating the template for sample assembly
- scattering_kernal_program : Creating the template for scattering kernel
- section : properties of different sections of the collimator
- Contributing
- Credits
- History
The Python ecosystem is an ideal environment for developing full-circle applications for merging collimator design, experimental planning and optimization, and 3D printing for neutron scattering instruments. We present a Python package, c3dp, that uses numpy, scipy, h5py, shapely, and Matplotlib to design, simulate, optimize and visualize a collimator’s performance quickly, accurately, and finally convert the optimized configuration straight to a format ready for 3D printing for diamond anvil or clamp pressure cells used in neutron diffraction experiments on the SNAP beamline. The package includes Monte Carlo ray tracing of the SNAP instrument, the collimator geometry, and simulates the neutron interaction with the collimator and the optimization of the collimator geometry to produce the best configuration. A differential evolution algorithm from the SciPy library was used for optimization with the objective of minimizing the simulated background, and a Jupyter notebook is used to integrate each of the steps of the package into a design and optimization work flow.