Skip to main content

SpaceTelescopeColorImage tools for astronomy cutouts.

Project description

STCI

STCI stands for SpaceTelescopeColorImage.

STCI is a small astronomy image-composition tool for making display-ready color JPEGs from space telescope cutouts and other aligned mono images.

Installation

pip install STCI

The installed Python import module is STCI.

Example usage

mk_colorimg creates one color JPEG from either a 3-channel RGB array or three mono images in (R, G, B) order. For Euclid-style color images, the default mapping is NIR_J, NIR_Y, VIS.

from STCI import mk_colorimg

mk_colorimg(
    [
        "cutout_H.fits",    # R channel
        "cutout_VIS.fits",  # G channel
        "cutout_Y.fits",    # B channel
    ],
    output_jpg="target_mtf_vis_y_h.jpg",
    input_mode="raw",
)

For a NumPy RGB cube:

from STCI import mk_colorimg

mk_colorimg(rgb_array, output_jpg="target_color.jpg", input_mode="normalized")

Download a Euclid Color Image

Euclidimg downloads Euclid DR1 VIS, NIR_Y, NIR_J, and NIR_H FITS cutouts, then renders one color JPEG using the NIR_J / NIR_Y / VIS channel order.

from STCI import Euclidimg

result = Euclidimg(
    ra=50.7163333,
    dec=-39.7693889,
    size=5.0,
    path="euclid_color",
    cred="Euclid/cred.txt",
    output_jpg="EUCLJ032251.92-394609.8.jpg",
)

print(result["jpg"])
print(result["fits"])

Arguments:

  • ra, dec: target coordinates in degrees.
  • size: cutout radius in arcsec. For example, size=5.0 makes a 10" x 10" image.
  • path: output directory for the FITS files and JPEG.
  • cred: Euclid credentials file passed to astroquery.esa.euclid.
  • output_jpg: optional JPEG filename written inside path.

The returned dictionary contains the selected FITS paths and the final JPEG path. If the first overlapping mosaic tile for a band is empty or all zero, the downloader tries the next matching tile.

Download Euclid FITS Only

from Download_Euclid import EUC_download

fits_paths = EUC_download(
    ra=50.7163333,
    dec=-39.7693889,
    size=5.0,
    path="euclid_fits",
    cred="Euclid/cred.txt",
)

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

stci-0.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

stci-0.1.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file stci-0.1.0.tar.gz.

File metadata

  • Download URL: stci-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for stci-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd163fa6cb1f0e9ae09a12e1292e6ad18cf5f3d859ebc61f3be18b68efd06aeb
MD5 f61ad860822b09b11e46345c40ca8156
BLAKE2b-256 7fd68301cc3d69dcaafedde69b96414f625105d0bf30fc77ba42b3fe6135f86a

See more details on using hashes here.

File details

Details for the file stci-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stci-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for stci-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7cf0623f498b20a3d44a9db148d02955d196454c0919a9949fcb8299a98b755
MD5 3e6c17b6a1dad284004b26c74459fd25
BLAKE2b-256 5f908d52cc64b233e5eeaa3469159496d8dc831b0a8292f4f9ac76ccc2f72e4e

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