Commit Graph

23 Commits

Author SHA1 Message Date
ca4101dcb0 feat: improve optical report with embedded Plotly and 4x PNG export
- Embed Plotly.js inline for offline viewing (fixes CDN loading issues)
- Add 4x resolution PNG export for all charts via toImageButtonOptions
- Add SAT3_Trajectory_V7 study (TPE warm-start from V5, 86 trials, WS=277.37)
- Include V7 optimization report and configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 19:29:34 -05:00
a5059dd64a Add PSD figure generation script for CDR reports
Generates publication-ready PSD figures from OP2 FEA data:
- psd_multi_angle.png: PSD curves for all elevation angles
- psd_band_decomposition.png: LSF/MSF/HSF bar chart
- psd_40deg_composite.png: WFE surface + PSD side-by-side
- psd_trajectory.png: Band evolution vs elevation

Uses Atomizer's full OPD pipeline for consistency with CDR WFE numbers.
2026-02-06 17:38:48 +00:00
38d0994d29 Add WFE PSD analysis tools (Tony Hull methodology)
- tools/wfe_psd.py: Quick PSD computation for WFE surfaces
- optimization_engine/insights/wfe_psd.py: Full PSD module with band
  decomposition (LSF/MSF/HSF), radial averaging, Hann windowing,
  and visualization support
- knowledge_base/lac/session_insights/stopp_command_20260129.jsonl:
  Session insight from stopp command implementation

PSD analysis decomposes WFE into spatial frequency bands per Tony Hull's
JWST methodology. Used for CDR V7 to validate that MSF (support
print-through) dominates the residual WFE at 85-89% of total RMS.
2026-02-06 17:38:34 +00:00
5f5d55d107 fix(report): trajectory plots full-width instead of side-by-side
- Remove two-col grid wrapper from trajectory section
- Each plot now gets full container width
- Trajectory plot height 450→500, width 1100 for better readability
2026-01-30 00:06:10 +00:00
27d9dbee5b fix(psd): auto-scale x-axis to data range, improve plot layout
- X-axis now auto-ranges from data (was going to 10^21)
- Band annotations clamped to actual data extent
- Legend moved to upper-right (was overlapping data)
- Thicker lines (2.5px), larger axis labels
- dtick=1 for clean log-scale tick marks
2026-01-30 00:03:38 +00:00
12afd0c54f fix(psd): add angle labels to PSD band decomposition cards 2026-01-29 23:58:14 +00:00
a1000052cb fix(psd): correct normalization using Parseval band summation
- Band RMS now uses direct Parseval: sqrt(sum(|FFT|²) / N⁴ / hann_power)
- Previous approach had dimensional mismatch (cycles/apt vs cycles/mm)
- Results now match Zernike filtered RMS within ~10%:
  40° vs 20°: PSD=6.18nm vs Zernike=7.70nm
  60° vs 20°: PSD=15.83nm vs Zernike=17.69nm
  90° Abs: PSD=27.01nm vs Zernike=22.33nm
- PSD plot curve uses separate normalization (shape, not absolute)
- Refactored compute_surface_psd to return dict with freqs, psd, bands
2026-01-29 23:49:03 +00:00
eeacfbe41a feat(report): replace LSF/MSF with Tony Hull PSD analysis
- Remove compute_spatial_freq_metrics() and _spatial_freq_html()
- Add compute_surface_psd(): 2D FFT + Hann window + radial averaging
- Add compute_psd_band_rms(): gravity/support/HF band decomposition
- Add make_psd_plot(): interactive log-log PSD plot with band annotations
- Add _psd_summary_html(): band RMS cards with % breakdown
- New section in report: Power Spectral Density Analysis
- Zernike details now show only coefficient bar charts (cleaner)
- Methodology: Tony Hull JWST approach for WFE spatial frequency analysis
2026-01-29 22:15:42 +00:00
487ecf67dc feat(report): wider surface maps + spatial frequency band metrics
- CSS .plot-grid: minmax(650px) → minmax(1100px) for full-width surface maps
- Add compute_spatial_freq_metrics(): LSF/MSF band RMS, per-radial-order breakdown
- Add styled metrics cards in Zernike Coefficient Details (section 6)
  showing LSF (J4-J15), MSF (J16-J50), ratio, and per-order RMS n=2..9
2026-01-29 20:46:58 +00:00
faab234d05 fix: update Plotly.js CDN to 3.3.1 (match Python lib 6.5.2 bdata format), show 50 modes 2026-01-29 20:32:55 +00:00
c6427f3c6e fix: replace deprecated titlefont with title.font for Plotly compat 2026-01-29 20:20:01 +00:00
34b52f9543 Add comprehensive optical performance report generator
New tool: tools/generate_optical_report.py
- CDR-ready single HTML report from OP2 results
- Executive summary with pass/fail vs targets
- Per-angle WFE analysis with 3D surface plots
- Zernike trajectory analysis (mode-specific RMS)
- Axial vs lateral sensitivity matrix
- Manufacturing correction metrics
- Collapsible Zernike coefficient bar charts
- Optional study DB integration for design params
- Annular aperture support (default M1 inner R=135.75mm)
- Dark theme, interactive Plotly charts, print-friendly
2026-01-29 18:28:10 +00:00
d7986922d5 fix(tools): make Zernike OPD tools robust to extra subcases
- Replace brittle order-based subcase mapping with name-based search
- Tools now directly search for required angles (20, 40, 60, 90) by label
- Ignores extra subcases (e.g., 30, 50 degrees) without errors
- Falls back to numeric IDs (1,2,3,4) if angle labels not found
- Clear error messages show exactly which subcases are missing

This allows running WFE analysis on simulations with >4 subcases
without manual file/code modifications.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 10:22:33 -05:00
a26914bbe8 feat: Add Studio UI, intake system, and extractor improvements
Dashboard:
- Add Studio page with drag-drop model upload and Claude chat
- Add intake system for study creation workflow
- Improve session manager and context builder
- Add intake API routes and frontend components

Optimization Engine:
- Add CLI module for command-line operations
- Add intake module for study preprocessing
- Add validation module with gate checks
- Improve Zernike extractor documentation
- Update spec models with better validation
- Enhance solve_simulation robustness

Documentation:
- Add ATOMIZER_STUDIO.md planning doc
- Add ATOMIZER_UX_SYSTEM.md for UX patterns
- Update extractor library docs
- Add study-readme-generator skill

Tools:
- Add test scripts for extraction validation
- Add Zernike recentering test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:02:30 -05:00
3193831340 feat: Add DevLoop automation and HTML Reports
## DevLoop - Closed-Loop Development System
- Orchestrator for plan → build → test → analyze cycle
- Gemini planning via OpenCode CLI
- Claude implementation via CLI bridge
- Playwright browser testing integration
- Test runner with API, filesystem, and browser tests
- Persistent state in .devloop/ directory
- CLI tool: tools/devloop_cli.py

Usage:
  python tools/devloop_cli.py start 'Create new feature'
  python tools/devloop_cli.py plan 'Fix bug in X'
  python tools/devloop_cli.py test --study support_arm
  python tools/devloop_cli.py browser --level full

## HTML Reports (optimization_engine/reporting/)
- Interactive Plotly-based reports
- Convergence plot, Pareto front, parallel coordinates
- Parameter importance analysis
- Self-contained HTML (offline-capable)
- Tailwind CSS styling

## Playwright E2E Tests
- Home page tests
- Test results in test-results/

## LAC Knowledge Base Updates
- Session insights (failures, workarounds, patterns)
- Optimization memory for arm support study
2026-01-24 21:18:18 -05:00
a3f18dc377 chore: Project cleanup and Canvas UX improvements (Phase 7-9)
## Cleanup (v0.5.0)
- Delete 102+ orphaned MCP session temp files
- Remove build artifacts (htmlcov, dist, __pycache__)
- Archive superseded plan docs (RALPH_LOOP V2/V3, CANVAS V3, etc.)
- Move debug/analysis scripts from tests/ to tools/analysis/
- Archive redundant NX journals to archive/nx_journals/
- Archive monolithic PROTOCOL.md to docs/archive/
- Update .gitignore with missing patterns
- Clean old study files (optimization_log_old.txt, run_optimization_old.py)

## Canvas UX (Phases 7-9)
- Phase 7: Resizable panels with localStorage persistence
  - Left sidebar: 200-400px, Right panel: 280-600px
  - New useResizablePanel hook and ResizeHandle component
- Phase 8: Enable all palette items
  - All 8 node types now draggable
  - Singleton logic for model/solver/algorithm/surrogate
- Phase 9: Solver configuration
  - Add SolverEngine type (nxnastran, mscnastran, python, etc.)
  - Add NastranSolutionType (SOL101-SOL200)
  - Engine/solution dropdowns in config panel
  - Python script path support

## Documentation
- Update CHANGELOG.md with recent versions
- Update docs/00_INDEX.md
- Create examples/README.md
- Add docs/plans/CANVAS_UX_IMPROVEMENTS.md
2026-01-24 15:17:34 -05:00
cf8c57fdac chore: Add Atomizer launcher and utility scripts
- atomizer.ico: Application icon
- launch_atomizer.bat: One-click launcher for dashboard
- create_desktop_shortcut.ps1: Desktop shortcut creator
- restart_backend.bat, start_backend_8002.bat: Dev utilities
2026-01-20 13:12:12 -05:00
6c30224341 feat(config): AtomizerSpec v2.0 Pydantic models, validators, and tests
Config Layer:
- spec_models.py: Pydantic models for AtomizerSpec v2.0
- spec_validator.py: Semantic validation with detailed error reporting

