Skip to content

TheFermiSea/pymodaq_plugins_urashg

Repository files navigation

PyMoDAQ URASHG Plugin Package

A PyMoDAQ 5.x compliant plugin package for μRASHG (micro Rotational Anisotropy Second Harmonic Generation) microscopy systems. This package provides complete hardware control and experimental automation for polarimetric SHG measurements with a fully functional unified GUI interface.

Status: Production Ready

  • GUI Interface: Fully working unified 5-panel interface for complete system control
  • Mock Device Support: Comprehensive simulation for GUI testing without hardware
  • PyMoDAQ 5.x Compliance: All compliance tests passing
  • Plugin Discovery: All 5 plugins are discoverable by the PyMoDAQ framework
  • Measurement System: Functional calibration and measurement workflows

Important Notice

This is an UNOFFICIAL plugin package developed independently. While it follows PyMoDAQ 5.x standards and is fully functional, it is not officially endorsed or maintained by the PyMoDAQ team.

Overview

The URASHG plugin package enables sophisticated polarimetric second harmonic generation measurements through PyMoDAQ's modular framework:

  • Standards-compliant architecture: Follows PyMoDAQ 5.x plugin development guidelines.
  • Multi-device coordination: Integrated control for lasers, polarization optics, cameras, and power meters.
  • Unified extension: A single, comprehensive extension for complete system control.
  • Hardware abstraction: Works with real hardware or in a simulation mode.

Plugin Components

Move Plugins (Motion Control)

  • DAQ_Move_Elliptec: Thorlabs ELL14 rotation mount control for polarization optics.
  • DAQ_Move_MaiTai: MaiTai Ti:Sapphire laser wavelength and power control.
  • DAQ_Move_ESP300: Newport ESP300 multi-axis motion controller for optical delay line (in progress).

Viewer Plugins (Detection)

  • DAQ_2DViewer_PrimeBSI: Photometrics Prime BSI sCMOS camera control.
  • DAQ_0DViewer_Newport1830C: Newport 1830-C optical power meter.

Extensions

  • URASHGMicroscopyExtension: Comprehensive microscopy control interface.

Hardware Support

Cameras

  • Photometrics Prime BSI: sCMOS camera with PyVCAM integration. Full control of exposure, gain, ROI, and readout modes.

Motion Control

  • Thorlabs ELL14 Rotation Mounts: Polarization control (QWP, HWP).
  • MaiTai Laser: Wavelength control and EOM power modulation.
  • Newport ESP300: Precision positioning stages.

Detection

  • Newport 1830-C Power Meter: Optical power monitoring for power calibration and stabilization.

Installation

Prerequisites

It is recommended to use uv, a modern Python package manager.

# Install uv with pip
pip install uv

Installation Steps

# Clone the repository
git clone https://github.com/TheFermiSea/pymodaq_plugins_urashg.git
cd pymodaq_plugins_urashg

# Create a virtual environment and install dependencies
uv pip install -e .

# To include optional hardware dependencies
uv pip install -e .[hardware]

# For development
uv pip install -e .[dev]

PyMoDAQ Integration

After installation, the plugins will be automatically discovered by PyMoDAQ.

# Launch PyMoDAQ Dashboard
python -m pymodaq.dashboard

The URASHG extension will be available in the Extensions menu.

Usage

Unified GUI Interface (Recommended)

Launch the standalone URASHG interface directly:

uv run python src/pymodaq_plugins_urashg/applications/urashg_unified_app.py

GUI Features:

  • 5-Panel Layout: Control, Camera Data, Analysis Plots, Device Status, and Elliptec Control.
  • Mock Device Support: Test the interface with simulated hardware.
  • Real-time Feedback: Live status updates and measurement progress.
  • Integrated Workflow: Complete measurement and calibration sequences.

Mock Mode Testing

The application includes a comprehensive mock device simulation for GUI testing without hardware.

  1. Launch the GUI:
    uv run python src/pymodaq_plugins_urashg/applications/urashg_unified_app.py
  2. Initialize Mock Devices:
    • Click the "Initialize Devices" button in the toolbar. Mock devices will be created automatically.
  3. Test Features:
    • The status panel will show all devices as "Connected".
    • The camera view will display simulated data with realistic patterns.
    • Calibrations and measurements can be run using mock data.

Development

Environment Setup

# Install all dependencies for development
uv pip install -e .[dev,hardware]

Testing

# Run all tests
uv run pytest

# Run compliance tests
uv run pytest tests/test_pymodaq_compliance.py -v

# Run specific test categories
uv run pytest tests/unit/ -v
uv run pytest tests/hardware/ -v -m hardware

Code Quality

# Format code
uv run black src/
uv run isort src/

# Linting
uv run flake8 src/

PyMoDAQ 5.x Compliance

This package is fully compliant with PyMoDAQ 5.x standards. It correctly implements all required plugin structures, initialization methods, import patterns, and entry points.

Compliance Test Results: 16/16 tests passing.

Project Structure

pymodaq_plugins_urashg/
├── src/pymodaq_plugins_urashg/
│   ├── daq_move_plugins/          # Motion control plugins
│   ├── daq_viewer_plugins/        # Detection plugins
│   ├── extensions/                # PyMoDAQ extensions
│   ├── hardware/urashg/           # Hardware abstraction layer
│   ├── utils/                     # Utilities and configuration
│   └── resources/                 # Configuration templates
├── tests/                         # Test suite
│   ├── unit/                      # Unit tests
│   ├── hardware/                  # Hardware integration tests
│   └── mock_modules/              # Mock hardware for testing
├── docs/                          # Documentation
├── pyproject.toml                 # Project packaging and configuration
└── README.md                      # This file

Contributing

Contributions are welcome. Please ensure that any changes adhere to PyMoDAQ 5.x development patterns, include tests for new functionality, and are documented. Code should be formatted with black and isort.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

PyMoDAQ plugin for RASHG microscopy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages