Skip to main content

A package for combining dithered images into a single image

Project description

Powered by Astropy Badge Drizzle's Coverage Status CI Status Documentation Status PyPI Status Zenodo DOI

The drizzle library is a Python package for combining dithered images into a single image. This library is derived from code used in DrizzlePac. Like DrizzlePac, most of the code is implemented in the C language. The biggest change from DrizzlePac is that this code passes an array that maps the input to output image into the C code, while the DrizzlePac code computes the mapping by using a Python callback. Switching to using an array allowed the code to be greatly simplified.

The DrizzlePac code is currently used in the Space Telescope processing pipelines. This library is forward looking in that it can be used with the new GWCS code.

Requirements

  • Python 3.10 or later

  • Numpy

  • Astropy

The Drizzle Algorithm

This section has been extracted from Chapter 2 of The DrizzlePac Handbook [Driz2012]

There are a family of linear reconstruction techniques that, at two opposite extremes, are represented by the interlacing and shift-and-add techniques, with the Drizzle algorithm representing a continuum between these two extremes.

If the dithers are particularly well-placed, one can simply interlace the pixels from the images onto a finer grid. In the interlacing method, pixels from the independent input images are placed in alternate pixels on the output image according to the alignment of the pixel centers in the original images. However, due to occasional small positioning errors by the telescope, and non-uniform shifts in pixel space across the detector caused by geometric distortion of the optics, true interlacing of images is generally not feasible.

Another standard simple linear technique for combining shifted images, descriptively named “shift-and-add”, has been used for many years to combine dithered infrared data onto finer grids. Each input pixel is block-replicated onto a finer subsampled grid, shifted into place, and added to the output image. Shift-and-add has the advantage of being able to easily handle arbitrary dither positions. However, it convolves the image yet again with the original pixel, thus adding to the blurring of the image and to the correlation of noise in the image. Furthermore, it is difficult to use shift-and-add in the presence of missing data (e.g., from cosmic rays) and geometric distortion.

In response to the limitations of the two techniques described above, an improved method known formally as variable-pixel linear reconstruction, and more commonly referred to as Drizzle, was developed by Andy Fruchter and Richard Hook, initially for the purposes of combining dithered images of the Hubble Deep Field North (HDF-N). This algorithm can be thought of as a continuous set of linear functions that vary smoothly between the optimum linear combination technique (interlacing) and shift-and-add. This often allows an improvement in resolution and a reduction in correlated noise, compared with images produced by only using shift-and-add.

The degree to which the algorithm departs from interlacing and moves towards shift-and-add depends upon how well the PSF is subsampled by the shifts in the input images. In practice, the behavior of the Drizzle algorithm is controlled through the use of a parameter called pixfrac, which can be set to values ranging from 0 to 1, that represents the amount by which input pixels are shrunk before being mapped onto the output image plane.

A key to understanding the use of pixfrac is to realize that a CCD image can be thought of as the true image convolved first by the optics, then by the pixel response function (ideally a square the size of a pixel), and then sampled by a delta-function at the center of each pixel. A CCD image is thus a set of point samples of a continuous two-dimensional function. Hence the natural value of pixfrac is 0, which corresponds to pure interlacing. Setting pixfrac to values greater than 0 causes additional broadening of the output PSF by convolving the original PSF with pixels of non-zero size. Thus, setting pixfrac to its maximum value of 1 is equivalent to shift-and-add, the other extreme of linear combination, in which the output image PSF has been smeared by a convolution with the full size of the original input pixels.

The Drizzle algorithm is conceptually straightforward. Pixels in the original input images are mapped into pixels in the subsampled output image, taking into account shifts and rotations between images and the optical distortion of the camera. However, in order to avoid convolving the image with the large pixel “footprint” of the camera, Drizzle allows the user to shrink the pixel before it is averaged into the output image through the pixfrac parameter.

The flux value of each input pixel is divided up into the output pixels with weights proportional to the area of overlap between the “drop” and each output pixel. If the drop size is too small, not all output pixels have data added to them from each of the input images. One should therefore choose a drop size that is small enough to avoid convolving the image with too large an input pixel footprint, yet sufficiently large to ensure that there is not too much variation in the number of input pixels contributing to each output pixel.

When images are combined using Drizzle, a weight map can be specified for each input image. The weight image contains information about bad pixels in the image (in that bad pixels result in lower weight values). When the final output science image is generated, an output weight map which combines information from all the input weight images, is also saved.

