{"id":23634,"library":"drizzle","title":"Drizzle","description":"A Python package for combining dithered astronomical images into a single image, supporting various kernels and error propagation. Current version is 2.2.0, requires Python >=3.10. Maintenance-led releases from STScI.","status":"active","version":"2.2.0","language":"python","source_language":"en","source_url":"https://github.com/spacetelescope/drizzle","tags":["astronomy","image-processing","drizzle","stsc"],"install":[{"cmd":"pip install drizzle","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import of the top-level package is the standard entry point.","symbol":"drizzle","correct":"import drizzle"},{"note":"cdriz is a submodule; direct import fails.","wrong":"import cdriz","symbol":"cdriz","correct":"from drizzle import cdriz"},{"note":"blot is a high-level function in drizzle, not a submodule.","wrong":"from drizzle.blot import blot","symbol":"blot","correct":"from drizzle import blot"},{"note":"Module 'util' was deprecated in 2.0.0 and removed; use cdriz or other public APIs.","wrong":"from drizzle import util","symbol":"util","correct":"from drizzle import cdriz"}],"quickstart":{"code":"import numpy as np\nfrom drizzle import drizzle\n\n# Create two simple dither images (2x2 each)\nimg1 = np.array([[1.0, 2.0], [3.0, 4.0]])\nimg2 = np.array([[1.5, 2.5], [3.5, 4.5]])\n\n# Define WCS-like parameters: output shape, input/output pixel scales\n# This is a minimal example; real usage requires proper WCS objects.\nout_shape = (4, 4)\noutput = np.zeros(out_shape)\n\n# Drizzle the images (example with square kernel)\ndrizzle.do_drizzle(output, img1, '1,1', '1,1', '1,1', 1.0, 1.0, kernel='square', pixfrac=1.0)\nprint(output)","lang":"python","description":"Minimal drizzling example using synthetic 2x2 images. Adjust WCS parameters for real data."},"warnings":[{"fix":"If upgrading from 1.x, refactor code to remove imports from drizzle.util; use the new I/O agnostic API. For JWST/Roman users, existing code may work; otherwise check pipeline documentation.","message":"Version 2.0.0 redesigned the API: removed FITS-specific code, deprecated the 'util' module, removed support for 'tophat' kernel. Backward compatibility maintained only for JWST and Roman pipelines.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace imports from drizzle.util with the corresponding public API functions (e.g., cdriz, drizzle.do_drizzle).","message":"The 'util' module is deprecated since 2.0.0 and will be removed in a future release. Do not import from drizzle.util.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use 'square', 'point', or 'turbo' kernels for flux conservation. If you must use Lanczos, be aware of the warning and consider calibration.","message":"The 'gaussian', 'lanczos2', and 'lanczos3' kernels are not flux conserving. Using them will produce incorrect photometric results.","severity":"gotcha","affected_versions":"All"},{"fix":"Do not rely on pixfrac with Lanczos. The warning is emitted automatically.","message":"The 'pixfrac' parameter is ignored when using the Lanczos kernel, as noted in a warning added in v2.2.0. Specify pixfrac only for other kernels; Lanczos always uses its own interpolation.","severity":"gotcha","affected_versions":">=2.2.0"},{"fix":"Replace kernel='tophat' with kernel='square'.","message":"The 'tophat' kernel was deprecated in 1.15.0 and removed in 2.0.0. Use 'square' or another supported kernel.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure input images are in units of counts per second (cps) or handle exposure time separately.","message":"Exposure time is undefined when in_units are not 'cps' (counts per second). The code may produce unexpected output if you pass non-cps data without proper scaling.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Import from other drizzle submodules like cdriz or use the main drizzle.do_drizzle. Do not import from drizzle.util.","cause":"The 'util' module was deprecated and removed in v2.0.0.","error":"AttributeError: module 'drizzle' has no attribute 'util'"},{"fix":"Run pip install --upgrade drizzle to ensure the C extensions are built. Then use: from drizzle import cdriz","cause":"cdriz is a C extension; incorrect import path if not installed properly or if using an older version.","error":"ImportError: cannot import name 'cdriz' from 'drizzle'"},{"fix":"Check the function signature: use positional arguments or check documentation for new argument names like 'fill_value'.","cause":"fillval was renamed or removed in a newer version. In 2.0.0, the API changed; fillval might not be a valid argument.","error":"TypeError: do_drizzle() got an unexpected keyword argument 'fillval'"},{"fix":"Use kernel='square' (the replacement) or another supported kernel.","cause":"The 'tophat' kernel was removed in v2.0.0.","error":"ValueError: Unsupported kernel 'tophat'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}