Skip to main content

Python script that converts astronomical FITS images in color/grayscale images.

Project description

trilogy

Python script that converts astronomical FITS images into color/grayscale images. trilogy was originally written in Python 2.

Author: Dan Coe

Modified by Renan Alves de Oliveira

ascl:1508.009

Cosmic Horseshoe
Cosmic Horseshoe image was taken by Hubble WFC3, using filters F475W, F606W, and F814W.
We use trilogy to combine all FITS files in this beautiful RGB image!

Try it! Binder

Installation

  1. From PyPi:
pip install trilogy
  1. From Github:
git clone https://github.com/oliveirara/trilogy.git
cd trilogy
python setup.py build
python setup.py install

Usage

  1. Command line:
trilogy-cl -params
  1. With input file (e.g. see *.in in ~/examples/):
trilogy-cl single.in
  1. With input file and command line parameters:
trilogy-cl single.in -deletefilters 0 -showwith PIL -sampledx 300
  1. Check notebooks in ~/notebooks for examples.

Requirements

  • Pillow
  • astropy
  • numpy
  • scipy

Parameters and default values

"indir" = ''          # Input directory.
"outname" = None      # Output filename.
"outdir" = ''         # Output directory.
"saturate" = None     # Determined automatically if None: image data value allowed to saturate.
"satpercent" = 0.001  # Percentage of pixels which will be saturated.
"colorsatfac" = 1     # \> 1 to boost color saturation.
"noise" = None        # Noise luminosity is determined automatically if None.
"noiselum" = 0.15     # Noise luminosity for single channel (between 0 - 1).
"noiselums" = {}      # Noise luminosity for each channel (between 0 - 1).
"noisesig" = 1        # Data noise level output to noiselum: measured sigma above the measured mean.
"noisesig0": 2        # Data noise level: measured sigma above the measured mean.
"correctbias"= 0      # Measure data noise mean (otherwise assume = 0).
"combine" = 'average' # "average" or "sum" combine images.
"invert" =  0         # Invert luminosity (black on white).
"scaling" = None      # Determined automatically if None: image scaling.
"bscale" = 1          # Multiply all images by this value.
"bzero" = 0           # Add this value to all images.
"samplesize" = 1000   # Determine number of levels.
"stampsize" = 1000    # Making final color image (memory issue).
"sampledx" = 0        # Offset in x direction.
"sampledy" = 0        # Offset in y direction.
"show" = 0            # Show final image at the end.
"showstamps" = 0      # Show image config stamps.
"showwith" = 'open'   # Command to display images.
"thumbnail" = None    # Show thumbnail.
"legend" = 0          # Adds legend to top-left corner indicating which filters were used (only for RGB).
"maxstampsize" = 6000 # Memory fix.
"testfirst" = 1       # Test some options before making the final image.
"deletetests" = 0     # Delete testing files.
"deletefilters" = 1   # Delete filter files.

Resources

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

trilogy-0.0.8.tar.gz (26.8 kB view details)

Uploaded Source

File details

Details for the file trilogy-0.0.8.tar.gz.

File metadata

  • Download URL: trilogy-0.0.8.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.7.12

File hashes

Hashes for trilogy-0.0.8.tar.gz
Algorithm Hash digest
SHA256 9f0bb790ed89ce162bdbb70f8bf71d6152dd70e3fa82c0d12b2c14bb252f7873
MD5 d8af940c4ecfcefda5a591afa67a87d3
BLAKE2b-256 78a34debc1f949e93d69bad41b695af5fa2c4b1fd74aee5cf8c3c34a086d3fe6

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