pixell
Project description
pixell
pixell is a library for loading, manipulating and analyzing maps stored in rectangular pixelization. It is mainly targeted for use with maps of the sky (e.g. CMB intensity and polarization maps, stacks of 21 cm intensity maps, binned galaxy positions or shear) in cylindrical projection, but its core functionality is more general. It extends numpy’s ndarray to an ndmap class that associates a World Coordinate System (WCS) with a numpy array. It includes tools for Fourier transforms (through numpy or pyfft) and spherical harmonic transforms (through libsharp2) of such maps and tools for visualization (through the Python Image Library).
Free software: BSD license
Documentation: https://pixell.readthedocs.io.
Dependencies
Python>=3.6
gcc/gfortran or Intel compilers (clang might not work out of the box), if compiling from source
libsharp2 (downloaded and installed, if compiling from source)
automake (for libsharp2 compilation, if compiling from source)
healpy, Cython, astropy, numpy, scipy, matplotlib, pyyaml, h5py, Pillow (Python Image Library)
Installing
Make sure your pip tool is up-to-date. To install pixell, run:
$ pip install pixell --user
$ test-pixell
This will install a pre-compiled binary suitable for your system (only Linux and Mac OS X with Python>=3.6 are supported). If you require more control over your installation, e.g. using your own installation of libsharp2, using Intel compilers or enabling tuning of the libsharp2 installation to your CPU, please see the section below on compiling from source. The test-pixell command will run a suite of unit tests.
Compiling from source (advanced / development workflow)
For compilation instructions specific to NERSC/cori, see NERSC.
For compilation instructions specific to Mac OS X, see MACOSX (h/t Thibaut Louis).
For all other, below are general instructions.
First, download the source distribution or git clone this repository. You can work from master or checkout one of the released version tags (see the Releases section on Github). Then change into the cloned/source directory.
Existing libsharp installation (optional)
libsharp2 is installed automatically by the setup.py you will execute below. The installation script will attempt to automatically git clone the latest version of libsharp2 and compile it. If instead you want to use an existing libsharp2 installation, you can do so by symlinking the libsharp2 directory into a directory called _deps in the root directory, such that pixell/_deps/libsharp2/build/include/libsharp2/sharp.h and pixell/_deps/libsharp2/build/lib/libsharp2.so exist. If you are convinced that the libsharp2 library is successfully compiled, add an empty file named pixell/_deps/libsharp2/success.txt to ensure pixell’s setup.py knows of your existing installation.
Run setup.py
If not using Intel compilers (see below), build the package using
$ python setup.py build_ext -i
You may now test the installation:
$ py.test pixell/tests/
If the tests pass, either add the cloned directory to your $PYTHONPATH, if you want the ability for changes made to Python source files to immediately reflect in your installation, e.g., in your .bashrc file,
export PYTHONPATH=$PYTHONPATH:/path/to/cloned/pixell/directory
or alternatively, install the package
$ python setup.py install --user
which requires you to reinstall every time changes are made to any files in your repository directory.
Intel compilers
Intel compilers require you to modify the build step above as follows
$ python setup.py build_ext -i --fcompiler=intelem --compiler=intelem
On some systems, further specification might be required (make sure to get a fresh copy of the repository before trying out a new install method), e.g.:
$ LDSHARED="icc -shared" LD=icc LINKCC=icc CC=icc python setup.py build_ext -i --fcompiler=intelem --compiler=intelem
Contributions
If you have write access to this repository, please:
create a new branch
push your changes to that branch
merge or rebase to get in sync with master
submit a pull request on github
If you do not have write access, create a fork of this repository and proceed as described above. For more details, see Contributing.
History
0.13.1 (2021-07-08)
Changes relative to 0.13.0 include:
Fixes to the MacOS wheel building
0.13.0 (2021-07-08)
Changes relative to 0.12.1 include:
Matched filtering in a new analysis module
Conjugate gradients solver
Discrete cosine transforms
Miscellaneous bug fixes
0.12.1 (2021-04-30)
Changes relative to 0.12.0 include:
Patch to fix numpy binary incompatibility issues caused by changes to the numpy C API. We now require numpy >1.20.
0.12.0 (2021-04-13)
Changes relative to 0.11.2 include:
We now use libsharp2 instead of libsharp, which has signficantly faster SHTs
Major breaking change: the meaning of the “iau” flag has been corrected and reversed. The default behaviour of map2harm and other functions using this flag will be different.
Unified harmonic transforms module
postage_stamp removed in favor of thumbnails
Adjoint harmonic transforms
0.11.2 (2021-02-04)
Changes relative to 0.11.0 include:
Bug-fix for when using rmax in distance_transform
0.11.0 (2021-02-02)
Changes relative to 0.10.3 include:
Bug-fix for enmap.project that led to crashes
enplot improvements
Improvements to fft and ifft overhead
alm filtering API improvements
Changes to CMB dipole parameter
Allow lmax!=mmax in curvedsky routines
Python 3.9 builds and Github actions instead of Travis
0.10.3 (2020-06-26)
Changes relative to 0.10.2 include:
Bug fix for automatic IAU -> COSMO, recognizes POLCCONV instead of POLCONV.
0.10.2 (2020-06-26)
Changes relative to 0.9.6 include:
Automatically converts maps recognized to be in IAU polarization convention (through the FITS header) to COSMO convention by flipping the sign of U
Fixes a centering issue in reproject.thumbnails
Optimizes posmap for separable projections and pixsizemap for cylindrical projections making these functions orders of magnitude faster for CAR (and other projections)
A test script test-pixell is distributed with the package
0.9.6 (2020-06-22)
Changes relative to 0.6.0 include:
Ability to read compressed FITS images
Fixed a bug to make aberration and modulation accurate to all orders
Expanded alm2cl to handle full cross-spectra and broadcasting
0.6.0 (2019-09-18)
Changes relative to 0.5.2 include:
Improvements in accuracy for map extent, area and Fourier wavenumbers
Spherical harmonic treatment consistent with healpy
Additional helper functions, e.g enmap.insert
Helper arguments, e.g. physical normalization for enmap.fft
Bug fixes e.g. in rand_alm
Improved installation procedure and documentation
0.5.2 (2019-01-22)
API for most modules is close to converged
Significant number of bug fixes and new features
Versioning system implemented through versioneer and bumpversion
Automated pixel level tests for discovering effects of low-level changes
0.1.0 (2018-06-15)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pixell-0.13.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdf797a93a20c5d5c70fe5e77042c6e81142a6f7b0ae6e858e2a11aa460c5725 |
|
MD5 | 87e1153371f8d67df60a23ad347f4407 |
|
BLAKE2b-256 | 655634a5d91e78f167fa1ea287a4feb4252c6fc55aeeed40f8ca50cf39c0ac8f |
Hashes for pixell-0.13.1-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5faee867e6084e19e0385fa97316d9d64230f7a6407b8bce773a37e98d1d8a6a |
|
MD5 | 218c48e5b413f3227e4045bba7d3767a |
|
BLAKE2b-256 | 684bb06a0be19a2646c38322db929e5ce336f1b06ee0edbdc06ef51ae69021ed |
Hashes for pixell-0.13.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb1b865fa66bca4794d722334eeb623c8b8543287d1fe58613058645877156b9 |
|
MD5 | f14566b9e1002c9089c7df86772e4dbf |
|
BLAKE2b-256 | 597eed6e06a8af056d9514d77211c04d412ec755c2e063b21e4414bab8596ee0 |
Hashes for pixell-0.13.1-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 075cc5da9d67fd42f38e7549952342c7c10315448455ffd1bd3f40084fd8cde8 |
|
MD5 | 2237d64a99b1c68e23773886e4ce0c68 |
|
BLAKE2b-256 | bcff65f71f0acf5cd9d2a0692a98666c2fff25da34ec40ac0cb5151c07a7861b |
Hashes for pixell-0.13.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334938509a01cbc36262507a38de80305ebe11c2efd6b6d9dcc9bfbe53d6407c |
|
MD5 | 7d66c6fbcb32ec31bcb0b4d6855b2aed |
|
BLAKE2b-256 | 81d6e2f5e3b62b9e85855b8f0ec4c2e3cb6fb3761c085c0e14fe1b1b7bca7853 |
Hashes for pixell-0.13.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b09ab8bd9f1d7db6489049cb90d1fee2f4e1bae578918c9aed98c9ded704206 |
|
MD5 | 98078e4569fcac344e65dd445b9d3b2c |
|
BLAKE2b-256 | 51fbebdc0ca610cae9f042b3bce20188cb843290bba825eb10250189a8dfae0f |
Hashes for pixell-0.13.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff885671bf825d0bdc55427e7266710ba1c09aad04e93c99b77d244e9cfd0c30 |
|
MD5 | a8f293f620e343e14f782fa6794299ea |
|
BLAKE2b-256 | 683e5d9b2d78454069b88aa285781e8b8f26b814fb857280ef08bcadfedfdbcc |
Hashes for pixell-0.13.1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24eda10880ebb09324f3ca7800982e15fb6ba7ca37f2b805d213709e01bab8dd |
|
MD5 | 777f6cdb6348fcc244e785ca97a79c92 |
|
BLAKE2b-256 | 258e981c3506d7c8318be311506fcabb053080f6eed1fec1eb018c925cb8f9d2 |