Introduces a new plugin architecture for study-specific physics visualizations, separating "optimizer perspective" (Analysis) from "engineer perspective" (Insights). New module: optimization_engine/insights/ - base.py: StudyInsight base class, InsightConfig, InsightResult, registry - zernike_wfe.py: Mirror WFE with 3D surface and Zernike decomposition - stress_field.py: Von Mises stress contours with safety factors - modal_analysis.py: Natural frequencies and mode shapes - thermal_field.py: Temperature distribution visualization - design_space.py: Parameter-objective landscape exploration Features: - 5 insight types: zernike_wfe, stress_field, modal, thermal, design_space - CLI: python -m optimization_engine.insights generate <study> - Standalone HTML generation with Plotly - Enhanced Zernike viz: Turbo colorscale, smooth shading, 0.5x AMP - Dashboard API fix: Added include_coefficients param to extract_relative() Documentation: - docs/protocols/system/SYS_16_STUDY_INSIGHTS.md - Updated ATOMIZER_CONTEXT.md (v1.7) - Updated 01_CHEATSHEET.md with insights section Tools: - tools/zernike_html_generator.py: Standalone WFE HTML generator - tools/analyze_wfe.bat: Double-click to analyze OP2 files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
76 lines
3.0 KiB
Batchfile
76 lines
3.0 KiB
Batchfile
@echo off
|
|
REM Atomizer WFE Analyzer - Double-click to analyze OP2 file
|
|
REM Opens file dialog to select OP2, then runs Zernike analysis
|
|
REM Generates 3 HTML files: 40 vs 20, 60 vs 20, 90 Manufacturing
|
|
|
|
echo ======================================================================
|
|
echo ATOMIZER WFE ANALYZER
|
|
echo Generates Zernike HTML Reports (40 vs 20, 60 vs 20, 90 Mfg)
|
|
echo ======================================================================
|
|
echo.
|
|
|
|
REM Use PowerShell to open file dialog
|
|
for /f "delims=" %%I in ('powershell -NoProfile -Command "Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.OpenFileDialog; $f.Filter = 'OP2 Files (*.op2)|*.op2|All Files (*.*)|*.*'; $f.Title = 'Select OP2 Results File'; $f.InitialDirectory = '%USERPROFILE%'; if ($f.ShowDialog() -eq 'OK') { $f.FileName }"') do set "OP2_FILE=%%I"
|
|
|
|
if "%OP2_FILE%"=="" (
|
|
echo No file selected. Exiting.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Selected: %OP2_FILE%
|
|
echo.
|
|
|
|
REM Get the directory of the OP2 file for finding output HTMLs
|
|
for %%F in ("%OP2_FILE%") do set "OP2_DIR=%%~dpF"
|
|
for %%F in ("%OP2_FILE%") do set "OP2_BASE=%%~nF"
|
|
|
|
REM Initialize conda and activate atomizer environment
|
|
call "%USERPROFILE%\anaconda3\Scripts\activate.bat" atomizer
|
|
|
|
echo Running Zernike analysis...
|
|
echo.
|
|
|
|
REM Run the HTML generator
|
|
python "%~dp0zernike_html_generator.py" "%OP2_FILE%"
|
|
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo.
|
|
echo ======================================================================
|
|
echo ERROR: Analysis failed. See errors above.
|
|
echo ======================================================================
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo ======================================================================
|
|
echo Opening generated HTML files in browser...
|
|
echo ======================================================================
|
|
|
|
REM Find and open the most recent HTML files (with timestamp pattern)
|
|
REM They follow pattern: {basename}_{timestamp}_*.html
|
|
|
|
REM Open all matching HTML files
|
|
for /f "delims=" %%H in ('powershell -NoProfile -Command "Get-ChildItem -Path '%OP2_DIR%' -Filter '%OP2_BASE%_*_40_vs_20.html' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName"') do (
|
|
echo Opening: %%~nxH
|
|
start "" "%%H"
|
|
)
|
|
|
|
for /f "delims=" %%H in ('powershell -NoProfile -Command "Get-ChildItem -Path '%OP2_DIR%' -Filter '%OP2_BASE%_*_60_vs_20.html' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName"') do (
|
|
echo Opening: %%~nxH
|
|
start "" "%%H"
|
|
)
|
|
|
|
for /f "delims=" %%H in ('powershell -NoProfile -Command "Get-ChildItem -Path '%OP2_DIR%' -Filter '%OP2_BASE%_*_90_mfg.html' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName"') do (
|
|
echo Opening: %%~nxH
|
|
start "" "%%H"
|
|
)
|
|
|
|
echo.
|
|
echo ======================================================================
|
|
echo ANALYSIS COMPLETE
|
|
echo ======================================================================
|
|
echo.
|
|
pause
|