-
cam.py
- focusing cam generatorCreates cam functions (tabulated and approximated) for floating elements based on zoom data in a CodeV
.seq
file. Distance to object (S0 thickness) is converted to diopters and treated as a free variable that other zoomed thicknesses depend on.Unlike CodeV built-in CAM option, uses Akima splines for interpolation and offers power series approximation. Plots airspace thickness and approximation error graphs.
-
af3c.py
- first order layout of a 3-group Galilean telescopeGenerates 3 Zemax files for each of the 'scope's thin lenses. Those can be transformed into thick groups using Russinov's methodology, pre-optimized independently for minimum tolerance sensitivity with a curved field, and eventually assembled into a flat-field system.
- Copy into a dir that's traversed by CodeV, e.g.
c:\cvuser\macros\
. - Load libraries on startup. Your
defaults.seq
will contain something like this:pth seq pre c:\cvuser\macros\ ddm m in libmath in libtxt in libgeom in libmfg in globals
- Macros with req'd arguments provide 'Usage: ...' notes when invoked w/o args.
These macros, as dowloaded from GitHub, are in UTF8. But since they only use ISO 8859-1 characters, they should be byte-to-byte identical to ASCII and thus palatable to CodeV.
res.seq
- resolution figures & transverse aberration plotspetz.seq
- element power distribution and Petzval sumsamag.seq
- afocal magnificationmtf.seq
- resolution figures for any 2 modulation values (default is 0.2 and 0.3)
lay.seq
- view lens at one (e.g.in lay 2
) or every (justin lay
w/o args) zoom position with auto scaling and color coded surface typesxz.seq
- same aslay.seq
, but XZ section is shown instead of YZxy.seq
- 3D plot of a lensprescr2tex.seq
- generates a LaTeX table with current lens' prescription
-
galilean.seq
- insert a 2-group afocal Galilean subsystem -
af3c.seq
- layout and insert a 3-group GalileanPlots P2 and P3 (2nd and 3rd lens' power) vs P1, finds optimal P1 values for minimum RMS power and minimum Petzval.
-
reverse.seq
- flip lens & auto-convert fields and pupils -
ins_lens.seq
- fully interactive insertion of a subsystem from a lens fileUnlike CodeV built-in
COPY
command, this macro- takes care of zoom data (variable airspaces and conjugates);
- recognizes a relay/converter inserted right before the image and brings along its image-space conjugates;
- doesn't require a long string of parameters: lens file and surface indices are specified interactively.
Because of (3), both main and aux lenses have to be in the same directory.
-
ins_elt.seq
- insert a spherical element of given power & bending -
ins_xcyl.seq
,ins_ycyl.seq
- insert a cylindrical element -
ins_plate.seq
- insert a (bent) plane parallel plate -
bend.seq
- bend a singlet (spherical or cylindrical) to a specified Coddington shape factor -
bendflip.seq
- flip a singlet w/o changing its power -
cement.seq
- convert a singlet into a cemented doublet -
move_srf.seq
-
relay.seq
- create a new lens relaying the current lens' imageImage becomes object, EXP becomes ENP. Fields, wavelengths and image curvature are taken care of.
-
sph2xcyl.seq
,sph2ycyl.seq
- convert surfaces M..N into X or Y cylinders -
apertures.seq
- auto set hard apertures (rectangular if element is not rotationally symmetric).
-
wtz.seq
- matrix of optimization weigths for each field at every zoom positionAll field weights for a given zoom position can be scaled at once with
in wtz [z] [multiplier]
-wtz.seq
acts like a 'missing' WTZ command would've acted.
fields_diag.seq
- N equal-area field ringsfields_skew.seq
- rectangular angular field with diagonal pointsfields_diag2xy.seq
- convert a diagonal field spec to a rectangular with a given aspect rationfields_xy2diag.seq
- convert a rectagular field spec into a diagonal one
-
store.seq
- save and refresh derivativesSaves both a binary LEN and a text SEQ file. Deals with a decades-old problem of Code V randomly corrupting the derivative increment vector in LEN files - this is what has been causing all those 'Singular variable' and 'Unstable condition' errors since CV9 or probably even CV8.
-
get.seq
- search for lenses in directory and load by ordinalThis is too much to type:
> lib > dir *.len > can > res reverse_telephoto_1f8_v1o2achr1 > vie; go
This is much better:
> in get 'rev' > 12 > y
Here, all lenses with 'rev' in the name are listed, and you select the โ12. If no search string is specified, all LEN files in the directory are displayed.
-
gsview.seq
- view Nth best GS solutionRequires worksheet recording to be on (
buf y
) during optimization and agallery.seq
run immediately after.Example:
buf y auto gs y tim 10 err cdv go buf n in gallery > in gsview 3 ! load & view third-best lens > in gsview ! view next (4th) lens
libgeom.seq
- geometric opticslib_ys.seq
- Yuan-Seidel anamorphic lens aberrationslibmfg.seq
- manufacturabilitylibmath.seq
- non-optics specific mathlibtxt.seq
- string processingglobals.seq
- env var declarations
autocentering.zpl
- fill in wedge tolerances for elements that can self-center in a grinder's chuck
cvmacro/zmx_plate_import.seq
- convert Zemax.tpd
test plate file into a.seq
file that can be used by Code V's TES option