Skip to main content

Python notebook to make SPCD files from CSV (example with THORLABS OSL2 halogen source)

  • July 12, 2023
  • 0 replies
  • 111 views

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

Hello everyone,

 

I made a small script to create a *.spcd file (spectrum file) for OpticStudio from a *.csv file. As an example, I manually created a *.csv file from THORLABS *.xlsx data for OSL2 (halogen lemp) and made the conversion.

The main issue I ran into was that OpticStudio currently limits the number of entries in a single *.spcd file to 200, and the THORLABS document had many more entries. I have used the accepted answer to this post to downsample the data to  < 200 entries.

The code and SPCD file is available on my GitHub:

https://github.com/Omnistic/make_spcd_from_csv

This is what it looks like in OpticStudio with the Libraries..Source Spectrum Plot, and the corresponding plot from the *.xlsx file:

I hope this can be useful to somebody. Take care,

 


David