示例#1
0
    def setUp(self):
        text = """
description: oslo cooke triplet example 50mm f/4 20deg
wavelengths: [546.1e-9, 486.e-9, 656.e-9]
object: {angle_deg: 20, pupil: {radius: 6.25}}
stop: 4
elements:
- {material: air}
- {distance: 5, radius: 6.5, roc: 21.25, material: schott-sk|n-sk16}
- {distance: 2, radius: 6.5, roc: -158.65, material: air}
- {distance: 6, radius: 5, roc: -20.25, material: schott-f|n-f2}
- {distance: 1, radius: 5, roc: 19.3, material: air}
- {distance: 6, radius: 6.5, roc: 141.25, material: schott-sk|n-sk16}
- {distance: 2, radius: 6.5, roc: -17.285, material: air}
- {distance: 42.95, radius: .364, material: air}
"""
        self.s = system_from_yaml(text)
示例#2
0
    def setUp(self):
        text = """
description: oslo cooke triplet example 50mm f/4 20deg
wavelengths: [546.1e-9, 486.e-9, 656.e-9]
object: {angle: .364}
stop: 4
elements:
- {material: air}
- {distance: 5, radius: 6.5, roc: 21.25, material: schott/SK16}
- {distance: 2, radius: 6.5, roc: -158.65, material: air}
- {distance: 6, radius: 5, roc: -20.25, material: schott/F4}
- {distance: 1, radius: 5, roc: 19.3, material: air}
- {distance: 6, radius: 6.5, roc: 141.25, material: schott/SK16}
- {distance: 2, radius: 6.5, roc: -17.285, material: air}
- {distance: 42.95, radius: .364, material: air}
"""
        self.s = system_from_yaml(text)
 def setUp(self):
     self.s = system_from_yaml(cooke)
     self.s.update()
     self.s.paraxial.refocus()
示例#4
0
 def setUp(self):
     self.s = system_from_yaml(cooke)
     self.s.update()
     self.s.paraxial.refocus()
示例#5
0
 def setUp(self):
     self.s = system_from_yaml(cooke)
     self.s.validate()
示例#6
0
 def setUp(self):
     self.s = system_from_yaml(doublet)
示例#7
0
 def setUp(self):
     self.s = ro.system_from_yaml(parabolic)
     self.s.update()
示例#8
0
 def setUp(self):
     self.s = system_from_yaml(cooke)
     self.s.update()
示例#9
0
 def test_dump(self):
     d = system_to_yaml(self.s)
     s = system_from_yaml(d)
     s
示例#10
0
plt.style.use('default')

# ignore matplotlib and numpy warning each other
warnings.simplefilter("ignore", FutureWarning)
# ignore floating point exceptions
np.seterr(divide="ignore", invalid="ignore")
# by default only print 4 significant digits
np.set_printoptions(precision=1)

#%%
s = ro.system_from_yaml("""
object:
  pupil:
    radius: 1
elements:
- {}
- {distance: 1, material: 1.5, roc: 5, radius: 1}
- {distance: .2, material: 1.0}
- {}
""")
s.update()
print(s)

#%%
lib = ro.Library.one()
for g in lib.session.query(ro.library.Material).filter(
        ro.library.Material.name.contains("N-BK7")):
    print(g.name, g.catalog.name, g.catalog.source)

#%%
s[1].material = lib.get("material", "SCHOTT-BK|N-BK7", source="rii")
示例#11
0
 def setUp(self):
     self.s = system_from_yaml(cooke)
     p = ParaxialTrace(self.s)
     p.update_conjugates()
示例#12
0
 def test_dump(self):
     d = system_to_yaml(self.s)
     s = system_from_yaml(d)
示例#13
0
 def setUp(self):
     self.s = ro.system_from_yaml(parabolic)
     self.s.update()