Introduction¶
PyWI CTA - A CTA wrapper for PyWI¶
Copyright (c) 2016-2018 Jeremie DECOCK (www.jdhp.org)
- Online documentation: https://jeremiedecock.github.io/pywi-cta/
- Source code: https://github.com/jeremiedecock/pywi-cta
- Issue tracker: https://github.com/jeremiedecock/pywi-cta/issues
- PyWI-CTA on PyPI: https://pypi.org/project/pywicta/
- PyWI-CTA on Anaconda Cloud: https://anaconda.org/jdhp/pywicta
Dependencies¶
PyWI-CTA has the following strict requirements:
PyWI-CTA also depends on other packages for optional features:
- Scipy
- Scikit-image
- Pillow (a.k.a. PIL) to read and write many image formats (PNG, JPEG, TIFF, …)
- Astropy to provide Fits file format
- Pandas
- Matplotlib 1.5 or later to provide plotting functionality
- PyWI
- Cosmostat iSAP Sparce2D
However, note that these only need to be installed if those particular features are needed. pywicta will import even if these dependencies are not installed.
Installation¶
PyWI-CTA and its dependencies may be installed using the Anaconda or Miniconda package system. We recommend creating a conda virtual environment first, to isolate the installed version and dependencies from your master environment (this is optional).
The following command will set up a conda virtual environment, add the necessary package channels, and download PyWI-CTA and its dependencies. The file environment.yml can be found in this repository. Note this is beta stage software and is not yet stable enough for end-users (expect large API changes until the first stable 1.0 release).
conda env create -n pywi-cta -f environment.yml
source activate pywi-cta
pip install pywicta --no-deps
If you have already installed ctapipe following the official installation procedure, you can add PyWI-CTA to the cta virtual environment like this:
source activate cta
pip install pywicta --no-deps
Developers should follow the development install instructions found in the documentation.
Note
As ctapipe is not tested to work on Microsoft Windows systems, PyWI-CTA does not officially support these systems neither.
Note
The --no-deps
flag is optional, but highly recommended otherwise pip
will sometimes try to “help” you by upgrading PyWI-CTA dependencies like
Numpy, which may not always be desired.
Cosmostat iSAP Sparce2D installation¶
Download http://www.cosmostat.org/wp-content/uploads/2014/12/ISAP_V3.1.tgz (see http://www.cosmostat.org/software/isap/)
Unzip this archive, go to the “sparse2d” directory and compile the sparse2d library. It should generate two executables named
mr_transform
andmr_filter
:tar -xzvf ISAP_V3.1.tgz cd ISAP_V3.1/cxx tar -xzvf sparse2d_V1.1.tgz cd sparse2d compile the content of this directory
An automated compilation and installation script for Linux is available here (author: Tino Michael).
Example¶
Get a simtel file (e.g. from there)
In your system terminal, from the directory that contains the sample image, type the following commands (where SIMTEL_FILE is the path to your simtel file):
pywicta-mrtransform -f common_hard_filtering -t 13.,1.5 -L mask --camid LSTCam --max-images 1 --plot SIMTEL_FILE pywicta-mrfilter -K -k -C1 -m3 -n4 -s2,4.5,3.5,3 --kill-isolated-pixels --camid LSTCam --max-images 1 --plot SIMTEL_FILE
Type
pywicta-mrtransform -h
orpywicta-mrfilter -h
to display the list of available options and their documentation.
IPython/Jupyter Notebooks¶
PyWI provide some Jupyter notebooks that can be used as examples or tutorials.
- PyWI Notebooks on GitHub: https://github.com/jeremiedecock/pywi-cta-notebooks
- PyWI Notebooks on Anaconda Cloud: https://anaconda.org/jdhp/notebooks