Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 1.78 KB

README.md

File metadata and controls

76 lines (55 loc) · 1.78 KB

PyTGS

A Python tool for thermo-mechanical property analysis of transient grating spectroscopy (TGS) signals. Input is a raw TGS signal and output is thermal diffusivity, surface acoustic wave speed, and other fitting constants of the characteristic TGS equation.

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/shortlab/PyTGS.git
    cd PyTGS
  2. Run the automated setup script:

    On Unix/MacOS:

    chmod +x setup.sh
    ./setup.sh

    On Windows:

    bash setup.sh

    Note: On Windows, you'll need Git Bash or a similar bash shell. If you don't have one use the manual installation below.

    Manual Installation (Windows/Unix/MacOS):

    python -m venv PyTGS-venv
    # On Windows:
    PyTGS-venv\Scripts\activate
    # On Unix/MacOS:
    source PyTGS-venv/bin/activate
    
    pip install --upgrade pip
    pip install -e .  # or pip install -r requirements.txt

Usage

  1. Activate the virtual environment:

    On Unix/MacOS:

    source PyTGS-venv/bin/activate

    On Windows:

    PyTGS-venv\Scripts\activate
  2. Edit config.yaml with your data path and desired fitting parameters.

  3. Run the analysis:

    python main.py

    Fitting results and figures will be saved in fit/ and figures/ directories, respectively. You can view example input/output files in the example/ directory.

Testing

The package includes tests that validate correctness of the analysis pipeline using synthetic TGS signals.

To run the tests, use the following command:

pytest tests/test.py -v