Extractors:
- custom_extractor_loader.py: Runtime custom extractor loading
- spec_extractor_builder.py: Build extractors from spec definitions

Tools:
- migrate_to_spec_v2.py: CLI tool for batch migration

Tests:
- test_migrator.py: Migration tests
- test_spec_manager.py: SpecManager service tests
- test_spec_api.py: REST API tests
- test_mcp_tools.py: MCP tool tests
- test_e2e_unified_config.py: End-to-end config tests
2026-01-20 13:12:03 -05:00
73a7b9d9f1 feat: Add dashboard chat integration and MCP server
Major changes:
- Dashboard: WebSocket-based chat with session management
- Dashboard: New chat components (ChatPane, ChatInput, ModeToggle)
- Dashboard: Enhanced UI with parallel coordinates chart
- MCP Server: New atomizer-tools server for Claude integration
- Extractors: Enhanced Zernike OPD extractor
- Reports: Improved report generator

New studies (configs and scripts only):
- M1 Mirror: Cost reduction campaign studies
- Simple Beam, Simple Bracket, UAV Arm studies

Note: Large iteration data (2_iterations/, best_design_archive/)
excluded via .gitignore - kept on local Gitea only.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:53:55 -05:00
82f36689b7 feat: Pre-migration checkpoint - updated docs and utilities
Updates before optimization_engine migration:
- Updated migration plan to v2.1 with complete file inventory
- Added OP_07 disk optimization protocol
- Added SYS_16 self-aware turbo protocol
- Added study archiver and cleanup utilities
- Added ensemble surrogate module
- Updated NX solver and session manager
- Updated zernike HTML generator
- Added context engineering plan
- LAC session insights updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 10:22:45 -05:00
f13563d7ab feat: Major update - Physics docs, Zernike OPD, insights, NX journals, tools
Documentation:
- Add docs/06_PHYSICS/ with Zernike fundamentals and OPD method docs
- Add docs/guides/CMA-ES_EXPLAINED.md optimization guide
- Update CLAUDE.md and ATOMIZER_CONTEXT.md with current architecture
- Update OP_01_CREATE_STUDY protocol

Planning:
- Add DYNAMIC_RESPONSE plans for random vibration/PSD support
- Add OPTIMIZATION_ENGINE_MIGRATION_PLAN for code reorganization

Insights System:
- Update design_space, modal_analysis, stress_field, thermal_field insights
- Improve error handling and data validation

NX Journals:
- Add analyze_wfe_zernike.py for Zernike WFE analysis
- Add capture_study_images.py for automated screenshots
- Add extract_expressions.py and introspect_part.py utilities
- Add user_generated_journals/journal_top_view_image_taking.py

Tests & Tools:
- Add comprehensive Zernike OPD test suite
- Add audit_v10 tests for WFE validation
- Add tools for Pareto graphs and mirror data extraction
- Add migrate_studies_to_topics.py utility

Knowledge Base:
- Initialize LAC (Learning Atomizer Core) with failure/success patterns

Dashboard:
- Update Setup.tsx and launch_dashboard.py
- Add restart-dev.bat helper script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 19:47:37 -05:00
1612991d0d feat: Add Study Insights module (SYS_16) for physics visualizations
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>
2025-12-20 13:46:28 -05:00
Antoine
1bb201e0b7 feat: Add post-optimization tools and mandatory best design archiving
New Tools (tools/):
- analyze_study.py: Generate comprehensive optimization reports
- find_best_iteration.py: Find best iteration folder, optionally copy it
- archive_best_design.py: Archive best design to 3_results/best_design_archive/<timestamp>/

Protocol Updates:
- OP_02_RUN_OPTIMIZATION.md v1.1: Add mandatory archive_best_design step
  in Post-Run Actions. This MUST be done after every optimization run.

V14 Updates:
- run_optimization.py: Auto-archive best design at end of optimization
- optimization_config.json: Expand bounds for V14 continuation
  - lateral_outer_angle: min 13->11 deg (was at 4.7%)
  - lateral_inner_pivot: min 7->5 mm (was at 8.1%)
  - lateral_middle_pivot: max 23->27 mm (was at 99.4%)
  - whiffle_min: max 60->72 mm (was at 96.3%)

Usage:
  python tools/analyze_study.py m1_mirror_adaptive_V14
  python tools/find_best_iteration.py m1_mirror_adaptive_V14
  python tools/archive_best_design.py m1_mirror_adaptive_V14

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 10:28:35 -05:00