CODE V (.seq) File Import Demo
This notebook demonstrates how to import a CODE V Sequential (.seq) file into Optiland using the load_codev_file function.
[1]:
import os
from optiland.fileio import load_codev_file
from optiland import analysis
Loading a sample file
We will load a telescope objective lens from the Optiland test suite.
[2]:
# Path to the sample CODE V file
file_path = '../../../tests/test_fileio/codev_files/telescope_objective.seq' # located in test directory
# Load the lens
lens = load_codev_file(file_path)
# Display lens info
lens.info()
╒════╤═══════════════╤═══════════╤══════════╤═════════════╤════════════╤═════════╤═════════════════╕
│ │ Type │ Comment │ Radius │ Thickness │ Material │ Conic │ Semi-aperture │
╞════╪═══════════════╪═══════════╪══════════╪═════════════╪════════════╪═════════╪═════════════════╡
│ 0 │ Planar │ │ inf │ inf │ Air │ 0 │ 4.09009 │
│ 1 │ Standard │ │ -12.7172 │ 0.8 │ N-PSK3 │ 0 │ 4.09009 │
│ 2 │ Standard │ │ -18.543 │ 0.0148 │ Air │ 0 │ 4.09076 │
│ 3 │ Stop - Planar │ │ inf │ 0.015 │ Air │ 0 │ 4.08898 │
│ 4 │ Standard │ │ 15.758 │ 1.6701 │ CAF2 │ 0 │ 4.09234 │
│ 5 │ Standard │ │ -13.039 │ 0.0487 │ Air │ 0 │ 4.22239 │
│ 6 │ Standard │ │ -12.831 │ 0.8 │ S-LAL18 │ 0 │ 4.22099 │
│ 7 │ Standard │ │ -18.543 │ 1.1799 │ Air │ 0 │ 4.31862 │
│ 8 │ Standard │ │ 9.8197 │ 0.8 │ N-SK16 │ 0 │ 4.36723 │
│ 9 │ Standard │ │ 8.001 │ 44.3502 │ Air │ 0 │ 4.25135 │
│ 10 │ Planar │ │ inf │ nan │ Air │ 0 │ 8.46329 │
╘════╧═══════════════╧═══════════╧══════════╧═════════════╧════════════╧═════════╧═════════════════╛
Visualizing the Lens
We can draw the lens layout to verify the import.
[3]:
_ = lens.draw()
WARNING: No extinction coefficient data found for Daimon-20.yml. Assuming it is 0.
Analysis
Generate a spot diagram to assessment performance.
[4]:
spot = analysis.SpotDiagram(lens)
_ = spot.view()