The pylibamazed library for Subaru-PFS project.
pylibamazed is a Python package wrapping numerical algorithms for the analysis of 1D spectroscopic data of astrophysical sources.
- Estimate source category (galaxy, star or QSO)
- Classify source type (sub-classification into the source category, e.g. the spectral type of a star for the star category)
- Estimate redshift
- Provide redshift reliability
- Estimate radial velocity
- Measure fluxes of emission lines
drp_1d
has the following strict requirements:
pylibamazed
depends on following third parties:
- boost >=1.74
- cfitsio >=3.36
- gsl >=2.5
- fftw >=3.3.8
- openblas >= 0.3.19
- eigen >= 3.4.0
- lbfgspp == 0.2.0-13-g563106b
lbfgspp needs to be installed from source
Required python packages:
As root:
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum install -y git gcc-c++ make cmake3 swig boost-devel cfitsio-devel \
patchelf python36u python36u-libs python36u-devel python36u-pip
As root:
apt-get update
apt-get install -y git g++ cmake swig pkg-config libboost-all-dev libgsl-dev \
libcfitsio-dev libfftw3-dev python3 python3-pip
Activate your virtual environment as needed then install python dependencies with pip
:
pip install numpy
pip install astropy
As a user:
git clone git@github.com:Subaru-PFS/drp_1d.git
mkdir drp_1d/build
cd drp_1d/build
cmake ..
make -j 4
make install
You can specify install directory with CMAKE_INSTALL_PREFIX
(defaults to $HOME/local
).
cmake .. -DCMAKE_INSTALL_PREFIX=/my/path/local
If the thirdparties are not installed in a regular directory, you can specify the path to find thirdparties. If some thirdparties have been installed with the internal pylibamazed script, you must specify the corresponding directory as follows
cmake .. -DCMAKE_PREFIX_PATH=/my/thirdparty/directory
From drp_1d
root directory:
pip install .
From drp_1d
root directory:
cd build/
make test
As stated earlier pylibamazed depends on several third parties (refer to this section for the complete list). It is recommended to install third parties on your system using your own package manager. However, pylibamazed provides a python script to install theses thirdparties.
On ubuntu :
sudo apt install -y \
libboost-dev libboost-filesystem-dev libboost-thread-dev libboost-timer-dev libboost-program-options-dev libboost-test-dev \
libcfitsio-dev \
libgsl-dev \
libfftw3-dev \
libopenblas-dev \
libeigen3-dev \
lbfgspp
needs to be installed from source.
buildandinstallthirdparty.py [-h] [--workdir WORKDIR] [--prefix PREFIX] [-j PARALLEL] [--extra_flags EXTRA_FLAGS] [--force] [name1 ...]
Name argument corresponds to the third party name and could take the following values: [boost
| cfitsio
| gsl
| fftw
| openblas
| eigen
| lbfgspp
].
For instance, to install the fftw and cfitsio third parties into the thirdparty
directory, execute:
python tools/buildandinstallthirdparty.py fftw cfitsio
Other command line options:
--workdir
: specifies the working directory for the third party building (absolute path)
python tools/buildandinstallthirdparty.py fftw cfitsio --workdir=/tmp
--prefix
: specifies the installation directory for third parties (absolute path)
python tools/buildandinstallthirdparty.py fftw cfitsio --prefix=/usr/local
-j
: specifies the number of make jobs to run simultaneously
python tools/buildandinstallthirdparty.py fftw cfitsio -j 4
--extra_flags
: specifies extra_flag to give to the build stage of third party
python tools/buildandinstallthirdparty.py fftw cfitsio --extra_flags=
--force
: forces the library building and overwrites existing built library
python tools/buildandinstallthirdparty.py fftw cfitsio --force
In order to launch tests and see coverage, in pylibamazed folder
coverage run --source=pylibamazed -m pytest
coverage report
coverage html
Drag and drop the created index.js in your web navigator
Please send your bug reports or questions to amazed-support@lam.fr
Copyright Aix Marseille Univ, CNRS, CNES, LAM/CeSAM
This software is a computer program whose purpose is to estimate the spectrocopic redshift of astronomical sources (galaxy/quasar/star) from there 1D spectrum.
This software is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms.