https://github.com/danporter/beamline_ray_tracer
Simple ray tracing program to trace reflections of beams from various optical elements.
https://github.com/danporter/beamline_ray_tracer
Last synced: 9 months ago
JSON representation
Simple ray tracing program to trace reflections of beams from various optical elements.
- Host: GitHub
- URL: https://github.com/danporter/beamline_ray_tracer
- Owner: DanPorter
- Created: 2020-10-13T05:31:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T13:57:47.000Z (about 5 years ago)
- Last Synced: 2025-02-08T09:45:39.897Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 798 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# beamline_ray_tracer
Simple ray tracing program to trace reflections of beams from various optical elements.
Originally built to trace beamline optics on a synchrotron beamline, with simple components such as mirrors included.
**Requires:** _numpy, matplotlib_
By Dan Porter, PhD
Diamond Light Source Ltd
2020
### Usage:
An example notebook is available on [Google Colab](https://colab.research.google.com/drive/1U5WyTTbhX-tUNpUqSKB8Gp5OqqYUBohr?usp=sharing).
```python
from beamline_ray_tracer import Room, components
# Create room (container for beams and optical elements)
room = Room('Optical Table')
room.generate_beams(n_beams=7)
# Define optical components
mirror1 = components.CurvedMirrorVertical('CyclindricalMirror', [0, 0, 1], [-1, 0, -1], radius=3, n_elements=3, length=1, width=1)
mirror2 = components.CurvedMirrorHorizontal('Bender', [-1, 0, 1], [1, 0, 1], radius=3, n_elements=3, length=1, width=1)
# Add components to room
room.add_component(mirror1)
room.add_component(mirror2)
room.add_absorber('Detector', [-1, 0, 2], [0, 0, -1], 2, 1)
# Run the ray-tracing simulations
room.run()
room.plot()
room.plot_projections()
room.plot_detector()
```
")
")