Package: pixell
pixellpixellis 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’sndarrayto anndmapclass 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 (throughducc0) of such maps and tools for visualization (through the Python Image Library).Free software: BSD licenseDocumentation:https://pixell.readthedocs.io.TutorialsDependenciesPython>=3.7gcc/gfortran or Intel compilers (clang might not work out of the box), if compiling from sourceducc0, healpy, Cython, astropy, numpy, scipy, matplotlib, pyyaml, h5py, Pillow (Python Image Library)On MacOS, and other systems with non-traditional environments, you should specify the following standard environment variables:CC: C compiler (example:gcc)CXX: C++ compiler (example:g++)FC: Fortran compiler (example:gfortran)We recommend usinggccinstalled from Homebrew to access these compilers on
MacOS, and you should make sure to point e.g.$CCto the full path of your gcc installation,
as thegccname usually points to the Appleclanginstall by default.Runtime threading behaviourCertain parts ofpixellare parallelized using OpenMP, with the underlyingducc0library using pthreads. By default, these libraries use the number of cores on your
system to determine the number of threads to use. If you wish to override this behaviour,
you can use two environment variables:OMP_NUM_THREADSwill set both the number ofpixellthreads andducc0threads.DUCC0_NUM_THREADSwill set the number of threads for theducc0library to use,
overwritingOMP_NUM_THREADSif both are set.pixellbehaviour is not affected.If you are using a modern chip (e.g. Apple M series chips, Intel 12th Gen or newer) that
have both efficiency and performance cores, you may wish to setOMP_NUM_THREADSto
the number of performance cores in your system. This will ensure that the efficiency cores
are not used for the parallelized parts ofpixellandducc0.InstallingMake sure yourpiptool is up-to-date. To installpixell, run:$pipinstallpixell--user$test-pixellThis will install a pre-compiled binary suitable for your system (only Linux and Mac OS X with Python>=3.7 are supported). Note that you need~/.local/binto be in yourPATHfor the lattertest-pixellto work.If you require more control over your installation, e.g. using Intel compilers, please see the section below on compiling from source.  Thetest-pixellcommand will run a suite of unit tests.Compiling from source (advanced / development workflow)For compilation instructions specific to NERSC/cori, seeNERSC.For all other, below are general instructions.First, download the source distribution orgit clonethis repository. You can work frommasteror checkout one of the released version tags (see the Releases section on Github). Then change into the cloned/source directory.Runsetup.pyIf not using Intel compilers (see below), build the package using$pythonsetup.pybuild_ext-iYou may now test the installation:$py.testpixell/tests/If the tests pass, you can install the package (optionally with-eif you would like to edit the files after installation)$pythonsetup.pyinstall--userIntel compilersIntel compilers require you to modify the build step above as follows$pythonsetup.pybuild_ext-i--fcompiler=intelem--compiler=intelemOn 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=iccLINKCC=iccCC=iccpythonsetup.pybuild_ext-i--fcompiler=intelem--compiler=intelemContributionsIf you have write access to this repository, please:create a new branchpush your changes to that branchmerge or rebase to get in sync with mastersubmit a pull request on githubIf you do not have write access, create a fork of this repository and proceed as described above. For more details, seeContributing.History0.21.0 (2023-10-19)Changes relative to 0.19.2 include:More miscellaneous fixes after transition to ducc0More work on waveletsWe now provide MacOS x86_64 wheelsImproved build system that respects choices of CC, CXX, and FC0.19.2 (2023-08-18)Changes relative to 0.19.0 include:Important bugfixes for the migration from libsharp2 to ducc0Improved SHT unit tests0.19.0 (2023-07-14)Changes relative to 0.17.3 include:Migrate fully from libsharp2 to ducc0 (for curved sky functions)Temporary suspension of MacOS pip binaries (usepip install pixell==0.17.3for Macs in the meantime)Miscellaneous fixes0.17.3 (2023-03-17)Changes relative to 0.17.2 include:More support for fejer10.17.2 (2023-02-21)Changes relative to 0.17.1 include:Build for Python 3.110.17.1 (2023-01-26)Changes relative to 0.16.0 include:Bilinear map-making pixel window functionMiscellaneous new functions and API improvementsMiscellaneous bug fixesFixes for Apple Silicon0.16.0 (2022-06-08)Changes relative to 0.15.3 include:Wavelet analysisFast C-based source simulationFast vectorized radial profile binningFixes and improvements to HDF5 I/OFixes to OSX support0.15.3 (2022-02-12)Changes relative to 0.15.1 include:New wheels that fix numpy binary incompatibility errors0.15.1 (2022-01-23)Changes relative to 0.14.3 include:More flexible enmap.read_map_geometryAdd Python 3.10 support, drop Python 3.6 support0.14.3 (2021-12-13)Changes relative to 0.14.2 include:Updates to enmap.insert, UHTs and WCS string accuracy0.14.2 (2021-11-23)Changes relative to 0.14.1 include:An important bugfix for enmap.downgrade when theopargument is passed. This bug has been present since v0.14.0 and in commits on master since Aug 12, 2021.0.14.1 (2021-11-16)Changes relative to 0.13.2 include:A breaking change to map2alm where it no longer approximates WCS if ring weights are unavailableMiscellaneous bug fixesducc0 FFT support and fast rotate_almTiled map supportNew healpix <-> rectpix reprojection API0.13.2 (2021-07-16)Changes relative to 0.13.1 include:Added binaries for MacOS 11 Big Sur0.13.1 (2021-07-08)Changes relative to 0.13.0 include:Fixes to the MacOS wheel building0.13.0 (2021-07-08)Changes relative to 0.12.1 include:Matched filtering in a new analysis moduleConjugate gradients solverDiscrete cosine transformsMiscellaneous bug fixes0.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 SHTsMajor 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 modulepostage_stamp removed in favor of thumbnailsAdjoint harmonic transforms0.11.2 (2021-02-04)Changes relative to 0.11.0 include:Bug-fix for distance_transform when using rmax0.11.0 (2021-02-02)Changes relative to 0.10.3 include:Bug-fix for enmap.project that led to crashesenplot improvementsImprovements to fft and ifft overheadalm filtering API improvementsChanges to CMB dipole parameterAllow lmax!=mmax in curvedsky routinesPython 3.9 builds and Github actions instead of Travis0.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 UFixes a centering issue in reproject.thumbnailsOptimizes 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 package0.9.6 (2020-06-22)Changes relative to 0.6.0 include:Ability to read compressed FITS imagesFixed a bug to make aberration and modulation accurate to all ordersExpanded alm2cl to handle full cross-spectra and broadcasting0.6.0 (2019-09-18)Changes relative to 0.5.2 include:Improvements in accuracy for map extent, area and Fourier wavenumbersSpherical harmonic treatment consistent with healpyAdditional helper functions, e.g enmap.insertHelper arguments, e.g. physical normalization for enmap.fftBug fixes e.g. in rand_almImproved installation procedure and documentation0.5.2 (2019-01-22)API for most modules is close to convergedSignificant number of bug fixes and new featuresVersioning system implemented through versioneer and bumpversionAutomated pixel level tests for discovering effects of low-level changes0.1.0 (2018-06-15)First release on PyPI.