-
cam.py- focusing cam generatorCreates cam functions (tabulated and approximated) for floating elements based on zoom data in a CodeV
.seqfile. 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.
-
agf2seq.py- Zemax to CodeV glass catalogue converterTakes an .agf file and generates a CodeV .seq private catalogue with dispersion coeffs (as opposed to interpolation points).
- Copy into a dir that's traversed by CodeV, e.g.
c:\cvuser\macros\. - Load libraries on startup. Your
defaults.seqwill 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)beams.seq- parameters (NA, obliquity, vignetting) of axial and edge-of-field beams for every surface
lay.seq- view lens at one (e.g.in lay 2) or every (justin layw/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
COPYcommand, 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). -
efl_curv_solve.seq- set up a solve that makes the last element's rear curvature maintain an image-space NA corresponding to the desired EFL of the whole lens or its rear subsystem (useful for things like tube lenses or relays).
-
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.seqacts like a 'missing' WTZ command would've acted. -
collimate.seq- attain a collimated beam in the specified airspace by varying up to 4 airspace thicknesses.
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; goThis is much better:
> in get 'rev' > 12 > yHere, 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.seqrun 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.tpdtest plate file into a.seqfile that can be used by Code V's TES option