High-Level Data Reduction Library: Resample 2D/3D images/cubes

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

Loading...
Searching...
No Matches
Modules | Functions
Resample 2D/3D images/cubes

Algorithms to resample 2D images and 3D cubes onto a common grid based on the MUSE code. More...

Collaboration diagram for Resample 2D/3D images/cubes:

## Modules
| HDRL parameter - interpolation method
| HDRL parameter controlling the interpolation method.
| HDRL parameter - output grid
| Hdrl parameter defining the final output grid.

## Functions
hdrl_resample_result * | hdrl_resample_compute (const cpl_table *ResTable, hdrl_parameter *method, hdrl_parameter *outputgrid, const cpl_wcs *wcs)
| High level resampling function.
void | hdrl_resample_result_delete (hdrl_resample_result *aCube)
| Deallocates the memory associated to a hdrl_resample_result object.
cpl_table * | hdrl_resample_image_to_table (const hdrl_image *hima, const cpl_wcs *wcs)
| Convert a hdrl image into a cpl table that can be given as input to hdrl_resample_compute()
cpl_table * | hdrl_resample_imagelist_to_table (const hdrl_imagelist *himlist, const cpl_wcs *wcs)
| Convert a hdrl imagelist into a cpl table that can be given as input to hdrl_resample_compute().

## Detailed Description

Algorithms to resample 2D images and 3D cubes onto a common grid based on the MUSE code.

The routine currently implements the following algorithms:

- Nearest neighbor resampling
- Weighted resampling using Renka weighting function
- Weighted resampling using inverse distance weighting function
- Weighted resampling using quadratic inverse distance weighting function
- Weighted resampling using a drizzle-like weighting scheme
- Weighted resampling using a lanczos-like restricted sinc for weighting

The 2D and 3D interpolation is done in 2 dimension and 3 dimension, respectively. Moreover, additional error based weights can be taken into account.

The calculation is performed by calling the top-level function hdrl_resample_compute(). The latter does not directly work on images but on a cpl table. The table is created from a 2D image by calling the function hdrl_resample_image_to_table() or from a 3D cube by calling the function hdrl_resample_imagelist_to_table(). The advantage of this is that the user can combine many images/cubes into a single table and perform the interpolation based on all information in one step.

Beside the world coordinate system (wcs), there are two hdrl_parameter passed to the function, one controlling the interpolation method and one defining the output grid.

The parameter controlling the interpolation method can be created by

- hdrl_resample_parameter_create_nearest(), or
- hdrl_resample_parameter_create_renka(), or
- hdrl_resample_parameter_create_linear(), or
- hdrl_resample_parameter_create_quadratic(), or
- hdrl_resample_parameter_create_drizzle(), or
- hdrl_resample_parameter_create_lanczos()

that sets the interpolation method one would like to use.

The parameter controlling the output grid can be created by

- hdrl_resample_parameter_create_outgrid2D(), or
- hdrl_resample_parameter_create_outgrid3D(), or
- hdrl_resample_parameter_create_outgrid2D_userdef(), or
- hdrl_resample_parameter_create_outgrid3D_userdef()

depending on a 2D or 3D interpolation and if the user wants to specify the final output grid on a high granularity or the hdrl routine should derive it from the input data.

## Function Documentation

## ◆ hdrl_resample_compute()

hdrl_resample_result * hdrl_resample_compute | ( | const cpl_table * | ResTable,
|  | hdrl_parameter * | method,
|  | hdrl_parameter * | outputgrid,
|  | const cpl_wcs * | wcs
| ) |  |

High level resampling function.

Parameters

  ResTable | The cpl table to be resampled. Should be derived by the hdrl_resample_imagelist_to_table() or by the hdrl_resample_image_to_table() function.
  method | The hdrl parameter defining the resampling method
  outputgrid | The hdrl parameter defining the output grid
  wcs | The cpl wcs parameter do derive scalings/normalisations

Returns
  The hdrl_resample_result structure containing all informations of the resampled output (data, error, bpm, wcs encoded in a cpl_propertylist). The returned hdrl_resample_result structure must be deleted with hdrl_resample_result_delete()

The routine currently implements the following algorithms:

- Nearest neighbor resampling
- Weighted resampling using Renka weighting function
- Weighted resampling using inverse distance weighting function
- Weighted resampling using quadratic inverse distance weighting function
- Weighted resampling using a drizzle-like weighting scheme
- Weighted resampling using a lanczos-like restricted sinc for weighting

The 2D and 3D interpolation is done in 2 dimension and 3 dimension, respectively. Moreover, additional error based weights can be taken into account.

As can be seen from the interface, this function does not directly work on images but on the cpl table ResTable. The table is created from a 2D image by calling the function hdrl_resample_image_to_table() or from a 3D cube by calling the function hdrl_resample_imagelist_to_table(). In case you create the table on your own without the above mentioned functions, make sure to flag all(!) non normal pixels as bad (e.g. by using the isfinite() function).

The parameter controlling the interpolation method (method) is created with

- hdrl_resample_parameter_create_nearest(), or
- hdrl_resample_parameter_create_renka(), or
- hdrl_resample_parameter_create_linear(), or
- hdrl_resample_parameter_create_quadratic(), or
- hdrl_resample_parameter_create_drizzle(), or
- hdrl_resample_parameter_create_lanczos()

depending on the interpolation method one would like to use.

The parameter controlling the output grid (outputgrid) is created with

- hdrl_resample_parameter_create_outgrid2D(), or
- hdrl_resample_parameter_create_outgrid3D(), or
- hdrl_resample_parameter_create_outgrid2D_userdef(), or
- hdrl_resample_parameter_create_outgrid3D_userdef()

depending on a 2D or 3D interpolation and if the user wants to specify the final output grid on a high granularity or the hdrl routine should derive it from the input data.

## ◆ hdrl_resample_image_to_table()

cpl_table * hdrl_resample_image_to_table | ( | const hdrl_image * | hima,
|  | const cpl_wcs * | wcs
| ) |  |

Convert a hdrl image into a cpl table that can be given as input to hdrl_resample_compute()

Parameters

  hima | hdrl_image containing the data/error/bpm
  wcs | The world coordinate system used for the conversion

Returns
  cpl_table that is used by the hdrl_resample_compute() function

## ◆ hdrl_resample_imagelist_to_table()

cpl_table * hdrl_resample_imagelist_to_table | ( | const hdrl_imagelist * | himlist,
|  | const cpl_wcs * | wcs
| ) |  |

Convert a hdrl imagelist into a cpl table that can be given as input to hdrl_resample_compute().

Parameters

  himlist | hdrl_imagelist containing the data/error/bpm
  wcs | The world coordinate system used for the conversion

Returns
  cpl_table that is used by the hdrl_resample_compute() function

## ◆ hdrl_resample_result_delete()

void hdrl_resample_result_delete | ( | hdrl_resample_result * | aCube | ) |

Deallocates the memory associated to a hdrl_resample_result object.

Parameters

  aCube | input hdrl_resample_result object