Metadata-Version: 2.2
Name: BaldrApp
Version: 0.1.0
Summary: Simulating Baldr - the Zernike Wavefront Sensor for Asgard
Home-page: https://github.com/your_username/your_project
Author: Benjamin Courtney-Barrer
Author-email: benjamin.courtney-barrer@anu.edu.au
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: altair==5.4.1
Requires-Dist: astropy==6.1.3
Requires-Dist: astropy-iers-data==0.2024.9.23.0.31.43
Requires-Dist: asttokens==2.4.1
Requires-Dist: attrs==24.2.0
Requires-Dist: blinker==1.8.2
Requires-Dist: cachetools==5.5.0
Requires-Dist: certifi==2024.8.30
Requires-Dist: charset-normalizer==3.3.2
Requires-Dist: click==8.1.7
Requires-Dist: contourpy==1.3.0
Requires-Dist: cycler==0.12.1
Requires-Dist: decorator==5.1.1
Requires-Dist: executing==2.1.0
Requires-Dist: fonttools==4.54.1
Requires-Dist: gitdb==4.0.11
Requires-Dist: GitPython==3.1.43
Requires-Dist: idna==3.10
Requires-Dist: ipython==8.28.0
Requires-Dist: jedi==0.19.1
Requires-Dist: Jinja2==3.1.4
Requires-Dist: joblib==1.4.2
Requires-Dist: jsonschema==4.23.0
Requires-Dist: jsonschema-specifications==2023.12.1
Requires-Dist: kiwisolver==1.4.7
Requires-Dist: llvmlite==0.43.0
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: MarkupSafe==2.1.5
Requires-Dist: matplotlib==3.9.2
Requires-Dist: matplotlib-inline==0.1.7
Requires-Dist: mdurl==0.1.2
Requires-Dist: narwhals==1.8.3
Requires-Dist: numpy==2.1.1
Requires-Dist: packaging==24.1
Requires-Dist: pandas==2.2.3
Requires-Dist: parso==0.8.4
Requires-Dist: pexpect==4.9.0
Requires-Dist: pillow==10.4.0
Requires-Dist: poppy==1.1.1
Requires-Dist: prompt_toolkit==3.0.48
Requires-Dist: protobuf==5.28.2
Requires-Dist: ptyprocess==0.7.0
Requires-Dist: pure_eval==0.2.3
Requires-Dist: pyarrow==17.0.0
Requires-Dist: pydeck==0.9.1
Requires-Dist: pyerfa==2.0.1.4
Requires-Dist: Pygments==2.18.0
Requires-Dist: pyparsing==3.1.4
Requires-Dist: PyQt5==5.15.11
Requires-Dist: PyQt5-Qt5==5.15.15
Requires-Dist: PyQt5_sip==12.15.0
Requires-Dist: pyqtgraph==0.13.7
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: pytz==2024.2
Requires-Dist: PyYAML==6.0.2
Requires-Dist: referencing==0.35.1
Requires-Dist: requests==2.32.3
Requires-Dist: rich==13.8.1
Requires-Dist: rpds-py==0.20.0
Requires-Dist: scikit-learn==1.5.2
Requires-Dist: scipy==1.14.1
Requires-Dist: six==1.16.0
Requires-Dist: smmap==5.0.1
Requires-Dist: stack-data==0.6.3
Requires-Dist: streamlit==1.38.0
Requires-Dist: tenacity==8.5.0
Requires-Dist: threadpoolctl==3.5.0
Requires-Dist: toml==0.10.2
Requires-Dist: tornado==6.4.1
Requires-Dist: traitlets==5.14.3
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: tzdata==2024.2
Requires-Dist: urllib3==2.2.3
Requires-Dist: watchdog==4.0.2
Requires-Dist: wcwidth==0.2.13
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# BaldrApp

Simulating Baldr - the Zernike Wavefront Sensor for Asgard

Includes 
- a  **PyQt** app for end-to-end simulatations and visualization of  Baldr operations (closed and open loop). Try:
    >>python apps/baldr_closed_loop_app/closed_loop_pyqtgraph.py

                                                    
- a **Streamlit** application that simulates a Zernike Wavefront Sensor optical system using Fresnel diffraction propagation to model system mis-alignments. The default setup is for simulating the last (critical) part of the optical train of Baldr. Try: 
    >>streamlit run apps/baldr_alignment_app/Baldr_Fresnel_App.py

- general packaged tools for simulating ZWFS's. These build upon the python pyZELDA package.


## Installation

1. Clone the repository:
   ```bash
   git clone https://github.com/courtney-barrer/BaldrApp

Depends on a forked version of the pyZELDA package (https://github.com/courtney-barrer/pyZELDA) which is specified in the requirements.txt.

if there are path issues after setup try install directly:

pip install pyzelda@git+https://github.com/courtney-barrer/pyZELDA.git@b42aaea5c8a47026783a15391df5e058360ea15e



## Features
Key Features:
1. User Inputs via Sidebar:
    - Wavelength: Controls the light wavelength in micrometers.
    - Zernike Aberration: Users define Zernike mode and coefficient to simulate optical aberrations.
    - Phasemask Properties: Diameter, phase shift, on-axis/off-axis transmission coefficients.
    - Optical Element Offsets: Users can shift positions of elements like phase mask, lenses, and cold stop.
    - Element Inclusion: Toggle the inclusion/exclusion of key components (phase mask, cold stop).

2. System Propagation and Plot:
    - Calculates wavefront propagation through a multi-element optical system (lenses, phase mask, cold stop).
    - Fresnel diffraction propagation is used to model the interaction of light with optical elements.
    - Applies Zernike aberrations to simulate their effect on intensity measured at the detector.
    - Visualizes the intensity distribution at the detector using a heatmap.

3. Update Button:
    - Plot updates only when the "Update" button is pressed, making the app more efficient.
    - Input values are stored in `st.session_state` to prevent unnecessary re-runs.

4. Plotting the Results:
    - The app bins and displays the resulting intensity distribution at the detector.
    - A heatmap shows how system parameters affect the output.

