Skip to main content

ZAP (the Zurich Atmosphere Purge) is a high precision sky subtraction tool.

Project description

ZAP (the Zurich Atmosphere Purge)

Tired of sky subtraction residuals? ZAP them!

ZAP is a high precision sky subtraction tool which can be used as complete sky subtraction solution, or as an enhancement to previously sky-subtracted MUSE data. The method uses PCA to isolate the residual sky subtraction features and remove them from the observed datacube. Future developments will include modification for use on a variety of instruments.

The last stable release of ZAP can be installed simply with pip:

pip install zap

Or into the user path with:

pip install --user zap

Citation

The paper describing the original method can be found here: http://adsabs.harvard.edu/abs/2016MNRAS.458.3210S

Please cite ZAP as:

\bibitem[Soto et al.(2016)]{2016MNRAS.458.3210S} Soto, K.~T., Lilly, S.~J., Bacon, R., Richard, J., \& Conseil, S.\ 2016, \mnras, 458, 3210

2.1 (2019-07-03)

  • Zap now requires Python 3.5 or later, and Astropy 2.0 or later.

  • Compatibility with the NFM-AO mode.

  • Ignore the notch filter region in the ‘median’ and ‘fit’ methods for the continuum filter (cftype).

  • Change the default continuum filter method (cftype) to ‘median’ and remove the ‘weight’ method. The previous default method (‘weight’) has some problems with the treatment of spectra edges and with the notch filter edges for the AO modes, and is also introducing bumps in the red wavelengths.

  • Add a command-line argument for nevals.

  • Scipy 0.18.1 or later is required, because of SVD convergence issue with previous versions.

  • Add a function to mask the cube edges (zap.mask_nan_edges): the spaxels at the edges of the cube may have a lot of NaNs in their spectra, so ZAP does not subtract the sky on these which leaves high residuals.

2.0 (2017-09-08)

  • Compatibility with the WFM-AO mode.

  • Use Scikit-learn’s implementation for the PCA instead of the custom one. This solved an issue with spatial variations introduced by zap. Also it is much faster than the previous implementation. A drawback however is that it is no more possible to save the SVD file.

  • Use only one sky segment by default, which means that the cube is no more split on the wavelength axis. Originally zap used 11 segments, whose goals were to have coherent groups of sky emission lines, with a smaller number of eigenvalues per segment. And it also allowed to parallelize the computation. But, the segments were also responsible for continuum oscillations, and made the choice of the number of eigenvalues per segment very difficult and very sensitive. With only one segment the performance of the sky subtraction is much better, thanks to the higher correlation between sky lines on the whole wavelength range.

    So using only one segment allows to greatly reduce the risk of killing an emission line with the new PCA. It is still possible to modify the segments if needed:

    from zap.zap import SKYSEG
    SKYSEG[:] = [0, 5400, ..., 10000]
  • New continuum filter type with a polynomial fit (cftype='fit'). Must be used with care though, as the fit can easily go out of control in the red part of the spectrum.

  • Change the default median filter width to 300, for the median and weight continuum filters. The values used previously, 100 and 50, were too small which explains the background oscillations in the red part of the spectra.

  • New parameter (ncpu) to set the number of used CPU.

  • Remove the possibility to save the SVD result in a FITS file. This is because of the change of PCA implementation. It is still possible to pass the SVD computed by SVDoutput to process, passing the in-memory object directly without saving it to disk.

  • Speed improvements, mostly thanks to the new PCA implementation.

  • New parameter to save the explained variance curves.

1.0 (2016-04-02)

First public release. This is the version described in the 2016MNRAS.458.3210S paper.

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

zap-2.1.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

zap-2.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file zap-2.1.tar.gz.

File metadata

  • Download URL: zap-2.1.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for zap-2.1.tar.gz
Algorithm Hash digest
SHA256 5ae183accceda6ab630c9e3ffa80a82abb880c8631810f67f33b6b99cbcb16b2
MD5 7d7f9f3483b436c6d88253abef2e9a90
BLAKE2b-256 ec5dda4cae8f3278e5c2d7c0101261e9d114d8855f14a6fc7c506ff789c7222c

See more details on using hashes here.

File details

Details for the file zap-2.1-py3-none-any.whl.

File metadata

  • Download URL: zap-2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for zap-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f346426c393bb406fa996b35d4dc9124cd29c0da6a97711ba90133d7f29e849
MD5 a1aa935df63cdaa5c03714046e68d77f
BLAKE2b-256 7ff6a7260eb5e9c1d24449133b88803cffbab31d6efef4569e6d3b504f14cc27

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