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 libsharp) 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
libsharp (downloaded and installed, if compiling from source)
automake (for libsharp compilation, if compiling from source)
healpy, Cython, astropy, numpy, scipy, matplotlib, pyyaml, h5py, Pillow (Python Image Library)
Installing
To install pixell, run:
$ pip install pixell --user
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 libsharp, using Intel compilers or enabling tuning of the libsharp installation to your CPU, please see the section below on compiling from source.
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)
libsharp is installed automatically by the setup.py you will execute below. The installation script will attempt to automatically git clone the latest version of libsharp and compile it. If instead you want to use an existing libsharp installation, you can do so by symlinking the libsharp directory into a directory called _deps in the root directory, such that pixell/_deps/libsharp/libsharp/sharp.h exists. If you are convinced that the libsharp library is successfully compiled, add an empty file named pixell/_deps/libsharp/libsharp/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.1.0 (2018-06-15)
First release on PyPI.
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.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.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.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
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.10.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec7b5e5d5f79b75ba6c091242cb2cd601c788f889285e899ea3d86ecded09c0a |
|
MD5 | 20ac521a510f21db17d1c71239a1c275 |
|
BLAKE2b-256 | f047e81d1d86f9ec4ab24234593b76e1df33b52bdc6c3e7e01f6416c57a6ca7a |
Hashes for pixell-0.10.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1edd99e98e516f02799baee0ca3a898ec2bed14e1bd58bb4f41988e24094eed |
|
MD5 | 38e5fe3685ae711f86adca0a8d338dab |
|
BLAKE2b-256 | 05312604d454708bb1c5d7864a98d0a3af16ac01461ebb7c64e4a560a69007e4 |
Hashes for pixell-0.10.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c585edc892935fca723fc9c66a774f35215bda49121af9d0bc3c0fdc1549f36c |
|
MD5 | 0f0c50d0eb402eb99fc5761300f6cb10 |
|
BLAKE2b-256 | 26faeb3c29ca05855343568c1a72501e27d5a5678955c8ebf00b692ca679d75a |
Hashes for pixell-0.10.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53e78247d50c7832feeb7dc21b0607c723923ea595e24bfa5aaa7770926b1fe3 |
|
MD5 | f23df5297e09e4741a07edcf298bc9c1 |
|
BLAKE2b-256 | bd75a191013208f4aff0e09624affcd9a3ac55dcf0bcf5ef4283c5e688b8dddf |
Hashes for pixell-0.10.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50dd8982388974111e6a152ec0dc8db0311bd4681e00687bb0182417409c3568 |
|
MD5 | 4df310c190687b627615c3da522d2b39 |
|
BLAKE2b-256 | 8f31c0bd5d7b445c8d9fad6f658fb3ce10d888474616ccaf13023b4e91c2c164 |
Hashes for pixell-0.10.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cf3a4843ca44d73b3fc2d061d94afc00c42c43d64fccdbb59b55718960b8606 |
|
MD5 | 6165e0ac5509f6e431fe7ad0da063e08 |
|
BLAKE2b-256 | 868141c7a420a02093a4053ed4e44c5b2216f93b79b1d57307f95621d25deb92 |