Skip to main content

Python: Writing binary source files

  • November 25, 2020
  • 3 replies
  • 344 views

David.Nguyen
Luminary
Forum|alt.badge.img+2

Dear OpticStudio users,

I have created a GitHub repository with a template Python script to write binary source files:

https://github.com/Omnistic/BinarySource_OpticStudio

I'm hoping this will make it easier for you to write binary sources for OpticStudio in the future. As a reminder from the help file, binary files are 30% as large as equivalent text files, read about 20x faster, and can be left on disk consuming only little RAM. The repository also includes an example script to generate stigmatic Gaussian beams as described by P. Colbourne in his webinar.

By generating a binary source file, one can visualize the propagation of a non-sequential stigmatic Gaussian beam given its waist parameters. Note that the beam needs to intercept the surfaces sequentially, this is a dummy example for visualizaiton only. An OpticStudio archive file is also included for demonstration. This archive contains the Gaussian beam shown in the layout below (x_waist = 1 um, and y_waist = 2 um).

Stigmatic Gaussian beam binary source example

Let me know if this is useful, and take care :)

Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img

Dear David, 

Thank you so much for your contribution. It helped me to define the irradiance distribution of the laser source I have in the lab and perform beam shaping simulations. 

Thanks!

 

 


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Author
  • Luminary
  • 1089 replies
  • June 14, 2021

Dear Alejandro,

I'm happy to hear this little piece of code has helped you.

Let me know if it can be improved, and good luck with your research :)

Cheers,

David


Forum|alt.badge.img+2

I just saw this code and have moved it to the Code Exchange.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings