Commit a919e38f authored by Vigeesh Gangadharan's avatar Vigeesh Gangadharan
Browse files

Add Docker usage, update readme

parent 2580a788
Pipeline #2354 passed with stage
in 3 minutes and 2 seconds
......@@ -7,7 +7,42 @@ The manual for the original code can be found here: [manual_vfisv](https://gitla
This is an implementation of VFISV code to facilitate a seamless processing of the data provided by the SDC.
## Requirements
## Implementation
The current implementation of the pipeline is a modified version of VFISV code to work with the GRIS data. The GRIS L1 header and Stokes data is extracted
using a Python core module and sent to a bare VFISV via an MPI intercommunicator. The inversion is performed using VFISV
and the buffer with the inversion results is communicated back to the Python module. The Python module propagates the
keywords from L1 and packages the inversion results and outputs a FITS file (when used as a command-line interface) or
returns an NDarray (when called within a script).
## Install and usage
You can either use Docker or install it natively.
### 1. Using Docker
Got to the directory where the data files (`level1split`) are located.
```shell
docker run -it --rm -v $PWD:/home/grisuser ghcr.io/vigeesh/sdc-grisinv
```
This is pull/run the latest image from the container repo.
Now, within the Docker shell
```shell
mpiexec -n 1 vfisv \
--path='data/' \
--id=3 \
--line=15648.514 \
--numproc=20 \
--width=1.8 \
--out='output.fits'
```
### 2. Native installation
#### Requirements
It is highly recommended to install the pipeline in a new `conda` environment. <br>
......@@ -31,7 +66,7 @@ conda create -n gris_env -c conda-forge mpi4py numpy scipy gfortran_linux-64 lap
conda activate gris_env
```
## Installation
#### Installation
You can install the pipeline code from the GitLab repo directly using `pip`
```
pip install git+https://gitlab.leibniz-kis.de/sdc/grisinv.git
......@@ -44,14 +79,11 @@ python setup.py install
```
This builds the code and installs the command-line tool (`vfisv`) and in your `conda` environment.
Set the `LD_LIBRARY_PATH` so that the MPI libraries provided by conda takes precedence.
```shell
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
```
## Implementation
The current implementation of the pipeline is a modified version of VFISV code to work with the GRIS data. The GRIS L1 header and Stokes data is extracted
using a Python core module and sent to a bare VFISV via an MPI intercommunicator. The inversion is performed using VFISV
and the buffer with the inversion results is communicated back to the Python module. The Python module propagates the
keywords from L1 and packages the inversion results and outputs a FITS file (when used as a command-line interface) or
returns an NDarray (when called within a script).
## Help
......@@ -73,11 +105,6 @@ Options:
### Command line utility
First, set the `LD_LIBRARY_PATH` so that the MPI libraries provided by conda takes precedence.
```shell
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
```
To run the VFISIV inversion on multi-processor, you can either call `mpiexec` with one processor
and set the `--numproc` to the required number of processors to run the inversion on.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment