Skip to main content

Public Subset of Analysis Software Developed by the SPT-3G Collaboration

Project description

https://badge.fury.io/py/spt3g.svg https://github.com/CMB-S4/spt3g_software/actions/workflows/cmake.yml/badge.svg https://github.com/CMB-S4/spt3g_software/actions/workflows/wheels.yml/badge.svg

About

This repository contains the public portions of the analysis software developed by the SPT-3G collaboration. It includes the IO libraries, data acquisition code for McGill’s DfMux readout boards, pipeline glue code, a binned map-maker, and a sky mock-observer, as well as defining all the APIs used by the project. For more detail on the intended processing architecture, please see the Quick Start chapter of the documentation.

Except where otherwise noted, all files are distributed under the 2-clause BSD license. Acknowledgments and patches are appreciated.

Documentation

The main documentation for the software is in the docs folder. After building the software, you can build a pretty, searchable copy by running make docs.

Dependencies

This depends on Boost and cmake, as well as the usual Python packages. Some additional packages (NetCDF, in particular) will activate optional components of the code if installed. You also need a C++11 compiler. This software is designed to run and work on a variety of operating systems (all Linuxes, Mac OS X, and FreeBSD) and architectures (at least 64-bit x86 and POWER).

Minimum versions:

  • GCC >= 5.0 or clang >= 3.4

  • Boost >= 1.48

  • cmake >= 3.12

  • Python >= 2.7 (although pre-Python-3 support is best-effort)

On Ubuntu/Debian, you can install the non-Python dependencies, including the optional ones, by doing:

apt-get install cmake libboost-all-dev libflac-dev libnetcdf-dev

On RHEL-type systems (SL, CentOS, etc.), do this:

yum install cmake netcdf-devel boost-devel flac-devel

If your system defaults to Python 2, but you wish to use Python 3, please do the following:

  1. Install Python 3 from the system package manager

  2. Make sure the python-3 version of the Boost library is installed (on Ubuntu, this is part of the standard boost-python package referenced above)

  3. When you run cmake below, pass -DPython_EXECUTABLE=`which python3`

On any system, this software requires numpy and scipy (hard requirements), plus astropy and healpy (optional).

Setup on RHEL6

Note that on any RHEL6 system, you will need a newer compiler than ships with the OS. Please follow whatever directions apply at your site to achieve this. Alternately, if you have OASIS set up on your local system, run this before anything else (also works on several other operating systems, including RHEL7):

eval `/cvmfs/spt.opensciencegrid.org/py3-v4/setup.sh`

How to Build

To build:

cd spt3g_software
mkdir build
cd build
cmake ..
make

This will collect all of the necessary python tools into the build/spt3g directory, which can then be imported in python. To set the appropriate python environment without installing the python package, use the shell script in build/env_shell.sh to run commands that know where to find the spt3g package and libraries:

./env-shell.sh python my_script.py  # to run a python script
./env-shell.sh ipython  # to start an ipython session

Alternatively, for users that only use a single build environment, set the following environment variables (e.g. in your .bash_profile file):

export SPT3G_SOFTWARE_BUILD_PATH=path/to/spt3g_software/build
export PYTHONPATH=$SPT3G_SOFTWARE_BUILD_PATH:$PYTHONPATH
export LD_LIBRARY_PATH=$SPT3G_SOFTWARE_BUILD_PATH/lib:$LD_LIBRARY_PATH
export PATH=$SPT3G_SOFTWARE_BUILD_PATH/bin:$PATH

To build the documentation in the build directory type:

./env-shell.sh make docs

This will construct an html version of the documentation. This builds the documentation in the build/docs folder. Open build/docs/index.html in your favorite web browser. You should at least read the quick start portion of the documentation before getting started.

Installation

For various reasons it may be useful to install the software after building, instead of continuing to use it out of the build directory. Several CMake variables control how the software is installed:

  • WITH_BZIP2, which defaults to TRUE, is used to control whether the core library is built with support for bzip2 compression of G3 files. Use -DWITH_BZIP2=FALSE when calling cmake to disable.

  • CMAKE_INSTALL_PREFIX, which defaults to /usr/local is used as the root directory for installing all non-python components (header files, cmake export scripts, etc.). This variable is frequently useful when installing into a python virtual environment.

  • CMAKE_BUILD_PARALLEL_LEVEL is an environment variable (not a cmake option) used to control how many parallel processes are used to compile the shared libraries. This option provides the same behavior as running make with the -j flag (e.g. make -j4).

