Skip to content

ltelab/pytmatrix-lte

Repository files navigation

PyTMatrix-LTE

A Python library for computing the scattering properties of homogeneous nonspherical scatterers with the T-Matrix method.
Uses the T-Matrix code by M. I. Mishchenko and L. D. Travis.

This is repository adapted the original PyTMatrix code by Jussi Leinonen, which can be found here, to run with newer versions of python: installation of the original code was buggy for python>3.6, fully deprecated for python>3.12 and numpy>2.

The code adaptations include:

  • Migration from distutils to setuptools (setup.py rewritten)
  • Migration of certain scipy functions to new names
  • Optimization and vectorization of some computations

Installation

The installation instructions in the original pytmatrix library are outdated and do not work for recent python versions (python>3.6).

The instructions below describe how to install the LTE-maintained fork of pyTMatrix, which is compatible with modern Python interpreters.

WARNING: Installing pyTMatrix directly via pip install git+https://github.com/ltelab/pytmatrix-lte.git does not work at this time. We welcome contributions to enable this type of installation !

1. Install dependencies

Make sure you have the GNU Fortran Compiler (gfortran) and the Meson build system installed. You can install them via conda:

conda install -c conda-forge gfortran meson

2. Clone the repository

Fork and clone the LTE-maintained pyTMatrix repository:

git clone https://github.com/<your-account>/pytmatrix-lte.git

3. Install the package

Navigate into the cloned repository and install the package in editable mode:

cd pytmatrix-lte
pip install -e .

4. Run tests

To confirm that everything was installed correctly, run the built-in test suite:

from pytmatrix.test import test_tmatrix
test_tmatrix.run_tests()

The software should now be installed and ready to use.

Usage

See the usage instructions in the original wiki.

About

Adaptation of the pytmatrix library from Jussi Leinonen (https://github.com/jleinonen/pytmatrix )

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •