Skip to content

Commit

Permalink
doc: update installation.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
lavakyan committed Mar 5, 2021
1 parent 27f4485 commit 6d6504f
Showing 1 changed file with 29 additions and 41 deletions.
70 changes: 29 additions & 41 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@



Installation
============
# Installation


Source code
-----------
## Source code


Source code of Python wrapper is available on GitHub <https://github.com/lavakyan/mstm-spectrum>.
Expand All @@ -18,8 +16,7 @@ MSTM studio can be run without MSTM binary, but with restricted functionality.
For non-spherical particles (currently available only spheroids) the ScatterPy library is used (See [Binding with ScatterPy](#binding-with-scatterpy) for installation details).


Linux installation
------------------
## Linux installation


Install from PyPi:
Expand All @@ -39,8 +36,8 @@ Running GUI with

May be required to explicitely specify python version, i.e. use ``pip3`` and ``python3`` in above commands.

Binding with MSTM
^^^^^^^^^^^^^^^^^

### Binding with MSTM

MSTM-studio will search for ``mstm.x`` binary in ``~/bin`` directory.

Expand All @@ -51,13 +48,13 @@ This can be altered by setting of `MSTM_BIN` environment variable, i.e. in bash:

.. Note:: MSTM can be compiled with gfortran as::

``gfortran mpidefs-serial.f90 mstm-intrinsics-v3.0.f90 mstm-modules-v3.0.f90 mstm-main-v3.0.f90 -O2 -o mstm.x``
gfortran mpidefs-serial.f90 mstm-intrinsics-v3.0.f90 mstm-modules-v3.0.f90 mstm-main-v3.0.f90 -O2 -o mstm.x

This is serial compilation, for parallel the file ``mpidefs-serial.f90`` should be replaced. Consult the MSTM website for details.


Windows installation
--------------------
## Windows installation


The tested way is using Anaconda Python distribution <https://www.anaconda.com/>.

Expand All @@ -66,8 +63,8 @@ The tested way is using Anaconda Python distribution <https://www.anaconda.com/>
3. Check GUI by typing ``python -m mstm_studio`` in Anaconda Prompt
or check python scripting by typing ``import mstm_studio`` in python console.

Binding with MSTM
^^^^^^^^^^^^^^^^^

### Binding with MSTM

4. Obtain the MSTM binary. Put it to some folder.
5. Setup environmental variable ``MSTM_BIN`` to point on the binary.
Expand All @@ -80,50 +77,41 @@ Binding with MSTM
The easist way is to type ``echo %PATH%`` in Anaconda Promt, and use the output in your script.
Example of GUI running script is ::
```@ECHO OFF
PATH=C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\bin;C:\ProgramData\Anaconda3\condabin;%PATH%
set MSTM_BIN="C:\Users\L\Desktop\mstm_studio old\mstm-spectrum\mstm.exe"
python.exe -m mstm_studio
PAUSE```
@ECHO OFF
PATH=C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\bin;C:\ProgramData\Anaconda3\condabin;%PATH%
set MSTM_BIN="C:\Users\L\Desktop\mstm_studio old\mstm-spectrum\mstm.exe"
python.exe -m mstm_studio
PAUSE

The last command (``PAUSE``) is put to prevent console windows from closing after program is ended.


Binding with ScatterPy
----------------------
## Binding with ScatterPy

For calculation of extinction spectra of isolated non-sphericla particle ScatterPy can be used. This library is available on github <https://github.com/TCvanLeth/ScatterPy> and PiPy repository.

Installation from PyPi: ``pip install mstm_studio``


ScatterPy without Numba
^^^^^^^^^^^^^^^^^^^^^^^
### ScatterPy without Numba

ScatterPy requires Numba library for speeding up the calculation. However, it is possible to install without Numba:

1. Download scatterpy source code
2. Edit file ``scatterpy/special.py``:
Remove line

``import numba as nb``

and add lines:

``` try:
import numba as nb
except ImportError:
print('WARNING: Numba support is disabled in ScatterPy')
```

```diff
calculations.
"""
-import numba as nb
import numpy as np
from scipy import special
+try:
+ import numba as nb
+except ImportError:
+ print('WARNING: Numba support is disabled in ScatterPy')
# special mathematical functions
def sph_jn(n, z):
}
```

3. Build and install: ``python setup.py install``
3. Build and install: ``python setup.py install`` (Needed setuptools and may be other dev packages)


0 comments on commit 6d6504f

Please sign in to comment.