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

Merge branch 'develop' into 'master'

Clean header

Closes #20, #15, #13, #1, and #2

See merge request sdc/grisinv!3
parents 204e4ba2 5ca60860
Pipeline #1190 passed with stage
in 1 minute and 35 seconds
**/*.pyc
*.ipynb
tests/__pycache__
......@@ -9,11 +9,11 @@ This is an implementation of VFISV code to facilitate a seamless processing of t
## Requirements
It is highly recommended to install the pipeline in a new `conda` environment.
If you don't have `conda` installed, check [Miniconda](https://docs.conda.io/en/latest/miniconda.html) for a minimal installer for conda.<br>
It is highly recommended to install the pipeline in a new `conda` environment. <br>
If you don't have conda installed, check [Miniconda](https://docs.conda.io/en/latest/miniconda.html) for a minimal installer for conda.<br>
To install Miniconda:
```sh
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
......@@ -25,11 +25,10 @@ We recommend, you use the conda-forge channel for installing the required packag
> Note: In the conda-forge channel, NumPy is built against a dummy “BLAS” package. <br> When a user installs NumPy from conda-forge, that BLAS package then gets <br> installed together with the actual library - this defaults to OpenBLAS ... <br> (see [Numpy Documentation](https://numpy.org/install/) for more info.)
First, create a conda environment (e.g named `gris_env`) and install the required packages from conda-forge. <br>
Next, activate the newly created conda environment and update the LD_LIBRARY_PATH so that the MPI libraries provided by conda takes precedence.
Next, activate the newly created conda environment.
```sh
conda create -n gris_env -c conda-forge mpi4py numpy scipy gfortran_linux-64 lapack
conda activate gris_env
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
```
## Installation
......@@ -39,7 +38,7 @@ pip install git+https://gitlab.leibniz-kis.de/sdc/grisinv.git
```
or clone the repo and run setup
```sh
git clone https://gitlab.leibniz-kis.de/sdc/grisinv
git clone https://gitlab.leibniz-kis.de/sdc/grisinv.git
cd grisinv
python setup.py install
```
......@@ -66,8 +65,6 @@ Options:
-n, --numproc INTEGER Number of processors to run on
-l, --line FLOAT Wavelength of the line (Angstrom)
-w, --width FLOAT Wavelength range +/- (Angstrom)
--mgram TEXT Output Magnetogram fits file
--dgram TEXT Output Dopplergram fits file
-h, --help Show this message and exit.
```
......@@ -76,6 +73,11 @@ 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 and output a Magnetogram, you can either call `mpiexec` with one processor
and set the `--numproc` to the required number of processors to run the inversion on.
......@@ -86,7 +88,7 @@ mpiexec -n 1 vfisv \
--line=15648.514 \
--numproc=20 \
--width=1.8 \
--out='Magnetogram.fits'
--out='output.fits'
```
or, call `mpiexec` directly with the required number of processors and the python core will distribute the inversion.
......@@ -96,32 +98,26 @@ mpiexec -n 20 vfisv \
--id=3 \
--line=15648.514 \
--width=1.8 \
--out='Magnetogram.fits'
```
To output both a Magnetogram and Dopplergram, use,
```sh
mpiexec -n 20 vfisv \
--path='/dat/sdc/gris/20150919/level1_split/' \
--id=3 \
--line=15648.514 \
--width=1.8 \
--mgram='Magnetogram.fits' \
--dgram='Dopplergram.fits'
--out='output.fits'
```
### Python interface
The pipeline can be also be run within a python script. To do so, you need to call the python using `mpiexec` with one processor.
```sh
mpiexec -n 1 python
```
In python:
With `example.py`:
```python
from grisinv import vfisv
inv,header = vfisv('/dat/sdc/gris/20150920/level1_split/',5,15648.514,1.8,20)
inv, header = vfisv('/dat/sdc/gris/20150920/level1_split/',5,15648.514,1.8,20)
```
you can run,
```sh
mpiexec -n 1 python example.py
```
### Displaying results
```shell
ds9 -multiframe -match frame image -lock slice image -lock frame image -single -zoom to fit output.fits
```
This Fits-File is a level2 GRIS data file. All header values are
compliant to the SOLARNET recommedations Version 1.4a found at:
http://sdc.uio.no/open/solarnet/
Additional information for GRIS can be found at:
https://doi.org/10.1002/asna.201211738
Additional information for the GREGOR telescope can be found at:
https://doi.org/10.1002/asna.201211725
Additional information about the VFISV code can be found at:
https://doi.org/10.1007/s11207-010-9515-6
All data published and curated by the Leibniz Institute for Solar
Physics (KIS) (http://www.leibniz-kis.de) can be found at:
http://sdc.leibniz-kis.de
Observation Information,POINT_ID,OBSERVER,OBS_TRGT,IOBS,NMAPS,NSTEPS
Temporal Information,DATE,DATE-OBS,DATE-BEG,DATE-END,DATE-AVG
Instrument and Processing Info,ORIGIN,OBSRVTRY,TELESCOP,INSTRUME,GRATING,CAMERA,OBSGEO-X,OBSGEO-Y,OBSGEO-Z,AWAVLNTH,AWAVMAX,AWAVMIN,WAVEUNIT
Detector Readout and Data Scaling,OBS_MODE,IMGSYS,XPOSURE,TEXPOSUR,NSUMEXP
Adaptive Optics and Derotator,AOSYSTEM,AO_LOCK,AO_NMODE,ATMOS_R0,ROTANGLE,ROTCODE,ROTTRACK
Projection and Pointing,PC1_1,PC1_2,PC2_1,PC2_2,AZIMUT,ELEV_ANG,SLITORIE,SOLAR_L0,SOLAR_P0
L2 Processing,LEVEL,FILENAME,EXTNAME,BTYPE,BUNIT,WAVELNTH,WAVE_STR,CREATOR,VERS_SW,PRSTEP1,PRPROC1,PRPARA1
Projection and Pointing,WCSNAME,WCSAXES,CTYPE1,CUNIT1,CRPIX1,CRVAL1,CDELT1,CSYER1,CTYPE2,CUNIT2,CRPIX2,CRVAL2,CDELT2,CSYER2,CTYPE3,CUNIT3,CRPIX3,CRVAL3,CDELT3,CSYER3,PC1_1,PC1_2,PC2_1,PC2_2,LONPOLE,LATPOLE,MJDREF,AZIMUT,ELEV_ANG,SLITORIE,SOLAR_L0,SOLAR_P0
Measurement Parameters,GRATANGL,SLIT_WID,STEPSIZE,STEPANGL,SLITCNTR
File Integrity,CHECKSUM,DATASUM
Provenance,HISTORY
\ No newline at end of file
Fe I,15648.514,15648.510,3.0
\ No newline at end of file
Fe I,15648.514,15648.510,3.0
Si I,10827.091,10827.089,1.5
Ca I,10838.970,10838.970,1.5
\ No newline at end of file
This diff is collapsed.
# Makefile for VFISV inversion code for double Fabry Perot data
#-------------------------------------------
# JM Borrero: Jan 20, 2020
FC=mpif90
FC=$(CONDA_PREFIX)/bin/mpif90
F90F = -c -Ofast -std=legacy #-fcheck=all -g -Wall
F77F1 = -c -Ofast -std=legacy #-fcheck=all -g -Wall
F77F2 = -c -Ofast -std=legacy #-fcheck=all -g -Wall
# For Itchy at KIS
#LIBS = -L /usr/lib64 -llapack
#Pipeline under conda
LIBS = -L $CONDA_PREFIX/lib -llapack
#LIBS = -L /usr/lib64 -lcfitsio -L /home/vigeesh/conda/envs/mpi_test/lib -llapack
#LIBS = -L /usr/lib -lcfitsio -L /usr/lib/x86_64-linux-gnu -llapack
# For Personal Laptop
#LIBS = -L /opt/mpich/lib -lmpi -L /opt/lapack-3.9.0 -llapack -lrefblas -L /usr/lib -lcfitsio
OBJ = hold.o \
time_param.o \
......
......@@ -62,7 +62,7 @@ setup(
url=URL,
license=LICENSE,
packages=find_packages(),
package_data={"grisinv": ["data_files/*.csv"]},
package_data={"grisinv": ["data_files/*.*"]},
include_package_data=True,
install_requires=install_requires,
scripts=['versioneer.py'],
......
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