SDSS_Catl_Utils Documentation¶
SDSS_Catl_Utils
is a specialized python package for downloading and
analyzing catalogues of galaxies and dark matter haloes. The core
functionality of the package includes:
- Easy interface to download desired galaxy catalogues from Calderon et al. (2019)
- A modular, object-oriented framework for handling the galaxy catalogues.
- End-to-end support for reducing galaxy catalogues and caching them as fast-loading hdf5 files.
The source code is freely available at https://github.com/vcalderon2009/sdss_catl_utils
Getting Started¶
Package Installation¶
Ther are different ways to install SDSS_Catl_Utils
. The preferred way
to install it is through pip. Another possibility
is to install the package through the source code by cloning
the repository from Github
and build from the source code.
pip
Installation¶
The simplest way to install SDSS_Catl_Utils
is with pip
.
To install it with pip
pip install sdss_catl_utils
This will install the latest official release of the code.
Upgrading via pip
¶
Whenever there is a new release, you can upgrade your current version by running
pip install --upgrade sdss_catl_utils
This will ensure that you have the most up-to-date version of
SDSS_Catl_Utils
.
Note
Consider installing sdss_catl_utils
into a virtual environment.
Setting this up is completely straightforward and takes less than
a minute, even if this is your first time using a virtual environment.
Using a virtual environment simplifies not just the current installation
but also package upgrades and your subsequent workflow.
If you use conda
to manage your python distribution, you can find explicit instructions
in the Installing SDSS_Catl_Utils using a virtual environment
section of the documentation.
Building from Source¶
If you don’t install the latest release using pip
, you can instead
clone
the source code and call the setup file.
This is the most common way to install SDSS_Catl_Utils
if you want
versions of the code that have been updated since the last latest
official release. In this case, after installation, it is particularly
important that you follow the instructions in Verifying your installation
section bellow.
The first step is to clone the SDSS_Catl_Utils
repository
git clone https://github.com/vcalderon2009/sdss_catl_utils
cd sdss_catl_utils
Installing one of the official releases¶
All oficial releases of the code are tagged with their version name,
e.g. v0.1.0
pertains to the 0.1.0
release.
To install a particular release
git checkout v0.1.0
python setup.py install
This will install the v0.1.0
release of the SDSS_Catl_Utils
.
Other official release version can be installed similarly.
Installing the most recent master branch¶
If you prefer to use the most recent version of the code
git checkout master
python setup.py install
This will install the master
branch of the code, which is
the branch currently under development. While the features in the
officiail releases have a stable API, new features being developed
in the master
branch may not. However, the master branch may have
new features and/or perfomance enhancements that you may wish to use
for your science applications. A concerted effort is made to ensure
that only thoroughly tested and documented code appears in the public
master
branch, though SDSS_Catl_Utils
users should be awayre
of the distinction between the bleeding edge version in master
and the official release version available through pip
.
Dependencies¶
If your install sdss_catl_utils
using pip, then most of your dependencies
will be handled for you automatically. The only additional dependency
you may need is:
- h5py : 2.5 or later
The h5py package is used for fast I/O of galaxy and group catalogues.
If you did not use pip, then you should be aware of the following strict requirements:
- Python: 3x or higher
- Numpy
- Astropy
- Pandas
- h5py
- GitPython
- Cython
- requests
- numexpr
- Scipy
- Scikit-Learn
- BeautifulSoup
- wget
- tqdm
- cosmo-utils
Any of the above can be installed with either pip
or conda
.
Verifying your installation¶
After installing the code and its dependencies, fire up a Python interpreter and check that the version number matches what you expect:
>>> import sdss_catl_utils
>>> print(sdss_catl_utils.__version__)
If the version number is not what it should be, this likely means you have a
previous installation that is superseding the version you tried to install.
This should be accomplished by doing pip uninstall sdss_catl_utils
before your new installation, but you may need to uninstall the previous
build “manually”. Like all python packages, you can find the installation
location as follows:
>>> import sdss_catl_utils
>>> print(sdss_catl_utils.__file__)
This wil show where your active version is located on your machine. You
can manually delete this copy of SDSS_Catl_Utils
prior to your new
installation to avoid version conflicts. (There may be multiple copies
of SDSS_Catl_Utils
in this location, depending on how many times
you have previously installed the code - all such copies my be deleted
prior to reinstallation).
Importing SDSS_Catl_Utils¶
In order to encourage consistency amongst users in importing and using SDSS_Catl_Utils
functionality, we have put together the following guidelines.
Since most of the functionality in SDSS_Catl_Utils
resides in sub-packages, importing
astropy as:
>>> import sdss_catl_utils
is not very useful. Instead, it is best to import the desired sub-package with the syntax:
>>> from sdss_catl_utils import subpackage
Quickstart Guides and Tutorials¶
This section of the documentation contains both quickstart guides and detailed usage-tutorials. If you are instead looking for a quick reference to the API of some class or function, try looking in Comprehensive SDSS_Catl_Utils Reference/API.
Quickstart Guides¶
Getting started with SDSS_Catl_Utils¶
This 10-minute guide gives an overview of the functionality of
SDSS_Catl_Utils
and each of its subpackages.
Downloading suite of galaxy catalogues¶
Downloading and caching Galaxy- and Group-galaxy catalogues¶
This section of the documentation describes how to get up
and running with the galaxy and group-galaxy catalogues
provided by SDSS_Catl_Utils
. To see if SDSS_Catl_Utils
provides the catalogues that you need, check Calderon et al. (2018).
SDSS_Catl_Utils
provides a handful of homogeneously processed
galaxy and group galaxy catalogues and associated group membership
data. These catalogues have been prepared into a standard form,
and so once they are downloaded they will be directly added to your
cache and can immediately be used for your science applications.
The class responsible for downloading and caching these catalogues
is DownloadManager
.
What’s New?¶
What’s new in SDSS_Catl_Utils 0.0.1¶
This was the initial version of SDSS_Catl_Utils
released on
December 11, 2018.
SDSS_Catl_Utils
0.0.1 integrated functions and submodules under
a single SDSS_Catl_Utils
package with a unified installer.
Major Release History¶
What’s new in SDSS_Catl_Utils 0.0.2¶
SDSS_Catl_Utils
v0.0.2
is now available for installation with pip
.
New features are summarized below. See Full Changelog for details on
smaller issues and bug-fixes. See Major Release History for full
release history information.
New Utility Functions¶
Models¶
A new module models
contains the set of models
pertaining to previous/current analysis performed that have used
the set of galaxy and group catalogues presented here.
There set of new functions include:
These functions allow for the downloading and handling of the galaxy and group catalogues.
Catalogue Utils¶
- New functionality was added to the
catl_utils
that allows for an recovery and extraction of the data in the galaxy/group catalogues.
What’s new in (unreleased) SDSS_Catl_Utils 0.0.3¶
SDSS_Catl_Utils
v0.0.3
is currently under development. The latest
release is v0.0.2
, which can now be installed with pip. New features
currently be developed for future release v0.0.3
are summarized below.
See Major Release History for full release history information.
Full Changelog¶
0.0.32 (2019-02-11)¶
- Updated function
CatlUtils
and a problem with itscatl_merge
function
0.0.31 (2019-02-08)¶
- Added new functions to
catl_utils
0.0.3 (2019-01-21)¶
- Added new parameter
sigma_clf_c
, which corresponds to the scatter inlog(L)
for central galaxies in theconditional luminosity function
(CLF). The affected functions were: -DownloadManager
-catl_utils
-check_input_params
- and more.
0.0.2 (2018-12-29)¶
- Added new functions to download catalogues to
DownloadManager
. It allows for the download of catalogues of specific characteristics. - Added new function
CatlUtils
that acts as a tool for handling the synthetic catalogues. - Added functions
catl_keys
andcatl_keys_prop
to facilitate the handling of the catalogues. - Added unit-testing for
catl_utils
module. - Added more functions for
catl_utils
module (catl_prefix_main
,check_input_params
) - Added classes for the
Conformity (
SDSSConformity
), ML (SDSSMLAnalysis
), and Catl (SDSSCatlAnalysis
) analyses.
0.0.1 (2018-12-11)¶
- Initial release
Project Details¶
Authors and Credits¶
SDSS_Catl_Utils
Coordinators¶
- Victor Calderon (victor.calderon@vanderbilt.edu )
Licenses¶
SDSS_Catl_Utils License¶
SDSS_Catl_Utils
is licensed under a 3-clause BSD style license:
Copyright (c) 2018, Victor Calderon All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the Astropy Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Other Licenses¶
Full licenses for third-party software SDSS_Catl_Utils
is derived from
or included with SDSS_Catl_Utils
can be found in the 'licenses/'
directory of the source code distribution.
Comprehensive SDSS_Catl_Utils Reference/API¶
sdss_catl_utils Package¶
Classes¶
SDSSCatlUtils_Error (message) |
Base class of all LSS_Utils-specific exceptions |
UnsupportedPythonError |
Class Inheritance Diagram¶
sdss_catl_utils.mocks_manager Package¶
The mocks_manager
sub-package is responsible
for downloading galaxy and group galaxy catalogue data, storing hdf5
binaries and keeping a persistent memory of their location on disk
and associated metadata.
sdss_catl_utils.mocks_manager.catl_utils Module¶
Functions¶
catl_keys ([catl_kind, perf_opt, return_type]) |
Provides a dictionary/list with the corresponding keys for 1) halo mass, 2) Haloid/GroupID, 3) Group/Halo Galaxy-Type. |
catl_keys_prop ([catl_kind, catl_info, …]) |
Provides a dictionary/list with the corresponding keys for 1) specific star formation rate (sSFR) and 2) stellar mass. |
catl_clean (catl_pd, catl_kind[, catl_info, …]) |
Cleans and removes the bad rows, i.e. |
catl_clean_nmin (catl_pd, catl_kind[, …]) |
Cleans and removed the bad rows with failed values, i.e. |
catl_prefix_str ([catl_kind, hod_n, …]) |
Prefix string for the combination of input parameters that describe a set of catalog(s). |
catl_prefix_path ([catl_kind, hod_n, …]) |
Prefix of the paths based on the type of catalogues and input parameters chosen. |
catl_prefix_main ([catl_type, catl_kind, …]) |
Prefix of the paths based on the type of catalogues and input parameters chosen. |
check_input_params (input_var, var_name[, …]) |
Checks the type and/or values for different variables. |
sdss_catl_utils.models Package¶
The models
sub-package is responsible
for downloading galaxy and group galaxy catalogue data, storing hdf5
binaries and keeping a persistent memory of their location on disk
and associated metadata.
sdss_catl_utils.models.catl_models Module¶
Classes¶
DownloadManager (**kwargs) |
Class used to scrape the web for galaxy and group galaxy catalogue data and cache the downloaded catalogues. |
CatlUtils (**kwargs) |
Class used to handle the galaxy/group galaxy/group catalogues, after the catalogues have been downloaded. |
SDSSConformity () |
Class used to handle the galaxy/group catalogues for the Calderon et al.(2018) analysis. |
SDSSCatlAnalysis () |
Class used to handle the galaxy/group catalogues for the Calderon et al.(2019) analysis. |
SDSSMLAnalysis () |
Class used to handle the galaxy/group catalogues for the Calderon et al.(2019) analysis. |
Class Inheritance Diagram¶
sdss_catl_utils Documentation¶
This is the documentation for sdss_catl_utils.
Reference/API¶
sdss_catl_utils Package¶
Classes¶
SDSSCatlUtils_Error (message) |
Base class of all LSS_Utils-specific exceptions |
UnsupportedPythonError |