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 3 of The DrizzlePac Handbook [Driz2025]

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.

[Driz2025]

Anand, G. S., Mack, J., et al., 2025, “The DrizzlePac Handbook”, Version 3.0, (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.1.0.tar.gz (117.1 kB view details)

Uploaded Source

Built Distributions

drizzle-2.1.0-cp313-cp313-win_amd64.whl (81.6 kB view details)

Uploaded CPython 3.13Windows x86-64

drizzle-2.1.0-cp313-cp313-win32.whl (73.3 kB view details)

Uploaded CPython 3.13Windows x86

drizzle-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

drizzle-2.1.0-cp313-cp313-macosx_11_0_arm64.whl (80.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

drizzle-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl (87.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

drizzle-2.1.0-cp312-cp312-win_amd64.whl (81.6 kB view details)

Uploaded CPython 3.12Windows x86-64

drizzle-2.1.0-cp312-cp312-win32.whl (73.3 kB view details)

Uploaded CPython 3.12Windows x86

drizzle-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

drizzle-2.1.0-cp312-cp312-macosx_11_0_arm64.whl (80.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

drizzle-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl (88.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

drizzle-2.1.0-cp311-cp311-win_amd64.whl (81.6 kB view details)

Uploaded CPython 3.11Windows x86-64

drizzle-2.1.0-cp311-cp311-win32.whl (73.2 kB view details)

Uploaded CPython 3.11Windows x86

drizzle-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

drizzle-2.1.0-cp311-cp311-macosx_11_0_arm64.whl (80.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

drizzle-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl (87.9 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

drizzle-2.1.0-cp310-cp310-win_amd64.whl (81.6 kB view details)

Uploaded CPython 3.10Windows x86-64

drizzle-2.1.0-cp310-cp310-win32.whl (73.3 kB view details)

Uploaded CPython 3.10Windows x86

drizzle-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (300.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

drizzle-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (80.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

drizzle-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl (87.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for drizzle-2.1.0.tar.gz
Algorithm Hash digest
SHA256 036997be3e07c77b03ddd8619194d09258a4a266a8bd1dee60d621361aed14d2
MD5 fc824091a74a6afb09a25c688eba0765
BLAKE2b-256 f05783dd7087dd8d28e7d6e6c98a049cafb4479c88ef6575cf90de399f62df06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 15e8c5b71e3106091a8c70074a499e604b8ff9a4b2301decd7f625ac32c99f39
MD5 68ef023f4313922aecdf8c9957776814
BLAKE2b-256 c0d0e94290b0b1882a157fa4590be37e16800766d37b47899489779183902972

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 83b6a97f97a9f45dd4e61fa3df604beefbbb73f9e8bf8e21df584466417f35ea
MD5 6ace1507c0f3b93e407e1249dbca67ad
BLAKE2b-256 126a34e85e741df37a482bec52eb83070aef0134436aeee194cc06c388e062fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 514974ccbe8471c1cfe9263814a28f66b0be8306ce629e62d643194d6b703dd4
MD5 89f26c119e34dfac560a3b28362e7f7a
BLAKE2b-256 9cab184d888a2653d9e079c6295246a7e2a4aab08a700975493c47aad00f6bdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f03864c6def31b72a4838c48f42209aaedeb5b50fd503abbc84f46589134436
MD5 b601183dcfc5e2d530ca65ad0dd5cb2d
BLAKE2b-256 ccdd563c5d1a367afa54b8d173e17a16c2516a7948df3ea79a1ffed4754621cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 fdd64dd5f58d2d77d8375772c7a50a7e13662c5091f2720eb4ff4c3700b1476d
MD5 ec27f893566cc79539c6fc5f1ee9c23d
BLAKE2b-256 7f67b054adc5bb0fd51977de093e354f9243ba079f4f29e3cda32899e5396712

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c2c20d910f5ada7541dd72e2e78ccc4e3984d47fe4f51235a8024f1b2e2ed6ef
MD5 7ad3879230b0976b1b298514b538a0e0
BLAKE2b-256 1993352bad235bc6cc43e435fdda314cff52a33477d04808879383d9bd4f7542

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 88e3f32da472f0ee2435d05285c14f75cfdfd4909fe37566d24d2d1e2a7bcb01
MD5 6240db040f82478c24d8b688889cb164
BLAKE2b-256 6466e1dbef15f6da2f7c9f61277ace14bd85066e8078631ba5b08f0c871b1e17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c124e6f13402cf1d39b1e30a0d0e6824883e7e0dee4d704802c216656417c229
MD5 d1872b59a47f04e94d0046d6fb6c8306
BLAKE2b-256 2e1ca3abf272d864b03c3d0840683f8eabba56c7e6098cfedfe2a5dac2f39960

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7282f96aae622198116f9c24495726f99e13ae3bfd93e93ccdda93e76aa098fa
MD5 fa43f833220157e01b349d89c3e633b8
BLAKE2b-256 88b06390126e099d330cf9691999c93c4938f31f775c36c43c6589b85744a3e9

See more details on using hashes here.

File details

Details for the file drizzle-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for drizzle-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 87becc95be73d4d440a8b6dd7e6b72b87f5632a65f9137778ad5fae37a139fdd
MD5 f955218c0584193b7693ecf0f5e638e9
BLAKE2b-256 71cdac8560b9a10990734b21bd54a95ecf4b8f4e86a5b2c0a864509732a50713

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a25308f75c860fbc612466947835c0cc6adffdd6d85a0577f26afd6ac03a3b70
MD5 0c9623e7b65ec7a2d850aa582e6f264c
BLAKE2b-256 511c8823b66f8e85f1d4f3e5e8a1d1b0c8fbf0bce8e99829d798a4c8183cd1bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 73.2 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 fc78bea1a1a839c6ea8b1be160abf2cbe959d02607f76d5183a4f912bb073506
MD5 71b57cf06f3be8eaba21f1b52673d504
BLAKE2b-256 a020cb3e95f9948e126df44ceaea44d28e9b5d9537d09b45599cb82a6333981c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43b76c708fa66cd7c4e99fdda795a560467dd417118c464af2527f75bc781aa3
MD5 da5445531f9e5a63271a6a7d0ef0481b
BLAKE2b-256 fc69c53e39eaa8d0f374324bdc8d052b82b73d250860f03e678657cee1161a53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0bfd5fe7c8f3852fbd1147b54ae20c8c19d0e1c18a3cff0b97f9fa89e767ed3f
MD5 ee7ddff37f71542d622d83cacd21ab0a
BLAKE2b-256 1c9b7bc30bcfa75c6eaa524dbad1f98c9acb3e8bcd0d98e1e8d8f16ce6b7fb3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e7f4749cf47274da95ed3c52eb17fcb4819458731a0eca4478dcc8d7dd070263
MD5 66452823a45ff0b6898204ae296dbee9
BLAKE2b-256 70f256806d715f0d5fb1ac6deecd09ca883779c4df15cddbe4af35fa47fcdc8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 844e996ee1f2d0f8e37fef1d5def35b403fdb585cab14b6e5ee034d2fe384027
MD5 8564d1637af81d76cc1423600e9c4db0
BLAKE2b-256 ce40481d8bf3d3441bb3adf93a152262b15f5496d82e361979691a317d5f786b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drizzle-2.1.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for drizzle-2.1.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 dc91b9f5ebde6c033859133c32fac7059d36fac36d706bc660f7a16374d5fe5c
MD5 bc2be94869393ef3c383943d186a56ec
BLAKE2b-256 dda32aa278d6768d0d9cb594fc34ea2ea06032d6d5452c38e9c19efa42f841ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8eeadde675070cf0dbbf7c45b6db70708b4edd5a1fc2f544825a80605c93973
MD5 54ef2976e9bcbba73dc6b280fd02e3e2
BLAKE2b-256 534345d46bc4caffa88969af4203723a9265d1fa11dbb2726a10420e9c82ff80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ae4d2acf2353c3d19fcc63ecca95d77f53fb5fc49df42527272232043bf56f2
MD5 48fd8c21a96b19913be94ea2218f4c1c
BLAKE2b-256 e5cf9575a4a6a35f024f8e7f100307ba22272def95c1ac12494b7964afb71aa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drizzle-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 42fdc0d980838b63da2b9c43083a0b9f1369a2b3ce631c0458d3321f32f9ef68
MD5 31aaecc2c24aa281026d0674b65e0ebe
BLAKE2b-256 236a393994a71e76b1be30697d8892afc78cae0e0ae4435282e686e42028b1cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page