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")

Single-Band MTF Image

mk_monoimg creates one grayscale JPEG from a single mono image. It uses the same MTF-style stretch as mk_colorimg, but omits RGB-only steps such as color calibration, Lab luminance replacement, SCNR, and saturation.

from STCI import mk_monoimg

mk_monoimg(
    "cutout_VIS.fits",
    output_jpg="target_vis_mtf.jpg",
    input_mode="raw",
)

For a NumPy mono image:

from STCI import mk_monoimg

mk_monoimg(mono_array, output_jpg="target_mono.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",
    ReplaceL=True,
    RGB="auto",
)

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

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.
  • ReplaceL: if False, skip replacing the CIELab L* channel with the stretched blue luminosity channel.
  • RGB: Euclid bands in (R, G, B) order. Use "auto" for the default available-band choice, or pass bands such as ("NIR_H", "NIR_Y", "VIS") or ("H", "Y", "VIS").

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.2.tar.gz (21.9 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.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for stci-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f423d95a54021143bcc000937682ea0a5628d500c41c04fe43bf29de7eee44c8
MD5 4a08ddd62919dfe60bcdd7717c8e58cc
BLAKE2b-256 68367c9c9508bd77787dc2cc73de06e384ec2cc88f30face5707002cfba33414

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for stci-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 288de47ccf201f9308957ebbfb300902cf44bf3bb7448e8163995d328b81a02e
MD5 120c0f20c3ad41ce9c50d9bbc1f7b523
BLAKE2b-256 1331ba7847f24c34c2428d7c53bdbe5dd35e94791f368f34c20cf8c5f275c95a

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