Drizzle has a number of advantages over standard linear reconstruction methods. Since the pixel area can be scaled by the Jacobian of the geometric distortion, it is preserved for surface and absolute photometry. Therefore, the flux in the drizzled image, that was corrected for geometric distortion, can be measured with an aperture size that’s not dependent of its position on the image. Since the Drizzle code anticipates that a given output pixel might not receive any information from an input pixel, missing data does not cause a substantial problem as long as the observer has taken enough dither samples to fill in the missing information.

The blot methods perform the inverse operation of drizzle. That is, blotting performs the inverse mapping to transform the dithered median image back into the coordinate system of the original input image. Blotting is primarily used for identifying cosmic rays in the original image. Blot requires the user to provide the world coordinate system (WCS)-based transformations in the form of a pixel map array as input.

[Driz2012]

Gonzaga, S., Hack, W., Fruchter, A., Mack, J., eds. 2012, The DrizzlePac Handbook. (Baltimore, STScI)

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

drizzle-2.0.0.tar.gz (111.4 kB view details)

Uploaded Source

Built Distributions

drizzle-2.0.0-cp313-cp313-win_amd64.whl (77.5 kB view details)

Uploaded CPython 3.13 Windows x86-64

drizzle-2.0.0-cp313-cp313-win32.whl (69.0 kB view details)

Uploaded CPython 3.13 Windows x86

