Pygator is a repository I've developed for the University of Florida LIGO and LISA Optics groups. It's a collection of functions that are commonly and regularly used in our lab for various optical and computational tasks. This package aims to streamline our workflow and make essential tools easily accessible to the team.
Installation
The package can be installed directly from the source. Open your terminal and run the following commands:
git clone https://github.com/DiabRaed/pygator
cd pygator
pip install -e .
Rebuilding Pygator
Once you have installed and built pygator, you can get the latest updates and rebuild it by executing the following commands from the repository directory:
git pull
Install using pip
The package can also be installed via pip directly from the repository:
pip install pygator
How to Use
Beam Profile with Propagation
This function captures a beam profile and saves the data to a CSV file. The following command-line arguments are used:
python beam_profile.py --roi-size 400 --downsample 2 --exposure auto --gain auto --pixel-size 6.9 --output my_beam_scan.csv
- ROI: The region of interest, a square area around the highest peak. The size is given in pixels.
- downsample: This uses
cv2.INTER_AREAinterpolation, which approximates area-based resampling. This is an efficient way to reduce data size while maintaining signal integrity. For example, adownsample=2effectively averages 2x2 pixel blocks into a single pixel. - --pixel-size: The camera's pixel size in microns.
- --output: The name of the CSV file where the data will be saved.
Live Fitting without Saving Data
You can also fit a 2D Gaussian to the beam in real-time without saving the data, which is useful for quick alignment and verification.
python live_camera_fit.py --mode heatmap --roi-size 350 --downsample 2 --exposure 10000 --gain 0
This command fits a 2D Gaussian to the live beam. The displayed parameters are in units of pixel numbers.