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",
    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.1.tar.gz (20.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.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stci-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 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.1.tar.gz
Algorithm Hash digest
SHA256 a43b45604354ef5b2a42e616d493313ecc60e00c11e3cb7f0ffeb4a03ebeb606
MD5 9a021c3574761741d0cec4bb59c1aa02
BLAKE2b-256 14949cac1b07d5be1d451f587a5407575f3c05acdf1b2e0615c12b04bf5cd4fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: stci-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe8d4eb28574fa828d6f34a9b01fb19a81f3334bc3b3260e62bc5a68341490e0
MD5 0c7b389f89216c67cfe0172079c00e39
BLAKE2b-256 69b1d100dcd0f0b8337f3909b773d530f7a7ace478fa53b000416a362cadc23a

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