Installation with Pip

Use pip to install the python package. Ensure that you use the appropriate options as necessary for your installation, e.g. --user or --prefix.

For pre-built wheels hosted on PyPI, available for most Linux x86_64, macOS x86_64 and macOS arm64 platforms, simply install the package without any additional options:

pip install spt3g

The hosted wheels will include the necessary libraries (Boost, etc) bundled with the package. Otherwise, ensure that the dependency libraries are installed as explained above, and processed to one of the following steps.

To install the package from the github repo, run pip as usual (this may take a while, so consider setting the CMAKE_BUILD_PARALLEL_LEVEL environment variable):

cd spt3g_software
CMAKE_BUILD_PARALLEL_LEVEL=4 pip install -v .

By default this will create a directory called build in the repo and run the cmake build from there. The build directory location can be changed by setting the BUILD_DIR environment variable, but keep in mind that pip requires that the build directory must be a path inside the repo file tree. For development builds, use the --editable option to assemble the python package from the appropriate compiled extensions and python directories:

cd spt3g_software
CMAKE_BUILD_PARALLEL_LEVEL=4 BUILD_DIR=build pip install -v --editable .

An editable build adds references to the python directories to your python path, so that edits to library python files are immediately reflected in a fresh python session.

To pass arguments to the cmake build system, use the CMAKE_ARGS environment variable with arguments separated by spaces. For example:

cd spt3g_software
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_MODULE_PATH=/usr/local/share/cmake" pip install -v --prefix=/usr/local .

To run the test suite on the compiled package, you must have cmake, and in particular the ctest utility, available on your path. You must also know the location of the build directory where the cmake build was assembled (e.g. the value of $BUILD_DIR above).

ctest --test-dir path/to/spt3g_software/build --output-on-failure

Release Version Tracking

Use git tags to keep track of release versions. Tags should be of the form “v0.1.2” for release with major version 0, minor version 1 and patch version 2. If such a tag is defined, cmake will populate the following outputs:

  • A cmake/Spt3gConfigVersion.cmake file that contains the version number to be checked when including the Spt3g libraries in another cmake project

  • A spt3g/version.py file containing VCS parameters for access in python and stored in PipelineInfo frames

  • Add a SPT3G_VERSION compiler definition for accessing the version string in C++ code

Use the git archive command or the Python build package to export the source tree to a standalone archive.

Version Control Hygiene

You can use two mechanisms to access the repository: git and SVN. The following is a brief overview of how to use these in a way that your collaborators will appreciate.

Git

To initially check out the repository:

git clone https://user@github.com/CMB-S4/spt3g_software.git

To update your checkout (the –rebase is important, especially if you have local changes):

git pull --rebase

To send your changes back:

git diff files_to_commit <- Examine this
git commit files_to_commit
git push

SVN

To initially check out the repository:

svn co https://user@github.com/CMB-S4/spt3g_software/trunk spt3g_software

To update your checkout:

svn up

To send your changes back:

svn diff files_to_commit <- Examine this
svn ci files_to_commit

Project details


Release history Release notifications | RSS feed

This version

0.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spt3g-0.4.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

spt3g-0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

spt3g-0.4-cp312-cp312-macosx_14_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

spt3g-0.4-cp312-cp312-macosx_13_0_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.12 macOS 13.0+ x86-64

spt3g-0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

spt3g-0.4-cp311-cp311-macosx_14_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

spt3g-0.4-cp311-cp311-macosx_13_0_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.11 macOS 13.0+ x86-64

spt3g-0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

spt3g-0.4-cp310-cp310-macosx_14_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

spt3g-0.4-cp310-cp310-macosx_13_0_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.10 macOS 13.0+ x86-64

spt3g-0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

spt3g-0.4-cp39-cp39-macosx_14_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

spt3g-0.4-cp39-cp39-macosx_13_0_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.9 macOS 13.0+ x86-64

spt3g-0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

spt3g-0.4-cp38-cp38-macosx_13_0_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.8 macOS 13.0+ x86-64

File details

Details for the file spt3g-0.4.tar.gz.

File metadata

  • Download URL: spt3g-0.4.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for spt3g-0.4.tar.gz
