HDRL C → PyHDRL

This page is the front door for developers who already know HDRL or CPL in C.

Indexing and ownership

  • Pixel indexing is 0-based with order (y, x), matching PyCPL.

  • Rectangular HDRL regions (for example overscan regions) and the fixed-pattern noise DC-mask dimensions retain the C/FITS 1-based convention where documented.

  • hdrl.core.Image holds a data plane and an error plane. Arithmetic methods that end in _create return a new image; methods without that suffix modify in place. hdrl.core.Spectrum1D follows the same pattern.

  • There is no hdrl.core.Image.load. Load FITS with cpl.core.Image.load (or related PyCPL I/O), then copy the data and error planes into hdrl.core.Image(data, error). Construction copies both planes: later changes to the original PyCPL images do not affect the HDRL image. The error-plane bad-pixel mask is ignored; the data-plane mask becomes the HDRL image mask.

  • hdrl.func.Flat.compute follows the HDRL C memory-saving contract: it consumes the input ImageList and leaves its contents undefined.

Types

HDRL / CPL C

PyHDRL / PyCPL

hdrl_image

hdrl.core.Image

hdrl_imagelist

hdrl.core.ImageList

hdrl_spectrum1D

hdrl.core.Spectrum1D

hdrl_value (data/error)

Value namedtuples with data, error and the Python-side invalid flag

cpl_image

cpl.core.Image

cpl_imagelist

cpl.core.ImageList

cpl_mask

cpl.core.Mask

cpl_filter_mode

cpl.core.Filter

cpl_border_mode

cpl.core.Border

hdrl_parameter

Algorithm classes and *Parameter types

Errors

CPL error codes raised from HDRL are translated to subclasses of hdrl.core.Error. See Errors for the full table. They are the same codes as in CPL; only the Python namespace differs from PyCPL.

Algorithm name map

Factory / compute style (preferred for most algorithms):

HDRL C (typical)

PyHDRL

hdrl_overscan_*

hdrl.func.Overscan

hdrl_imagelist_collapse_*

hdrl.func.Collapse and ImageList.collapse_*

hdrl_flat_compute

hdrl.func.Flat.compute

hdrl_bpm_*

hdrl.func.BPM*

hdrl_lacosmic_*

hdrl.func.LaCosmic

hdrl_strehl_compute

hdrl.func.Strehl.compute

hdrl_fringe_*

hdrl.func.Fringe

hdrl_catalogue_*

hdrl.func.Catalogue

hdrl_efficiency_*

hdrl.func.Efficiency

hdrl_response_*

hdrl.func.Response

hdrl_dar_*

hdrl.func.Dar

hdrl_utils_airmass / hdrl_airmass_approx

hdrl.func.Airmass.compute / hdrl.func.AirmassApprox

hdrl_fpn_compute

hdrl.func.fpn_compute (module function)

hdrl_resample_*

hdrl.func.Resample

hdrl_maglim_*

hdrl.func.Maglim

hdrl_barycorr_*

hdrl.func.Barycorr

Bias and dark chapters in the HDRL manual have no dedicated PyHDRL classes; use hdrl.func.Collapse (and optionally Overscan) as in the High-level algorithms.

Fixed-pattern noise is intentionally a module function (hdrl.func.fpn_compute) rather than a class, matching the single-shot C API.

What is not bound

PyHDRL focuses on the high-level HDRL API used by pipeline recipes, but it also exposes selected experimental interfaces. In particular, Spectrum1DResampleMethod.FitWindowed, Spectrum1D.resample_windowed_fit and Efficiency.compute_response_core correspond to HDRL interfaces whose C API is not guaranteed to be stable. The HDRL manual recommends that windowed spectrum fitting not be used in production.

Interfaces not currently bound include:

  • recipe parameter-list creation/parsing helpers (*_create_parlist and *_parse_parlist);

  • low-level imagelist views, frame iterators and multi-iterators;

  • EOP download/conversion helpers such as hdrl_download_url_to_buffer and hdrl_eop_data_totable;

  • private airmass helpers such as hdrl_get_zenith_distance and hdrl_get_airmass_*; and

  • HDRL APIs without an agreed stable Python design.

The High-level algorithms list is the supported high-level algorithm set for this release; hdrl.core additionally documents the bound core and spectrum operations.