Installation and Setup

The installation of NIPS2.0 is straight forward and does not require any extra package installations besides the associated library package from the ESA development team (nrspylib). All packages will be automatically installed when installing nips and nrspylib using mostly PyPI (pip), however some missing packages might need to be installed later using anaconda. For that reason it is recommended using anaconda environments.

Working in bash

As Anaconda is bash based, the terminal needs to be set to bash shell. If this is not the case on your system please run:

> /bin/bash
> source ~/.bash_profile

before going any further.

Note

It might be that your bash profile file is named differently such as .bashrc or .profile.

Installing Conda

The first step in installing NIPS2.0 is to have a running version of Anaconda. You can check if you have Anaconda install by typing:

> which conda

If Anaconda is already in use on the computer where NIPS2.0 will be installed, this step can be skipped. If not, proceed as follow:

Go to the Anaconda download page and download the Anaconda Python 2.7 version. If you want to read more about Anaconda itself please have a look at the Anaconda documentation page.

Update Conda

Note

Before you continue: If you have the astroconda installation set up, make sure that you deactivate this environment first (source deactivate)

> conda update conda

Setting the Conda Environment

So set a new empty conda environment one simply runs:

> conda create --name nips python=3.6

Once this is done you have to activate the environment.

> source activate nips

Note

Remember to always work in bash and to activate the nips environment before doing anything pipeline related. Every time you open a new terminal window, your environment will go back to your default and you have to activate it again.

Obtaining and Installing NIPS2.0

To obtain the NIPS2.0 package one has to check out the new svn repository. It also contains the nrspylib package that is use by NIPS. To check out the svn, go to the folder where the svn should be created (do not install it in the same directory - Library/Software - as the old svn!) and type:

> svn checkout --username <USERNAME> https://svn.cosmos.esa.int/svn/JWST-NIRSPEC_REPOS/

Warning

If you are getting an error looking like this:

Error validating server certificate for ‘https://svn.cosmos.esa.int:443’:

  • The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually!

Certificate information:

  • Hostname: tools.cosmos.esa.int

  • Valid: from Wed, 25 Jul 2018 00:00:00 GMT until Thu, 25 Jul 2019 23:59:59 GMT

  • Issuer: COMODO CA Limited, Salford, Greater Manchester, GB

  • Fingerprint: b9:2f:ca:bd:7d:92:3b:7d:8a:5f:7e:30:b2:83:54:c1:2b:cf:58:61 (R)eject, accept (t)emporarily or accept (p)ermanently?

Press “p” to accept the new certificate permanently.

Now enter the nrspylib directory, make sure that you are still in the nips environment and type

> cd JWST-NIRSPEC_REPOS/nrspylib
> sudo python setup.py install

Note

This will install also additional packages (such as astropy, scipy) that are required by the package via pip.

then enter the nips directory and do the same.

> cd JWST-NIRSPEC_REPOS/nips
> sudo python setup.py install

This should install both packages on your computer (in the nips environment). You can test if it worked by opening a python console somewhere outside of those folders and see if you can import those packages:

> import nips
> import nrspylib

If all of this works, you are done installing NIPS and if you are located at either ESTEC or STScI you don’t have to look into the next step.

Setting up a local Archive

For the big archives at ESAC and on Jpro at STScI, the archive databases are already set up. This is step is just necessary when it is desired to have a local archive or an archive from a hard drive to interact with the pipeline.

In the same directory as the example scripts (nips/examples), there is a script called p_prepare_archive_database.py. Run this script with the appropriate paths and it should set up a database in the desired archive. This only has to be done once:

> python p_prepare_archive_database.py <Name of archive folder> --path <path to archive folder>

So for example:

> python p_prepare_archive_database.py Archive --path /Volumes/CT1/

Updates

If you want/need to update the software in your conda environment this is the way to do it:

> conda update conda
> conda update -n nips --all

If there has been a change in the nips software in the svn (you would usually receive an email for this) you need to update the svn:

> cd JWST-NIRSPEC_REPOS
> svn update

And re-install nips (or sometimes also nrspylib, this depends on what was altered):

> cd JWST-NIRSPEC_REPOS/nips
> sudo python setup.py install

Need Help? Report a bug?

Go to the Mantis Ticketing Page and click on Report Issue. The project to select would be “nips python3.x”.