High-Level Data Reduction Library: hdrl_elemop.h File Reference

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
Functions
hdrl_elemop.h File Reference
`#include "hdrl_types.h"`
`#include <cpl.h>`
Include dependency graph for hdrl_elemop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
CPL_BEGIN_DECLS cpl_error_code | hdrl_elemop_image_add_image (cpl_image *a, cpl_image *ae, const cpl_image *b, const cpl_image *be)
| add/subtract/multiply/divide two images with error propagation
cpl_error_code | hdrl_elemop_image_sub_image (cpl_image *a, cpl_image *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_image_mul_image (cpl_image *a, cpl_image *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_image_div_image (cpl_image *a, cpl_image *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_image_pow_image (cpl_image *a, cpl_image *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_image_add_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
| add/subtract/multiply/divide image and scalar with error propagation
cpl_error_code | hdrl_elemop_image_sub_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
cpl_error_code | hdrl_elemop_image_mul_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
cpl_error_code | hdrl_elemop_image_div_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
cpl_error_code | hdrl_elemop_image_pow_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
cpl_error_code | hdrl_elemop_image_exp_scalar (cpl_image *a, cpl_image *ae, const hdrl_data_t b, const hdrl_error_t be)
cpl_error_code | hdrl_elemop_imagelist_add_imagelist (cpl_imagelist *a, cpl_imagelist *ae, const cpl_imagelist *b, const cpl_imagelist *be)
| add/subtract/multiply/divide two imagelists and scalar with error propagation
cpl_error_code | hdrl_elemop_imagelist_sub_imagelist (cpl_imagelist *a, cpl_imagelist *ae, const cpl_imagelist *b, const cpl_imagelist *be)
cpl_error_code | hdrl_elemop_imagelist_mul_imagelist (cpl_imagelist *a, cpl_imagelist *ae, const cpl_imagelist *b, const cpl_imagelist *be)
cpl_error_code | hdrl_elemop_imagelist_div_imagelist (cpl_imagelist *a, cpl_imagelist *ae, const cpl_imagelist *b, const cpl_imagelist *be)
cpl_error_code | hdrl_elemop_imagelist_pow_imagelist (cpl_imagelist *a, cpl_imagelist *ae, const cpl_imagelist *b, const cpl_imagelist *be)
cpl_error_code | hdrl_elemop_imagelist_add_vector (cpl_imagelist *a, cpl_imagelist *ae, const cpl_vector *b, const cpl_vector *be)
| add/subtract/multiply/divide each image of an imagelist and a scalar from a vector with error propagation
cpl_error_code | hdrl_elemop_imagelist_sub_vector (cpl_imagelist *a, cpl_imagelist *ae, const cpl_vector *b, const cpl_vector *be)
cpl_error_code | hdrl_elemop_imagelist_mul_vector (cpl_imagelist *a, cpl_imagelist *ae, const cpl_vector *b, const cpl_vector *be)
cpl_error_code | hdrl_elemop_imagelist_div_vector (cpl_imagelist *a, cpl_imagelist *ae, const cpl_vector *b, const cpl_vector *be)
cpl_error_code | hdrl_elemop_imagelist_pow_vector (cpl_imagelist *a, cpl_imagelist *ae, const cpl_vector *b, const cpl_vector *be)
cpl_error_code | hdrl_elemop_imagelist_add_image (cpl_imagelist *a, cpl_imagelist *ae, const cpl_image *b, const cpl_image *be)
| add/subtract/multiply/divide each image of an imagelist and an image with error propagation
cpl_error_code | hdrl_elemop_imagelist_sub_image (cpl_imagelist *a, cpl_imagelist *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_imagelist_mul_image (cpl_imagelist *a, cpl_imagelist *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_imagelist_div_image (cpl_imagelist *a, cpl_imagelist *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_imagelist_pow_image (cpl_imagelist *a, cpl_imagelist *ae, const cpl_image *b, const cpl_image *be)
cpl_error_code | hdrl_elemop_add (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| add two arrays of with error propagation in place
cpl_error_code | hdrl_elemop_sub (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| subtract two arrays of with error propagation in place
cpl_error_code | hdrl_elemop_mul (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| multiply two arrays of with error propagation in place
cpl_error_code | hdrl_elemop_div (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| divide two arrays of with error propagation in place
cpl_error_code | hdrl_elemop_pow (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| power of two arrays of with error propagation in place
cpl_error_code | hdrl_elemop_pow_inverted (hdrl_data_t *a, hdrl_error_t *ea, size_t na, const hdrl_data_t *b, const hdrl_error_t *eb, size_t nb, const cpl_binary *mask)
| power of two arrays of with error propagation in place

## Function Documentation

## ◆ hdrl_elemop_add()

cpl_error_code hdrl_elemop_add | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

add two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = a + b e = hypot(ea, eb) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)

## ◆ hdrl_elemop_div()

cpl_error_code hdrl_elemop_div | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

divide two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = a / b e = hypot(ea / b, eb * a / (b * b)) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)

unlike cpl_image_divide pixels which are divided by zero are set to NAN and not marked as bad.

## ◆ hdrl_elemop_image_add_image()

CPL_BEGIN_DECLS cpl_error_code hdrl_elemop_image_add_image | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

add/subtract/multiply/divide two images with error propagation

Parameters

  a | image, modified in place
  ae | errors of image a, modified in place
  b | image
  be | errors of image b

Gaussian error propagation of first order, no accounting correlation besides a == b. Divisions by zero will be marked as bad pixels and set to NAN

## ◆ hdrl_elemop_image_add_scalar()

cpl_error_code hdrl_elemop_image_add_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

add/subtract/multiply/divide image and scalar with error propagation

Parameters

  a | image, modified in place
  ae | errors of image a, modified in place
  b | scalar
  be | error of scalar b

Gaussian error propagation of first order, no accounting correlation besides a == b. Divisions by zero will be marked as bad pixels and set to NAN

## ◆ hdrl_elemop_image_div_image()

cpl_error_code hdrl_elemop_image_div_image | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_image_div_scalar()

cpl_error_code hdrl_elemop_image_div_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

## ◆ hdrl_elemop_image_exp_scalar()

cpl_error_code hdrl_elemop_image_exp_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

## ◆ hdrl_elemop_image_mul_image()

cpl_error_code hdrl_elemop_image_mul_image | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_image_mul_scalar()

cpl_error_code hdrl_elemop_image_mul_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

## ◆ hdrl_elemop_image_pow_image()

cpl_error_code hdrl_elemop_image_pow_image | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_image_pow_scalar()

cpl_error_code hdrl_elemop_image_pow_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

## ◆ hdrl_elemop_image_sub_image()

cpl_error_code hdrl_elemop_image_sub_image | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_image_sub_scalar()

cpl_error_code hdrl_elemop_image_sub_scalar | ( | cpl_image * | a,
|  | cpl_image * | ae,
|  | const hdrl_data_t | b,
|  | const hdrl_error_t | be
| ) |  |

## ◆ hdrl_elemop_imagelist_add_image()

cpl_error_code hdrl_elemop_imagelist_add_image | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

add/subtract/multiply/divide each image of an imagelist and an image with error propagation

Parameters

  a | imagelist, modified in place
  ae | errors of imagelist a, modified in place
  b | image
  be | error of image b

Gaussian error propagation of first order, no accounting correlation besides a == b. Divisions by zero will be marked as bad pixels and set to NAN

## ◆ hdrl_elemop_imagelist_add_imagelist()

cpl_error_code hdrl_elemop_imagelist_add_imagelist | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_imagelist * | b,
|  | const cpl_imagelist * | be
| ) |  |

add/subtract/multiply/divide two imagelists and scalar with error propagation

Parameters

  a | imagelist, modified in place
  ae | errors of imagelist a, modified in place
  b | imagelist
  be | error of imagelist b

Gaussian error propagation of first order, no accounting correlation besides a == b. Divisions by zero will be marked as bad pixels and set to NAN

## ◆ hdrl_elemop_imagelist_add_vector()

cpl_error_code hdrl_elemop_imagelist_add_vector | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_vector * | b,
|  | const cpl_vector * | be
| ) |  |

add/subtract/multiply/divide each image of an imagelist and a scalar from a vector with error propagation

Parameters

  a | imagelist, modified in place
  ae | errors of imagelist a, modified in place
  b | vector
  be | error of vector b

Gaussian error propagation of first order, no accounting correlation besides a == b. Divisions by zero will be marked as bad pixels and set to NAN

## ◆ hdrl_elemop_imagelist_div_image()

cpl_error_code hdrl_elemop_imagelist_div_image | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_div_imagelist()

cpl_error_code hdrl_elemop_imagelist_div_imagelist | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_imagelist * | b,
|  | const cpl_imagelist * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_div_vector()

cpl_error_code hdrl_elemop_imagelist_div_vector | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_vector * | b,
|  | const cpl_vector * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_mul_image()

cpl_error_code hdrl_elemop_imagelist_mul_image | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_mul_imagelist()

cpl_error_code hdrl_elemop_imagelist_mul_imagelist | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_imagelist * | b,
|  | const cpl_imagelist * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_mul_vector()

cpl_error_code hdrl_elemop_imagelist_mul_vector | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_vector * | b,
|  | const cpl_vector * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_pow_image()

cpl_error_code hdrl_elemop_imagelist_pow_image | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_pow_imagelist()

cpl_error_code hdrl_elemop_imagelist_pow_imagelist | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_imagelist * | b,
|  | const cpl_imagelist * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_pow_vector()

cpl_error_code hdrl_elemop_imagelist_pow_vector | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_vector * | b,
|  | const cpl_vector * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_sub_image()

cpl_error_code hdrl_elemop_imagelist_sub_image | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_image * | b,
|  | const cpl_image * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_sub_imagelist()

cpl_error_code hdrl_elemop_imagelist_sub_imagelist | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_imagelist * | b,
|  | const cpl_imagelist * | be
| ) |  |

## ◆ hdrl_elemop_imagelist_sub_vector()

cpl_error_code hdrl_elemop_imagelist_sub_vector | ( | cpl_imagelist * | a,
|  | cpl_imagelist * | ae,
|  | const cpl_vector * | b,
|  | const cpl_vector * | be
| ) |  |

## ◆ hdrl_elemop_mul()

cpl_error_code hdrl_elemop_mul | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

multiply two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = a * b e = hypot(a * eb, b * ea) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)

## ◆ hdrl_elemop_pow()

cpl_error_code hdrl_elemop_pow | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

power of two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = pow(a, b) e = pow(a, b) * sqrt((a / b * ea)^2 + (ln(a) * eb)^2) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)

if b < 0 and a == 0 the result is NAN for a < 0 and eb != 0 the error is not well defined

## ◆ hdrl_elemop_pow_inverted()

cpl_error_code hdrl_elemop_pow_inverted | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

power of two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = pow(b, a) e = pow(b, a) * sqrt((b / a * eb)^2 + (ln(b) * ea)^2) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)

if a < 0 and b == 0 the result is NAN for b < 0 and ea != 0 the error is not well defined

## ◆ hdrl_elemop_sub()

cpl_error_code hdrl_elemop_sub | ( | hdrl_data_t * | a,
|  | hdrl_error_t * | ea,
|  | size_t | na,
|  | const hdrl_data_t * | b,
|  | const hdrl_error_t * | eb,
|  | size_t | nb,
|  | const cpl_binary * | mask
| ) |  |

subtract two arrays of with error propagation in place

Parameters

  a | array of values of size na
  ea | array of errors of a
  na | size of a arrays
  b | array of values of size nb
  eb | array of errors of b
  nb | size of b array, must be equal to na or 1
  mask | bad pixel mask, positions where it is true are not modified

a = a - b e = hypot(ea, eb) error propagation of first order, correlations not considered except for the a === b case (correlation = 1)