Skip to main content

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


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

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

0 replies

Be the first to reply!

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