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 pybind11 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

  • pybind11 >= 2.13

  • cmake >= 3.12

  • Python >= 3.7 (although pre-Python-3.8 support is best-effort)

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

apt-get install cmake libz-dev libbz2-dev liblzma-dev libflac-dev libnetcdf-dev

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

yum install cmake netcdf-devel zlib-devel bz2-devel xz-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. 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:

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_GZIP, which defaults to TRUE, is used to control whether the core library is built with support for gzip compression of G3 files. Use -DWITH_GZIP=FALSE when calling cmake to disable.

  • 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.

  • WITH_LZMA, which defaults to TRUE, is used to control whether the core library is built with support for lzma compression of G3 files. Use -DWITH_LZMA=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).

An uninstall target is also provided, so running make uninstall from the build directory should remove all files created by a previous make install.

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 (flac, 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

The following is a brief overview of how to use git in a way that your collaborators will appreciate.

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

Project details


Download files

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

Source Distribution

spt3g-1.0.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distributions

spt3g-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp313-cp313-macosx_14_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

spt3g-1.0.0-cp313-cp313-macosx_13_0_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

spt3g-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp312-cp312-macosx_14_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

spt3g-1.0.0-cp312-cp312-macosx_13_0_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

spt3g-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp311-cp311-macosx_14_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

spt3g-1.0.0-cp311-cp311-macosx_13_0_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

spt3g-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp310-cp310-macosx_14_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

spt3g-1.0.0-cp310-cp310-macosx_13_0_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

spt3g-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp39-cp39-macosx_14_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

spt3g-1.0.0-cp39-cp39-macosx_13_0_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

spt3g-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

spt3g-1.0.0-cp38-cp38-macosx_13_0_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.8macOS 13.0+ x86-64

File details

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

File metadata

  • Download URL: spt3g-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spt3g-1.0.0.tar.gz
Algorithm Hash digest
SHA256 18c923008eb96f9dd42332fed28d3068a432f435d2e8977afa3864b2958424ec
MD5 4c707b0fb03c99fd50c4dcd9b1b51422
BLAKE2b-256 2efdf5ccae6e5ff44e2fb21d8534994d48b6ecd568c1385491cf01bbf220eea3

See more details on using hashes here.

File details

Details for the file spt3g-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fafc8606200b9a3a8d5ac2847e8fb6bdabe8965aadda415572aeddcffa5a8c6e
MD5 000cac15175f55dcace18241e8350ba6
BLAKE2b-256 47c85824df84b17a62a9d75779ac935d847da7c247546377d99596ee8ac3cccf

See more details on using hashes here.

File details

Details for the file spt3g-1.0.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for spt3g-1.0.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 71f71cde4080cc2e26716ebfa19bc9a555b9e7fc041786626c222a7d0fdbe6dd
MD5 4a47597215878df3ab7c1f598e0b1bc2
BLAKE2b-256 ea138f84f831c0f7e6500b677bf4a13a0fb69105531c57f9e61fdfeabbdfadc1

See more details on using hashes here.

File details

Details for the file spt3g-1.0.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for spt3g-1.0.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5c12d2343faad4dde38ea6278fd64961c001b569fbe3411b24295de2614d2d25
MD5 73aa56f2737177958c1a46eb4c175288
BLAKE2b-256 945dec081ca153fe138e8bd0d5940185c8754b9fcef9ae9d316e919109bb3625

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3714b84489a090c41e23a334a80f09f3c9762bef7f97e51c80357c4225dedf9f
MD5 d3fc20ca2cefbf1009c627b66bb23c3f
BLAKE2b-256 ae80a25a707184b0f5b1772aae9d614ca30305fbf302f331c1f7c5561323736a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 16f20bf90fa24f3c7bd20144b29d3f853f6fdf661b31d4dac1e8beacd0c37f00
MD5 9aa1b39f830ac33770e7d9731b82e711
BLAKE2b-256 9ba2a7328101d92e39a2b2fa3d92f6628cc451f30c50afe9155c595c4963b28c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 078005004e0e79450d99bd082a4cd16c534462caeb883fb1afdc6208f079e0ea
MD5 7b53f358c85fe03ed7b331fa5380209c
BLAKE2b-256 b248c151d6f58e6c39aff319d449cfe4a75f2a6ab44ed8bee52d51ed61a41314

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c50b1f86bf99c6f57f10db7224493c81bf500887dd274ec0aa45ee60b753dcf2
MD5 e76cb0d5fc0bd8de38b5c8469a00c308
BLAKE2b-256 de55d7d4145c8087204dd06a0a968d88ac836095f3c764a03ab7b4e58e1252ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5b80b84e645db727208f31c1875f24854ccecc88faf23d470de1bb6708aa15b4
MD5 b1d29074c5d095a8037c0ad567db8eb6
BLAKE2b-256 8e03bc499b3a364abc96147c999130a2933ace2cd5e32ce2e9dfc2f89c279893

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ee3c3501167e9fa50897ca3cd9defa63d26b484496342c8b0db97aa0ddd98258
MD5 801786e65c282b8e7f447f86672952c1
BLAKE2b-256 b1a123efd0a24b2fa07cfee70d170f2c7b4b4cd13c9e6c7e4066ffda144de2a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 876347806f552ca357395b095a1ce5a113d1b3cb37d05eb3a4881d73f9f94ec5
MD5 e81976e497f8c6712a80768b350675af
BLAKE2b-256 810a8943f6535dfc3ef319e7f8532827778009d5c713bb3ab65e99bd28b50cd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 186d92ef01a3c84feceae56d3ecdd7163ccddfa7d4b0a4c5a19687b83072b122
MD5 a3dac8c4e5c5f3cbff26c27d77b3e926
BLAKE2b-256 b73e30da1cabfcccefea0faebe98138ecff3d867ce34b17d0972d19fae6bb278

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c08b3e07739601153723c846759d8cab9af6d2d8e75312b60dd72f2dbb501697
MD5 e7c243f4da9d226f16512772eb558978
BLAKE2b-256 2c2e3b90ffebf2306d9dd1a439094f7d3faf161294871d4b8ec7903da44c5d31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af7fcd6cceaec1836d221e4478f7575e2f29fcf4d25627b0a31a59e83cd69ff5
MD5 79089b99a4251a48f36721ee8c5d9c4f
BLAKE2b-256 4b3f6c1c0539b9ed1d5ca997bf098c9e52f29bbfd95cfef555b044db15e8ca55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1505da554057aa61340de2cf162dd41cab33bc2a38363afea337156e3c3b9776
MD5 b0a546ed92807aae27fadc3b00047c73
BLAKE2b-256 b52bf7d7770feca7823ecc256b3d17205e706781b5b465786656118204d021bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 7018d164c268e2809aeaa6e8ac030de12bd4841aa0ec06bc85a3c7f465961e66
MD5 ba4b7847033af3168285f6922d268f3a
BLAKE2b-256 eb0be5c1c4bed1524f2e09f3fd1a8cac9ce77502fd28f3b690011f9ce7b579fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1796b9bd11982a0389d69b93bff69190f6e09495acb73430fac780b9aab31e9
MD5 a3e0b37ade2fca6df2c253eb082ac0c8
BLAKE2b-256 50c94d3228a987580b2a2304cccfef192daa309208a0ed124042a67ff4034155

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spt3g-1.0.0-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fd8bd4488374eb8042ac21bdb704a33c6bbb037f3b8b655ecdfa2686c88227a5
MD5 3e3aab306ad965961a863c6e12eb6ab0
BLAKE2b-256 1955cf7db76c06b04419ecba39ca2eecd1459e8289148fbf49b8728a13e9df38

See more details on using hashes here.

Supported by

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