{"id":15899013,"url":"https://github.com/danporter/beamline_ray_tracer","last_synced_at":"2025-09-11T05:17:51.027Z","repository":{"id":163825286,"uuid":"303597895","full_name":"DanPorter/beamline_ray_tracer","owner":"DanPorter","description":"Simple ray tracing program to trace reflections of beams from various optical elements.","archived":false,"fork":false,"pushed_at":"2021-04-30T13:57:47.000Z","size":817,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T09:45:39.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanPorter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-13T05:31:11.000Z","updated_at":"2021-04-30T13:57:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"6790b66f-c237-4d24-802f-fd6764089aa3","html_url":"https://github.com/DanPorter/beamline_ray_tracer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanPorter%2Fbeamline_ray_tracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanPorter%2Fbeamline_ray_tracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanPorter%2Fbeamline_ray_tracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanPorter%2Fbeamline_ray_tracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanPorter","download_url":"https://codeload.github.com/DanPorter/beamline_ray_tracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246875909,"owners_count":20848049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T10:10:33.765Z","updated_at":"2025-04-02T19:14:27.016Z","avatar_url":"https://github.com/DanPorter.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# beamline_ray_tracer\nSimple ray tracing program to trace reflections of beams from various optical elements.\n\nOriginally built to trace beamline optics on a synchrotron beamline, with simple components such as mirrors included.\n\n**Requires:** _numpy, matplotlib_\n\nBy Dan Porter, PhD\n\nDiamond Light Source Ltd\n\n2020\n\n### Usage:\nAn example notebook is available on [Google Colab](https://colab.research.google.com/drive/1U5WyTTbhX-tUNpUqSKB8Gp5OqqYUBohr?usp=sharing).\n```python\nfrom beamline_ray_tracer import Room, components\n\n# Create room (container for beams and optical elements)\nroom = Room('Optical Table')\nroom.generate_beams(n_beams=7)\n# Define optical components\nmirror1 = components.CurvedMirrorVertical('CyclindricalMirror', [0, 0, 1], [-1, 0, -1], radius=3, n_elements=3, length=1, width=1)\nmirror2 = components.CurvedMirrorHorizontal('Bender', [-1, 0, 1], [1, 0, 1], radius=3, n_elements=3, length=1, width=1)\n# Add components to room\nroom.add_component(mirror1)\nroom.add_component(mirror2)\nroom.add_absorber('Detector', [-1, 0, 2], [0, 0, -1], 2, 1)\n\n# Run the ray-tracing simulations\nroom.run()\nroom.plot()\nroom.plot_projections()\nroom.plot_detector()\n```\n\n![3D Ray Tracing example](./example_3d.svg \"Example room.plot()\")\n![2D Ray Tracing example](./example_projection.svg \"Example room.plot_projections()\")\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanporter%2Fbeamline_ray_tracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanporter%2Fbeamline_ray_tracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanporter%2Fbeamline_ray_tracer/lists"}