Skip to main content

Beamshapy: Laser Beam Shaping Module

Beamshapy is a Python-based module designed for crafting laser beam shaping masks for use on phase-only Spatial Light Modulators (SLM). It leverages Fast Fourier Transform (FFT) propagation and relies on the Lightpipes package for its core functionality.

Features

Beamshapy provides two primary methods for mask design:

  1. Manual Design:

    • Craft appropriate masks for a targeted profile using the method described in Encoding amplitude information onto phase-only filters, JA Davis, 1999 Read the article
    • Suitable for controlling amplitude and phase in the conjugate Fourier plane.
  2. Gerchberg and Saxton Algorithm:

    • Design masks when only the intensity profile is important.
    • Optimizes the phase mask to achieve the targeted intensity in the conjugate Fourier plane.

Examples

Beamshapy includes several examples to demonstrate its capabilities:

  • example_simple_FT_propagation.py: Simple propagation with a wrapped wedge displayed on the SLM.
  • example_mask_design_BG_modul.py: Mask design and propagation, used to design the masks featured in the associated article.
  • example_mask_design_fresnel.py: Mask design for a Fresnel lens.
  • example_mask_design_GSA.py: Target intensity design and Gerchberg and Saxton optimization routine to obtain the phase mask for the targeted intensity in the conjugate Fourier plane.

For a practical application of Beamshapy, refer to our article: Selective excitation of high-order modes in two-dimensional cavity resonator integrated grating filters, A. Rouxel et al, 2024. Read the article

Installation

To install beamshapy, follow these steps:

  1. Clone the repository from GitHub:

    git clone https://github.com/a-rouxel/beamshapy.git
    cd beamshapy
    
  2. Create a dedicated Python environment using Miniconda: If you don't have Miniconda installed, follow the instructions here.

    # Create a new Python environment
    conda create -n beamshapy python=3.9
    
    # Activate the environment
    conda activate beamshapy
    
  3. Install the necessary Python packages: The required packages are listed in the requirements.txt file in the repository.

    # Install necessary Python packages with pip
    pip install -r requirements.txt
    

License

Beamshapy is open-source and available under the MIT License.

Contributions

Contributions are welcome! Please feel free to submit issues, fork the repository, and send pull requests.

Contact

For any questions or feedback, please contact the repository owner at arouxel@laas.fr.

Metadata

Release files for beamshapy 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beamshapy 0.1.13
File Size Uploaded
beamshapy-0.1.13.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beamshapy 0.1.13
File Interpreter ABI Platform
beamshapy-0.1.13-py3-none-any.whl Python 3 none any Details

Total release size: 41.0 kB

Release files / beamshapy-0.1.13.tar.gz

Download URL beamshapy-0.1.13.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9ce445e6d0053f94315bb60cd1bea059e11e56199c6d1f100ae528a15ac03ef0
BLAKE2b-256 checksum
How to use checksums
ffc41750756469e5e489221e4bc18a4f98d8aa01e2c836665da8f186ba7af5cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1022-azure

Release files / beamshapy-0.1.13-py3-none-any.whl

Download URL beamshapy-0.1.13-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a19946bcb2d3e1ccfbe684b1ceac16aac7a52fd98ed63c28cd02508905b4c236
BLAKE2b-256 checksum
How to use checksums
231a2319106c6077c33ea7887f3e08dde3b6d1b1a73656f27bec70a84d3f59a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1022-azure

Release history Release notifications | RSS feed

This release

0.1.13 This release

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page