{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Optical Prescription Report\n",
    "\n",
    "Optiland features a powerful, automated **Prescription Report Generator** that automatically extracts and formats system properties, surface geometry, materials, and aberrations into standard professional reports."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Optional Dependencies\n",
    "\n",
    "To use all rendering options of the prescription generator, you must install the optional dependencies:\n",
    "- **All Features** (Console and PDF): `pip install optiland[prescription]`\n",
    "- **Console-only** (Requires `rich`): `pip install optiland[prescription-console]`\n",
    "- **PDF-only** (Requires `reportlab`): `pip install optiland[prescription-pdf]`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from optiland.samples.objectives import CookeTriplet\n",
    "from optiland.prescription import Prescription"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loading a Sample System\n",
    "\n",
    "Let's load the classic Cooke Triplet objective lens sample system."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "lens = CookeTriplet()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Printing the Prescription to the Console\n",
    "\n",
    "To view the report instantly inside your console or terminal, use the `.view()` method. This utilizes the `rich` library to draw clean, beautifully formatted tables and sections."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"background-color: #000087\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"background-color: #000087\">│ </span><span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0; background-color: #000087; font-weight: bold\">Optical Prescription — Unnamed System</span><span style=\"background-color: #000087\">                                                                           │</span>\n",
       "<span style=\"background-color: #000087\">╰──────────────────────────────────────── Generated: 2026-05-20 15:35 UTC ────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[48;5;18m╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\u001b[0m\n",
       "\u001b[48;5;18m│\u001b[0m\u001b[48;5;18m \u001b[0m\u001b[1;37;48;5;18mOptical Prescription — Unnamed System\u001b[0m\u001b[48;5;18m                                                                          \u001b[0m\u001b[48;5;18m \u001b[0m\u001b[48;5;18m│\u001b[0m\n",
       "\u001b[48;5;18m╰─\u001b[0m\u001b[48;5;18m───────────────────────────────────────\u001b[0m\u001b[48;5;18m Generated: 2026-05-20 15:35 UTC \u001b[0m\u001b[48;5;18m───────────────────────────────────────\u001b[0m\u001b[48;5;18m─╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────────── </span><span style=\"font-weight: bold\">System Overview</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ─────────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────────── \u001b[0m\u001b[1mSystem Overview\u001b[0m\u001b[92m ─────────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                 \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Name            </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> (unnamed)   </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Surfaces        </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 6           </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Stop Surface    </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 4.0000      </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Aperture Type   </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> EPDAperture </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Aperture Value  </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 10.0000     </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Object Distance </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> ∞           </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Image Distance  </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 42.2078     </span> \n",
       "                                 \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                 \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mName           \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m(unnamed)  \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mSurfaces       \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m6          \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mStop Surface   \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m4.0000     \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mAperture Type  \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37mEPDAperture\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mAperture Value \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m10.0000    \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mObject Distance\u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m∞          \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mImage Distance \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m42.2078    \u001b[0m\u001b[37m \u001b[0m \n",
       "                                 \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Wavelengths</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Wavelengths\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                 \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> # </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Wavelength (µm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Primary </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1   0.4800                     \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 2 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.5500          </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> ✓       </span> \n",
       "  3   0.6500                     \n",
       "                                 \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                 \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35m#\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mWavelength (µm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mPrimary\u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1   0.4800                     \n",
       " \u001b[2m \u001b[0m\u001b[2m2\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.5500         \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m✓      \u001b[0m\u001b[2m \u001b[0m \n",
       "  3   0.6500                     \n",
       "                                 \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Fields</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Fields\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                              \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> # </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Type       </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> X      </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Y       </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Weight </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1   AngleField   0.0000   0.0000    1.0000  \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 2 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> AngleField </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 14.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.0000 </span> \n",
       "  3   AngleField   0.0000   20.0000   1.0000  \n",
       "                                              \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                              \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35m#\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mType      \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mX     \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mY      \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mWeight\u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1   AngleField   0.0000   0.0000    1.0000  \n",
       " \u001b[2m \u001b[0m\u001b[2m2\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mAngleField\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m14.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.0000\u001b[0m\u001b[2m \u001b[0m \n",
       "  3   AngleField   0.0000   20.0000   1.0000  \n",
       "                                              \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────── </span><span style=\"font-weight: bold\">First-Order Properties</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────── \u001b[0m\u001b[1mFirst-Order Properties\u001b[0m\u001b[92m ──────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                           \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Effective Focal Length (EFL) </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 49.9998  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Focal Length (FFL)     </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.9998 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Focal Length (BFL)      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 0.2071   </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Principal Plane (P1)   </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 12.6541  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Principal Plane (P2)    </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.7927 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Nodal Plane (N1)       </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 12.6541  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Nodal Plane (N2)        </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.7927 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Image-Space F/#              </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 5.0000   </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Entrance Pupil Diameter      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 10.0000  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Entrance Pupil Location      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 11.5122  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Exit Pupil Diameter          </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 10.2337  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Exit Pupil Location          </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -50.9613 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Transverse Magnification     </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -0.0000  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Lagrange Invariant           </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -1.8199  </span> \n",
       "                                           \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                           \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEffective Focal Length (EFL)\u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m49.9998 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Focal Length (FFL)    \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.9998\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Focal Length (BFL)     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m0.2071  \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Principal Plane (P1)  \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m12.6541 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Principal Plane (P2)   \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.7927\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Nodal Plane (N1)      \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m12.6541 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Nodal Plane (N2)       \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.7927\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mImage-Space F/#             \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m5.0000  \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEntrance Pupil Diameter     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m10.0000 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEntrance Pupil Location     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m11.5122 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mExit Pupil Diameter         \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m10.2337 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mExit Pupil Location         \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-50.9613\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mTransverse Magnification    \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-0.0000 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mLagrange Invariant          \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-1.8199 \u001b[0m\u001b[37m \u001b[0m \n",
       "                                           \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────── </span><span style=\"font-weight: bold\">Surface Data — Geometry</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ─────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────── \u001b[0m\u001b[1mSurface Data — Geometry\u001b[0m\u001b[92m ─────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                                                          \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> S# </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Type     </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Radius (mm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Thickness (mm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Conic  </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Stop </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Comment </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Plane      ∞             ∞                —                        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 22.0136     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 3.2590         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  2    standard   -435.7604     6.0076           0.0000                   \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 3  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -22.2133    </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.0000         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  4    standard   20.2919       4.7504           0.0000   ✓               \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 5  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 79.6836     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 2.9521         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  6    standard   -18.3953      42.2078          0.0000                   \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 7  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> ∞           </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "                                                                          \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                                                          \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35mS#\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mType    \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mRadius (mm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mThickness (mm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mConic \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mStop\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mComment\u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Plane      ∞             ∞                —                        \n",
       " \u001b[2m \u001b[0m\u001b[2m1 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m22.0136    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m3.2590        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  2    standard   -435.7604     6.0076           0.0000                   \n",
       " \u001b[2m \u001b[0m\u001b[2m3 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-22.2133   \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.0000        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  4    standard   20.2919       4.7504           0.0000   ✓               \n",
       " \u001b[2m \u001b[0m\u001b[2m5 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m79.6836    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m2.9521        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  6    standard   -18.3953      42.2078          0.0000                   \n",
       " \u001b[2m \u001b[0m\u001b[2m7 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m∞          \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—     \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "                                                                          \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">──────────────────────────────────────────── </span><span style=\"font-weight: bold\">Surface Data — Materials</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ─────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m──────────────────────────────────────────── \u001b[0m\u001b[1mSurface Data — Materials\u001b[0m\u001b[92m ─────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                                                   \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> S# </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Material </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> nd     </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Vd      </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Semi-Diameter (mm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Coating </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Air        1.0000   —         —                    —        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> SK16     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.6204 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 60.2809 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —                  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —       </span> \n",
       "  2    Air        1.0000   —         —                    —        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 3  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> F2       </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.6200 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 36.3665 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —                  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —       </span> \n",
       "  4    Air        1.0000   —         —                    —        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 5  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> SK16     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.6204 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 60.2809 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —                  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —       </span> \n",
       "  6    Air        1.0000   —         —                    —        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 7  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Air      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —       </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —                  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —       </span> \n",
       "                                                                   \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                                                   \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35mS#\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mMaterial\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mnd    \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mVd     \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSemi-Diameter (mm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mCoating\u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Air        1.0000   —         —                    —        \n",
       " \u001b[2m \u001b[0m\u001b[2m1 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mSK16    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.6204\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m60.2809\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—                 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—      \u001b[0m\u001b[2m \u001b[0m \n",
       "  2    Air        1.0000   —         —                    —        \n",
       " \u001b[2m \u001b[0m\u001b[2m3 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mF2      \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.6200\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m36.3665\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—                 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—      \u001b[0m\u001b[2m \u001b[0m \n",
       "  4    Air        1.0000   —         —                    —        \n",
       " \u001b[2m \u001b[0m\u001b[2m5 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mSK16    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.6204\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m60.2809\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—                 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—      \u001b[0m\u001b[2m \u001b[0m \n",
       "  6    Air        1.0000   —         —                    —        \n",
       " \u001b[2m \u001b[0m\u001b[2m7 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mAir     \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—      \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—                 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—      \u001b[0m\u001b[2m \u001b[0m \n",
       "                                                                   \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────── </span><span style=\"font-weight: bold\">Seidel Aberration Coefficients</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────── \u001b[0m\u001b[1mSeidel Aberration Coefficients\u001b[0m\u001b[92m ──────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                                                                                  \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> S#    </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> SI (Sph)  </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> SII (Coma) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> SIII (Astig) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> SIV (Petz) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> SV (Dist) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> CL (LCA)  </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> CT (TCA)  </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1       -0.013855   -0.010591    -0.008096      -0.057727    -0.050318   -0.014412   -0.011017  \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 2     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.011256 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.035011   </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.108897    </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.002916  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.347781  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.010088 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.031376  </span> \n",
       "  3       0.052115    -0.081389    0.127106       0.057268     -0.287939   0.031745    -0.049577  \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.024135  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.043874   </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.079756     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.062690   </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.258946  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.021172  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.038488  </span> \n",
       "  5       -0.004080   -0.016132    -0.063784      -0.015948    -0.315255   -0.006189   -0.024472  \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 6     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.054020 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.030462   </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.017178    </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.069082  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.048643  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -0.017462 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.009847  </span> \n",
       "  Total   -0.006960   0.001235     0.008907       -0.025716    0.001859    0.004767    -0.005356  \n",
       "                                                                                                  \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                                                                                  \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35mS#   \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSI (Sph) \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSII (Coma)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSIII (Astig)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSIV (Petz)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mSV (Dist)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mCL (LCA) \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mCT (TCA) \u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  1       -0.013855   -0.010591    -0.008096      -0.057727    -0.050318   -0.014412   -0.011017  \n",
       " \u001b[2m \u001b[0m\u001b[2m2    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.011256\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.035011  \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.108897   \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.002916 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.347781 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.010088\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.031376 \u001b[0m\u001b[2m \u001b[0m \n",
       "  3       0.052115    -0.081389    0.127106       0.057268     -0.287939   0.031745    -0.049577  \n",
       " \u001b[2m \u001b[0m\u001b[2m4    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.024135 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.043874  \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.079756    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.062690  \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.258946 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.021172 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.038488 \u001b[0m\u001b[2m \u001b[0m \n",
       "  5       -0.004080   -0.016132    -0.063784      -0.015948    -0.315255   -0.006189   -0.024472  \n",
       " \u001b[2m \u001b[0m\u001b[2m6    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.054020\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.030462  \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.017178   \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.069082 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.048643 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-0.017462\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.009847 \u001b[0m\u001b[2m \u001b[0m \n",
       "  Total   -0.006960   0.001235     0.008907       -0.025716    0.001859    0.004767    -0.005356  \n",
       "                                                                                                  \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "prescription = Prescription(lens)\n",
    "prescription.view()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Explaining Report Sections\n",
    "\n",
    "By default, the report generates five standard sections:\n",
    "1. **System Overview**: General details, wavelengths, and field definitions.\n",
    "2. **First-Order Properties**: Paraxial parameters (EFL, F-Number, magnification, pupil parameters).\n",
    "3. **Surface Data - Geometry**: Radii of curvature, thicknesses, stop designations, and conic constants.\n",
    "4. **Surface Data - Materials**: Material names and corresponding refractive indices ($n_d$, $V_d$).\n",
    "5. **Seidel Aberration Coefficients**: Monochromatic and chromatic Seidel aberrations per surface and system totals.\n",
    "\n",
    "### Customizing Sections\n",
    "You can customize and re-order the sections included in your report by passing a list of section instances to the `Prescription` constructor:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"background-color: #000087\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"background-color: #000087\">│ </span><span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0; background-color: #000087; font-weight: bold\">Optical Prescription — Unnamed System</span><span style=\"background-color: #000087\">                                                                           │</span>\n",
       "<span style=\"background-color: #000087\">╰──────────────────────────────────────── Generated: 2026-05-20 15:35 UTC ────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[48;5;18m╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\u001b[0m\n",
       "\u001b[48;5;18m│\u001b[0m\u001b[48;5;18m \u001b[0m\u001b[1;37;48;5;18mOptical Prescription — Unnamed System\u001b[0m\u001b[48;5;18m                                                                          \u001b[0m\u001b[48;5;18m \u001b[0m\u001b[48;5;18m│\u001b[0m\n",
       "\u001b[48;5;18m╰─\u001b[0m\u001b[48;5;18m───────────────────────────────────────\u001b[0m\u001b[48;5;18m Generated: 2026-05-20 15:35 UTC \u001b[0m\u001b[48;5;18m───────────────────────────────────────\u001b[0m\u001b[48;5;18m─╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────── </span><span style=\"font-weight: bold\">First-Order Properties</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────── \u001b[0m\u001b[1mFirst-Order Properties\u001b[0m\u001b[92m ──────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                           \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Effective Focal Length (EFL) </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 49.9998  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Focal Length (FFL)     </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.9998 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Focal Length (BFL)      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 0.2071   </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Principal Plane (P1)   </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 12.6541  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Principal Plane (P2)    </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.7927 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Front Nodal Plane (N1)       </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 12.6541  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Back Nodal Plane (N2)        </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -49.7927 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Image-Space F/#              </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 5.0000   </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Entrance Pupil Diameter      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 10.0000  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Entrance Pupil Location      </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 11.5122  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Exit Pupil Diameter          </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> 10.2337  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Exit Pupil Location          </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -50.9613 </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Transverse Magnification     </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -0.0000  </span> \n",
       " <span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\"> Lagrange Invariant           </span> <span style=\"color: #c0c0c0; text-decoration-color: #c0c0c0\"> -1.8199  </span> \n",
       "                                           \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                           \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEffective Focal Length (EFL)\u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m49.9998 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Focal Length (FFL)    \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.9998\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Focal Length (BFL)     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m0.2071  \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Principal Plane (P1)  \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m12.6541 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Principal Plane (P2)   \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.7927\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mFront Nodal Plane (N1)      \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m12.6541 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mBack Nodal Plane (N2)       \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-49.7927\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mImage-Space F/#             \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m5.0000  \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEntrance Pupil Diameter     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m10.0000 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mEntrance Pupil Location     \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m11.5122 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mExit Pupil Diameter         \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m10.2337 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mExit Pupil Location         \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-50.9613\u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mTransverse Magnification    \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-0.0000 \u001b[0m\u001b[37m \u001b[0m \n",
       " \u001b[2;36m \u001b[0m\u001b[2;36mLagrange Invariant          \u001b[0m\u001b[2;36m \u001b[0m \u001b[37m \u001b[0m\u001b[37m-1.8199 \u001b[0m\u001b[37m \u001b[0m \n",
       "                                           \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────── </span><span style=\"font-weight: bold\">Surface Data — Geometry</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ─────────────────────────────────────────────</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[92m───────────────────────────────────────────── \u001b[0m\u001b[1mSurface Data — Geometry\u001b[0m\u001b[92m ─────────────────────────────────────────────\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">                                                                          \n",
       " <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> S# </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Type     </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Radius (mm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Thickness (mm) </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Conic  </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Stop </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\"> Comment </span> \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Plane      ∞             ∞                —                        \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 22.0136     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 3.2590         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  2    standard   -435.7604     6.0076           0.0000                   \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 3  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> -22.2133    </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 1.0000         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  4    standard   20.2919       4.7504           0.0000   ✓               \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 5  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 79.6836     </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 2.9521         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000 </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "  6    standard   -18.3953      42.2078          0.0000                   \n",
       " <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 7  </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> standard </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> ∞           </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 0.0000         </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> —      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">      </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">         </span> \n",
       "                                                                          \n",
       "</pre>\n"
      ],
      "text/plain": [
       "                                                                          \n",
       " \u001b[1;35m \u001b[0m\u001b[1;35mS#\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mType    \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mRadius (mm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mThickness (mm)\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mConic \u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mStop\u001b[0m\u001b[1;35m \u001b[0m \u001b[1;35m \u001b[0m\u001b[1;35mComment\u001b[0m\u001b[1;35m \u001b[0m \n",
       " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \n",
       "  0    Plane      ∞             ∞                —                        \n",
       " \u001b[2m \u001b[0m\u001b[2m1 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m22.0136    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m3.2590        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  2    standard   -435.7604     6.0076           0.0000                   \n",
       " \u001b[2m \u001b[0m\u001b[2m3 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m-22.2133   \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m1.0000        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  4    standard   20.2919       4.7504           0.0000   ✓               \n",
       " \u001b[2m \u001b[0m\u001b[2m5 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m79.6836    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m2.9521        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "  6    standard   -18.3953      42.2078          0.0000                   \n",
       " \u001b[2m \u001b[0m\u001b[2m7 \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2mstandard\u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m∞          \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m0.0000        \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m—     \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m    \u001b[0m\u001b[2m \u001b[0m \u001b[2m \u001b[0m\u001b[2m       \u001b[0m\u001b[2m \u001b[0m \n",
       "                                                                          \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from optiland.prescription.sections import FirstOrderSection, SurfaceGeometryTableSection\n",
    "\n",
    "# Create a prescription containing only first-order and surface geometry data\n",
    "custom_sections = [\n",
    "    FirstOrderSection(),\n",
    "    SurfaceGeometryTableSection()\n",
    "]\n",
    "\n",
    "custom_prescription = Prescription(lens, sections=custom_sections)\n",
    "custom_prescription.view()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Saving and Exporting Reports\n",
    "\n",
    "You can save the report to a file using the `.save(path)` method. The file output format is automatically inferred from the file extension:\n",
    "- **Plain Text (`.txt`, `.log`, etc.)**: Renders standard plain-text tables.\n",
    "- **PDF (`.pdf`)**: Generates a professional PDF document."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Export as plain-text\n",
    "prescription.save(\"cooke_triplet_prescription.txt\")\n",
    "\n",
    "# Export as a formatted PDF document\n",
    "prescription.save(\"cooke_triplet_prescription.pdf\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
