Access via Python module

In this section a 'Jupyter Notebook' is provided as an example of use of the different python methods available at the "esa-hreda" module.


Python installation

The Jupyter Notebook App is a server-client application that allows editing and running notebook documents via a web browser. The Notebook App can be executed on a local desktop requiring no internet access or can be installed on a remote server and accessed through the internet. Jupyter Notebook App is included in the Anaconda distribution so we recommend to install also this product to work with the HREDA python wrapper even though it is not mandatory.

Software configuration

Prerequisites: Jupyter and node.js

Jupyter comes together with anaconda. Anaconda can be downloaded from here (With Python 3.7 Version) .

Node.js can be downloaded from: here and install it directly.


If you use conda, you can get 'Node.js' with:

 $ conda install -c conda-forge nodejs

If you use Homebrew on Mac OS X:

 $ brew install node 

Python libraries installation

Once that Anaconda and Node.js is installed, it is necessary to open a console and install the following Python packages (If they haven't been installed already):

Astroquery:
 $ pip install astroquery

By default the last version of astroquery is not provided. For HREDA, the latest version pf 'TapPlus' library is required. This library 'TapPlus' is provided as part of the package "Astroquery". In order to upgrade 'Astroquery' to the latest version, please execute the following command:

 $ conda install -c astropy astroquery 

Pytest:
 $ pip install pytest 
Ipywidgets:
 $ pip install ipywidgets 
IPython: 
 $ pip install ipython 

Now you can install the HREDA python module



HREDA python module: download and installation

HREDA python module: DOWNLOAD (Use "Save Link As").

Once downloaded, the installation of this package into a python environment is very simple:
From here on, the HREDA TAP server can be accessed through this wrapper as described in the following Jupyter notebook.


Jupyter notebook

The Jupyter notebook below provides a quick guide of the HREDA python module functionality through several examples. At the moment, there is two notebook prepared: One for the generic experiments, and another one for the DDCMIX experiment.


In order to open the notebook, at the command line execute:

 $ jupyter-notebook

The Jupyter Notebook will be opened in a browser. Note that the files downloaded from the notebook will be stored at the directory from where the notebook was launched.

Remember that it is also possible to launch the Jupyter notebook directly from the Anaconda application.