drizzle-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (292.8 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

drizzle-2.0.0-cp313-cp313-macosx_11_0_arm64.whl (76.5 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

drizzle-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl (82.9 kB view details)

Uploaded CPython 3.13 macOS 10.13+ x86-64

drizzle-2.0.0-cp312-cp312-win_amd64.whl (77.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

drizzle-2.0.0-cp312-cp312-win32.whl (69.0 kB view details)

Uploaded CPython 3.12 Windows x86

drizzle-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (292.7 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

drizzle-2.0.0-cp312-cp312-macosx_11_0_arm64.whl (76.5 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

drizzle-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl (83.1 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

drizzle-2.0.0-cp311-cp311-win_amd64.whl (77.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

drizzle-2.0.0-cp311-cp311-win32.whl (69.0 kB view details)

Uploaded CPython 3.11 Windows x86

drizzle-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (292.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

drizzle-2.0.0-cp311-cp311-macosx_11_0_arm64.whl (76.5 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

drizzle-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl (83.1 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

drizzle-2.0.0-cp310-cp310-win_amd64.whl (77.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

drizzle-2.0.0-cp310-cp310-win32.whl (69.0 kB view details)

Uploaded CPython 3.10 Windows x86

drizzle-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (292.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

drizzle-2.0.0-cp310-cp310-macosx_11_0_arm64.whl (76.5 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

drizzle-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl (83.1 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file drizzle-2.0.0.tar.gz.

File metadata

  • Download URL: drizzle-2.0.0.tar.gz
  • Upload date:
  • Size: 111.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0.tar.gz
Algorithm Hash digest
SHA256 29f1e21a72cacf634ee31f866ed26d33cc7abd2d7f9b72f9f54ce783a52ad844
MD5 ba81ad4b7d548519d23700b4b0fea7c3
BLAKE2b-256 6c2f2520810556149dc74961f398959b6a87a2378c4d9f6d402bd69d06ad9554

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4faa540343a001c6e2a585bb9ff2eee65fd9bd0539e9727a1e3df78da563a9dc
MD5 8cce1fb36560ace0dba975f59988d2d3
BLAKE2b-256 aea20309671da161716fc931132a0712db70bca4aca177781563299bd9c2ee3d

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 02b1faab375b74b96ad25406accd9f1f37ef8bd5576e6ceb454dbe86a376bec7
MD5 e408f8b269de2364bc209e4e1d1ebaae
BLAKE2b-256 50ecb75aed0fe6da2718afca858d33c2c71551028f7da58f63544d7986efabc2

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f814fcc3ce765fbd136ec9b150616b618f2458b17ba6f779099427baaafec8b
MD5 316bdd31e8cf542bd0237e05c57ba76d
BLAKE2b-256 99d01a4ce52f55d6e9cf17e8bc5c64f9429086b1be8810a473a63931b0756f34

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11408abe8363e641ce1a314e0498338da00a86e76a49f339a0e1697d5617f3f3
MD5 48b3181211dffb3012d5db263e19b971
BLAKE2b-256 ae229f88a887819ac957cb42325ad32cb7bce971e40f04dfc582de7f8debeb13

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d6f419b91b3701ad6c763284594a4b0c0a45c7eea3caa3f4540ed3c199b8a9e2
MD5 72a8735fc1f80ccf9c35d198583a9aa4
BLAKE2b-256 bbd123185b8174a17a7df7c092863e7f8a4a23f2cdbc7579d8b4657a2cdd2a00

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5238396782f0baa7bc3126d78bdca6803e7f511225df7fa381c4dfdc77eb2fcd
MD5 fa3651e32afd634efe4e6b345cd704b9
BLAKE2b-256 e6c3657da0bbda80eda7ae7b22d91a7e9dbea1de85d4306dde0f5c91588491c5

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 5f13eca1583fc0131a3a44cf409893e82b1fd0cb9e8780be44fb0d5e8d68202b
MD5 832ca716a267d588b3cf0bdc2a58f14d
BLAKE2b-256 657deb9d85373a5525429d387a9546b5cfcf20b049b8858913a9035944258a04

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2de235aefa42968d21ec35ec3927413f7e0360733770589fbff84aa8f7bb114
MD5 6b158e6c02284b3b329ead158f33da9c
BLAKE2b-256 f75037c5f8b30ed0dcd566a56e7ab2c803c2fd5ab514d8d6c687516e2fbb984c

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a444667693b85d92e3bc20d4550e5b4d54827513c016e4a46a3e0c9bd185dcec
MD5 70e173a552c70892fc3256db8bb4a5c8
BLAKE2b-256 49ed4aaa6f97e599280feef1006c38256958afd5186f6b7811468750850a856f

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c27ad5913bc0a871d81c4cfd58fed7c5d157ac112dada5e4a872f669712abc11
MD5 9d4ebba0e5a5da0ca79bf2b973475272
BLAKE2b-256 c6ef42643f147d7b2cdc7fd938c64a9f4b4fabd42bd9f66fed1846fee95c9cd3

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3c542f827e864b34fdeeb72a140c32743b3268905542299a543d588228f08b16
MD5 f818a4d803bc82cc8620f06a66c7a20d
BLAKE2b-256 1e6df6129094ce45f5706203e914ce0417a9c403276e3b372e504404f9ac5828

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 cf47676e52ae30d3761b02a850a4eca86ac4cab0c2a550cb2938d5c5d8949138
MD5 fbbe9d45ad20dbfda4d544c7f351abb9
BLAKE2b-256 afaad640c5a674b1853216076408132b72a7344ff97ba72bc55f467816bb9440

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 925716b2539413d12f2d4b597ca43e810beef17a58e26cb0851db46f9a2a5112
MD5 894cea29483c6250cb1e1835bdf67c3e
BLAKE2b-256 825a737d9e0d95a5e3ed2aec5a5ecd5c9df1fc40c744afdefc7d7467749ce3ad

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a308182aab14003d9db40879a6282bf4736dbbec72e191030e6283cc4334e9c7
MD5 29bc31cb06fe2828b6b3f0424f2d8965
BLAKE2b-256 6f42d8cb5840f37fc2be9e1cfb6eed392b58c2b7aaf3a5924f2d9c9c69f9312a

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 626e8086cdd4519d479a8d1173a96eb1a79d7882a059ddb7d4ddbd4d3ff5d46d
MD5 016fcc2106eef338822992fac557bcf0
BLAKE2b-256 28fddec91e642743f5509347d10b5011eddd799e1200e331e3f3d1eb2431e52d

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a5ddb405131694359d988181d2542aaeddaae2d6d62158133c487b0de7126ac9
MD5 6518e1d2b1923afa30e3ac888f4a8434
BLAKE2b-256 676498f112d081f7a7e9aca95ca9ca8c1a6a026867ceeb1a9131e0f0ee973c06

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: drizzle-2.0.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for drizzle-2.0.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 c51600901559ff96bd182a6e43c86b8f56d07f9b4288bfb2e7007da6a32328ca
MD5 7fe4faa7239d1e35f34a0b0a2bec288f
BLAKE2b-256 529e5cd2372d53a2a805e1609e62209aad5eb514f9a4f38724ef75d4b46bc124

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64e485e35601fda253754a3d9f4db527468d54bd80538d402b93fe03e7759cd9
MD5 2f351e69675aca54b81793460e1a02d6
BLAKE2b-256 4a11ddf7a91fb500806eea7814586804fcaa7a20870acf3ba47206bdaaad6940

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5dacbf6e375be13c9c70752d7e13482dd65625f225e10a281e345960b864bdf
MD5 317851fe8be9977ce4741f837955e6cf
BLAKE2b-256 4948f0c6b912fb9d410026372a7aa90c55b14ef98b4ada6eeb7e6bd1421cb99f

See more details on using hashes here.

File details

Details for the file drizzle-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 28975a7888e4b63a28ddc11f6312228b35148010e40e1327de31ecf2d9a2b024
MD5 5a78382bc613442c2e8f520b2b172886
BLAKE2b-256 424b11239e94fcf23c19551395f88c7640eb78262c853abc46cfe02f82af0fb1

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