Changes
Page history
Added code to generate a system from convenience functions.
authored
Apr 10, 2018
by
joha2
Show whitespace changes
Inline
Side-by-side
Home.md
View page @
9104655f
...
...
@@ -15,6 +15,38 @@ For the underlying physical stuff, please read the fundamental manual. :-)
To reproduce some of the following screenshots you may just play around a bit
with the demo files in the ~~main~~ demos directory:
`~/pyrate$ python -m demos.demo_optimize`
.
For setting up your own system, you may use one of our convenience functions
```
import pyrateoptics
components = [
(
{"shape": "Asphere", "curv": 0.01, "cc": -1.0, "coefficients": [0.0, -0.001]},\
{"decz": 10.}, None, "s1", {"is_stop": True}
),
(
{"shape": "Biconic", "curvx": 0.001, "curvy": -0.01},\
{"decz": 20., "tiltx": 0.1}, None, "s2", {}
),
(
{"shape": "LinearCombination", "list_of_coefficients_and_shapes":
[(1.0, {"shape": "ZernikeFringe", "normradius": 10, "coefficients":[0., 0., 0., 0., 0.0, 0.0, 0, 0, 0.0]}),\
(1.0, {"shape": "Conic", "curv": 0.01, "cc": -1})]\
},\
{"decz": 20., "tiltx": 0.1}, None, "s3", {"is_mirror":True}
)
]
(s, rt) = pyrateoptics.build_simple_optical_system(components, name="s")
# Notice: It is always a good idea to provide names for systems, elements and components.
# There is also a convenience function for rotationally symmetric systems `build_rotationally_symmetric_system`.
pyrateoptics.listOptimizableVariables(s, maxcol=30)
# Lists optimizable variables (the identifiers are keys to a dict which collects them all).
pyrateoptics.draw(s)
# This function can get a list of raypath argument to draw rays.
```

...
...
...
...