Installation¶
There are two ways to install selectionfunctions. If you are familiar with the installation of the dustmaps module,
then this will be familiar.
1. Using pip¶
From the commandline, run
pip install selectionfunctions
You may have to use sudo.
Next, we’ll configure the package and download the selection functions we’ll want to use. Start up a python interpreter and type:
from selectionfunctions.config import config
config['data_dir'] = '/path/to/store/maps/in'
import selectionfunctions.cog_ii
selectionfunctions.cog_ii.fetch()
All the selection functions should now be in the path you gave to
config['data_dir']. Note that these selection functions can be very large - some
are several Gigabytes! Only download those you think you’ll need.
2. Using setup.py¶
An alternative way to download selectionfunctions, if you don’t want to use
pip, is to download or clone the respository from
https://https://github.com/gaiaverse/selectionfunctions.
In this case, you will have to manually make sure that the dependencies are satisfied:
numpyscipyastropyh5pyhealpyrequestssixprogressbar2
These packages can typically be installed using the Python package manager,
pip.
Once these dependencies are installed, run the following command from the root
directory of the selectionfunctions package:
python setup.py install --large-data-dir=/path/to/store/maps/in
Then, fetch the selection functions you’d like to use. Depending on which selection functions you choose to download, this step can take up several Gigabytes of disk space. Be careful to only download those you think you’ll need:
python setup.py fetch --map-name=cog_ii
That’s it!