Skip to main content

build downsampled previews of space telescope products

Project description

Space Telescope Product Downsampling

Powered by STScI Badge Powered by Astropy Badge build test codecov

pip install stpreview

Usage

❯ uv run stpreview --help
usage: stpreview [-h] [--observatory {roman,jwst}] [--compass]
                 INPUT OUTPUT {to,by} ...

positional arguments:
  INPUT                 path to ASDF file with 2D image data
  OUTPUT                path to output image file
  {to,by}
    to                  downsample the given ASDF image by the given integer
                        factor
    by                  downsample the given ASDF image to the desired shape (the
                        output image may be smaller than the desired shape, if no
                        even factor exists)

options:
  -h, --help            show this help message and exit
  --observatory {roman,jwst}
                        (if omitted, will attempt to infer from file)
  --compass             draw a north arrow on the image

stpreview by

❯ uv run stpreview input.asdf output.png by --help
usage: stpreview INPUT OUTPUT by [-h] FACTOR [FACTOR ...]

positional arguments:
  FACTOR      block size by which to downsample image data

options:
  -h, --help  show this help message and exit

stpreview to

❯ uv run stpreview input.asdf output.png to --help
usage: stpreview INPUT OUTPUT to [-h] SHAPE [SHAPE ...]

positional arguments:
  SHAPE       desired pixel resolution of output image

options:
  -h, --help  show this help message and exit

Examples

downsample a sample Roman image by a factor of 10, and add a compass rose
stpreview /grp/roman/TEST_DATA/23Q4_B11/aligntest/r0000501001001001001_01101_0001_WFI01_cal.asdf docs/images/by.png --compass by 10 10

by

downsample a sample Roman image to within 300x300 pixels
stpreview /grp/roman/TEST_DATA/23Q4_B11/aligntest/r0000501001001001001_01101_0001_WFI01_cal.asdf docs/images/to.png to 300 300

to

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

stpreview-0.6.0.tar.gz (218.9 kB view details)

Uploaded Source

Built Distribution

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

stpreview-0.6.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file stpreview-0.6.0.tar.gz.

File metadata

  • Download URL: stpreview-0.6.0.tar.gz
  • Upload date:
  • Size: 218.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stpreview-0.6.0.tar.gz
Algorithm Hash digest
SHA256 38698555c3b5cf0712de76deb56635a842dd26e3bfc51086d382e6f33cbefffc
MD5 73b31d607708ad8982b5631c55d3bfe5
BLAKE2b-256 0dcdff74e54df88a7a7bb92ccad5849003b43bca38fe15044319ee86aebadc56

See more details on using hashes here.

File details

Details for the file stpreview-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: stpreview-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stpreview-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa262af6a9810af4a3e1139227db8bec190a2e7be8567861d3c228e83dee16a3
MD5 0f6f5d9546bf1077d7e30500753f90e2
BLAKE2b-256 9cf25b1c58369a41da226607f1538260d5a0b04716926efd9583234b33939d7c

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