Skip to main content

Create composite color images from FITS files

Project description

fits2comp

fits2comp creates composite color images from FITS files using the algorithm of Lupton et al. (2004). Though the algorithm has been implemented in Astropy since I wrote the first version of this program, the main benefit of fits2comp is that you can call it with a number of options that will take care of a number of things for you -- no need to code things up.

You will need to create FITS images in up to three filters by yourself. The FITS images need to be on the same grid and are combined pixel by pixel, WCS information is ignored for this purpose. The WCS of the red channel is used for more advanced functionality: drawing a ruler and a compass, and marking source positions from a file readable as an Astropy table. For my own science with the MUSE integral-field spectrograph, I use the exp_combine recipe or the command muse_cube_filter to create images in several filters from a data cube.

fits2comp is a Python 3 package, installable via pip install fits2comp. It requires Astropy, NumPy, and Pillow-PIL, which will be automatically installed. It uses argparse, so it accepts the --help option. The most important options are -c|--cutoff and -s|--softening, which together set the color scale of the output image. You will have to try a few values to get an image that you like.

Pre-released versions of this package were used to create the images in Zoutendijk et al. (2020, Fig. 1; 2021a, Fig. 1; 2021b, Fig. 1) As an example, I created the Antlia B image in Zoutendijk et al. (2021b, Fig. 1) with

fits2comp \
    --cutoff 10 --softening 1 \
    --ruler "30 arcsec" "196 pc" --name "Ant B" --compass \
    --source-list AntB.csv --offset 5 5 \
    AntB_im/DATACUBE_exp_combine-nomask-noautocal_SDSS_i.fits \
    AntB_im/DATACUBE_exp_combine-nomask-noautocal_SDSS_r.fits \
    AntB_im/DATACUBE_exp_combine-nomask-noautocal_SDSS_g.fits \
    AntB_gri.png

You can find the options used to create a composite image in the image metadata, in case you forget what options you used after painstakingly finding the optimal combination for your target.

Contact

In case of bugs or questions, please file an issue on GitHub or send me an e-mail: zoutendijk@strw.leidenuniv.nl.

License

This project is licensed under the terms of the MIT License.

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

fits2comp-0.0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fits2comp-0.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file fits2comp-0.0.1.tar.gz.

File metadata

  • Download URL: fits2comp-0.0.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for fits2comp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 422c1638ca6a5a3bb56813f71317bd2a4be789fb6d2e788186bf0d49bbc4d51b
MD5 df5adc557cd08f94b983e45391dc2360
BLAKE2b-256 5581917a09bd6ce41af8e46e239a5fef818730b59fe529f86546579fba043e82

See more details on using hashes here.

File details

Details for the file fits2comp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fits2comp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for fits2comp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0f3130f45beec5825d92abbc92c8f21d0e8f40d37eb00c26d5db803195b18c
MD5 6a9cdb4290accbf27f3b45d927e0503d
BLAKE2b-256 45dcf319faf843d597ed4b986b2bb4b63badf80f4cf0591797abef5aae94bcf2

See more details on using hashes here.

Supported by

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