Welcome to pyPipe3D’s documentation!

Introduction

This is the documentation of pyPipe3D (Lacerda et al. in prep), a Python implementation of the FIT3D + Pipe3D package (Sanchez et al. 2016 a, b). pyPipe3D is a spectroscopy analysis package which produces coherent, easy to distribute and compare, parameters of the stellar populations and the ionized gas. In addition, this package includes an analysis pipeline (see pyPipe3D’s pipeline of IFS data cube analysis) suited in particular for IFS data cubes from the most recent optical IFS surveys. The pipeline is build using pyFIT3D package, which is the main spectral fitting module included in this package.

Main scripts of analysis and plots are located in directory bin. The package also contains a set of examples (see Test example and Example of the pipeline procedure of analysis for a CALIFA data cube). pyFIT3D package is located with the following structure:

pyFIT3D
├── common
│   ├── __init__.py
│   ├── auto_ssp_tools.py
│   ├── constants.py
│   ├── gas_tools.py
│   ├── io.py
│   ├── stats.py
│   └── tools.py
├── __init__.py
└── modelling
    ├── __init__.py
    ├── dust.py
    ├── gas.py
    └── stellar.py

Installation

If you want to use the modules distributed in this project on your system, you will need a working installation of Python 3.7 and pip. Then you can simply run from the terminal:

$ pip install pyPipe3D

Otherwise, you can download the source code directly from the pyPipe3D’s GitLab repository:

$ git clone https://gitlab.com/pipe3d/pyPipe3D.git

This will create a directory containing the source code and data sets in pyPipe3D, then you install the packages running:

$ cd pyPipe3D
$ pyPipe3D> pip install .

As a final step, we recommend that you refresh your terminal shell. After this, you are done.

Test example

pyPipe3D includes a series of scripts which will be installed at your system after the previous steps. They add a series of algorithms for the fitting of the stellar population and the emission lines of a series of input data types (single spectrum, data cubes or RSS). The package also includes a series of scripts ready to work with FITS files (e.g. math operations, show header information on screen, create slices from a data cube, etc).

We prepare an example of the [NII] + \({\rm H}\alpha\) emission lines system spectral fit using Gaussian models. The script chosen is fit_elines.py and the example is set at sub-directory examples. The call of the script is encapsulated in a shell script. Just run:

$ pyPipe3D> cd examples
$ pyPipe3D/examples> source fit_elines_example.sh

Or, call directly the fit_elines.py script with the right inputs:

$ pyPipe3D/examples> fit_elines.py NGC5947.cen.gas.txt notebooks/Ha_NII.config none 6600 6800 2 20 5 0 0.15 fit_elines.NII_Ha.NGC5947.out

One of the perks of pyFIT3D is the reusability of the code. This helps the users to build their owns analysis python scripts (see fit_elines_example.py). An example of a python script to do this example analysis is:

 1import sys
 2from pyFIT3D.common.gas_tools import fit_elines
 3
 4def main():
 5    try:
 6        plot = sys.argv[1]
 7    except IndexError:
 8        plot = 0
 9    w_min, w_max = 6600, 6800
10    out_file = 'fit_elines.NII_Ha.NGC5947.out'
11    fit_elines(
12        'NGC5947.cen.gas.txt', 'notebooks/Ha_NII.config',
13        6600, 6800, out_file=out_file, mask_file=None,
14        run_mode='BOTH', n_MC=20, n_loops=5, scale_ini=0.15,
15        redefine_max=True, plot=plot,
16    )
17
18if __name__ == '__main__':
19    main()

Example of the pipeline procedure of analysis for a CALIFA data cube

We prepare an example of the pyPipe3D pipeline analysis of a CALIFA data cube. For the full description of the execution of the pipeline see Example of the pipeline analysis.

Contact us: pipe3d@astro.unam.mx

Indices and tables