Algorithm Hash digest
SHA256 b8995a6e87db78fe4c71e206bd4b4e4423f85c3aa36e11486991dcbabb723a96
MD5 12f7776b675b84e4e962a01d3dd3fe90
BLAKE2b-256 377f08b8f3e4329b0f6d2799e35b301312a9bbb773f893b82c07ad175aa5cc9c

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74ab96e0ff58e5121aa3326f554d7cb430f49c9330b1160173a4177084d7227b
MD5 f8848089069448f6e7c213dd20a75300
BLAKE2b-256 dd412647532aee8cc6e127403fe369621d88700d99a8eb41c3740b4968643cc4

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6593a6a31ec954d3f5bede4b77a5f4abe590d10c2cc0c245aa9b4b5e0e1078fe
MD5 399d64cbd671596041001a3538f32339
BLAKE2b-256 977e69a6ba2f280ed74eccc05d07257284db6e89d6961991cf500439017cdeb2

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4f7b5760c038ccf97e87605d4e646ac595af8cfc8dc64e86eae277929a6d0669
MD5 248a2c8dd7f1a1fe8f720f48503461bc
BLAKE2b-256 cc22fb5afbbdcc34f59e3403090f835ee842397edbb4ba24ad0a05bf4c8bab5c

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fea72e35ea090a20609bc51c64952fc75b0d778ceed25461b7e4065ffb5471f2
MD5 3b5d3a036c0c4240db330870e9fda8cd
BLAKE2b-256 c503a9822dc6f1a2721cbaa8e1b54763cdd06c6ff40561f583403d1c5dbcdb58

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 468073a8f872e25473d3877398790fba524917c9fd0a494b3dda183d4f257b1e
MD5 71cc5f246df62107c0fdfda115b14648
BLAKE2b-256 2a800e412e1cbaf573e4bb3074edd78b88aabb128c1634afae280d5e4efaea12

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 37f0a7aa0eac19c7f6eba0d08deea1df2a5a804b117a085a120e13e942aa8a15
MD5 681090bc5947406001b1f25e344e14ff
BLAKE2b-256 a78f78ad02e14698bb016e8033371cb851e9a7ea86ad06ee9582c8e3e51f93ad

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33f83f10f4816daee41de789e56b2390534036d78f8cf868857586ac28b81c56
MD5 f09d0f248d8f50880512efc42bac6dc8
BLAKE2b-256 da7f2ec5fc9843516fa27f22fbdc962a68cf2a61a78a05be09d8254532f40e86

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fbe1228c0200025d27c6f395116c6564b4d6a4ed3af3f4825cebfb3d7e1fecca
MD5 8d8878834561c9efedf55211bd3c8654
BLAKE2b-256 dff853c150dfe4bd2885598a3302e76b360ce053cfa41015b8e0fbd2e621b5c9

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 364a8b02bb5cd616cfb3a8cded104bfc771a5f3a543989e8d2fd6d54e4f56de4
MD5 3949b192fa05591fa8d9947632139c24
BLAKE2b-256 4f8519da3ad5296d6dff78fec5b8678730a46ba94d860dc2909dd7680198953e

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 efd36cb8d6ae068e75bae9e51999101e96ee5bb2a0dd1350d9f684e88c4eb24e
MD5 cbfee9717affdd0a011f2bd8b619917b
BLAKE2b-256 fbc24ac795c93a3595e2245ea21839947dad33e9d346d3d5a0c7a85e52684f8e

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0d411efaf3b7a16a7344b7b77fa410d699e4ada033eee1b561b30934d9ebf1ce
MD5 388d18113b35927588880dd144f20881
BLAKE2b-256 789ab87138ea6bafa0d8d91a0ffb22657c90eef75b1f6ab9206d4cd335400955

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c4e2272358e27b03734047c242ad12ce363f48a3bd7abf36e59e7c0eadc2d54d
MD5 a3d8a4f3880aa27ee7d918d0b4b4dd38
BLAKE2b-256 b649742920344fcd25f6c991acfb73c7b5837f049a5c6cbe76a08063234be2dc

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6cca73b9edab688f2f54077468c538bbb4bd35db4e34d747e455c438902c840e
MD5 5650f57ae6386854c0dda245fa523d4a
BLAKE2b-256 07c434917b2137895eaac26b25e1d6ab26e3c153070e6e56f4129982fc452ab9

See more details on using hashes here.

File details

Details for the file spt3g-0.4-cp38-cp38-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-0.4-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fb742d62ac118deedf14b50dcbc82b33d6840ce5d42fab7f634ed7839b1a7a5d
MD5 e958fbab9193e8e9bf741b2405e2e598
BLAKE2b-256 ae9f0834a061fa89ae8c136d02ff2e0ee30b95d018e409f25069b89de76d13c5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page