ERIS Pipeline Reference Manual 1.9.2
Functions
IFU Debugging and Diagnostic Functions

Functions

cpl_error_code eris_ifu_debug_header (const cpl_propertylist *header)
 Print all properties in a propertylist for debugging.
 
cpl_error_code eris_ifu_debug_frameset (const cpl_frameset *frameset)
 Print all frames in a frameset for debugging.
 
cpl_error_code eris_ifu_debug_parameterlist (const cpl_parameterlist *plist)
 Print all parameters in a parameterlist for debugging.
 
cpl_error_code eris_ifu_debug_propertylist (const cpl_propertylist *plist)
 Print all properties in a propertylist for debugging.
 
cpl_error_code eris_ifu_debug_frame (const cpl_frame *frame)
 Print frame information for debugging.
 
cpl_error_code eris_ifu_debug_cube (const cpl_imagelist *imglist)
 Print all images in an imagelist for debugging.
 
cpl_error_code eris_ifu_debug_image (const cpl_image *img)
 Print all pixel values in an image for debugging.
 
cpl_error_code eris_ifu_debug_vector (const cpl_vector *vec)
 Print all values in a vector for debugging.
 
cpl_error_code eris_ifu_debug_array (const cpl_array *arr)
 Print all values in an array for debugging.
 
cpl_error_code eris_ifu_debug_table (const cpl_table *table)
 Print all values in a table for debugging.
 
cpl_error_code eris_ifu_plot_vector (const char *pre, const char *opt, const cpl_vector *vector)
 Plot a vector for debugging.
 
cpl_error_code eris_ifu_plot_vectors_xy (const char *pre, const char *opt, const cpl_vector *x, const cpl_vector *y)
 Plot vector y against vector x for debugging.
 
cpl_error_code eris_ifu_plot_vectors2 (const char *pre, const char **opt, const cpl_vector *x, const cpl_vector *y1, const cpl_vector *y2)
 Plot two y-vectors against an x-vector for debugging.
 
cpl_error_code eris_ifu_plot_image (const char *pre, const char *opt, const cpl_image *img)
 Plot an image for debugging.
 

Detailed Description

This module provides debugging and diagnostic functions for printing and plotting various CPL data structures. These functions are primarily intended for development and troubleshooting purposes.

Synopsis:
#include "eris_ifu_debug.h"

Function Documentation

◆ eris_ifu_debug_array()

cpl_error_code eris_ifu_debug_array ( const cpl_array *  arr)

Print all values in an array for debugging.

Parameters
arrThe array to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All values contained in the array are printed for debugging purposes. Supports arrays of type CPL_TYPE_INT and CPL_TYPE_DOUBLE.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if arr is NULL
Note
Unsupported array types will generate a warning message.

Definition at line 549 of file eris_ifu_debug.c.

References CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_debug_cube()

cpl_error_code eris_ifu_debug_cube ( const cpl_imagelist *  imglist)

Print all images in an imagelist for debugging.

Parameters
imglistThe imagelist to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All images contained in the imagelist are printed for debugging purposes by calling eris_ifu_debug_image() for each image.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if imglist is NULL
Note
This function may generate very large amounts of output for large image lists or large images. Use with caution.

Definition at line 404 of file eris_ifu_debug.c.

References BRK_IF_ERROR, CATCH, CATCH_MSG, CHECK_ERROR_STATE, eris_ifu_debug_image(), and TRY.

◆ eris_ifu_debug_frame()

cpl_error_code eris_ifu_debug_frame ( const cpl_frame *  frame)

Print frame information for debugging.

Parameters
frameThe frame to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

The CPL_FRAME_TYPE, CPL_FRAME_LEVEL, and CPL_FRAME_GROUP of the frame are printed for debugging purposes, along with the filename and tag.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if frame is NULL

Definition at line 289 of file eris_ifu_debug.c.

References CATCH, CATCH_MSG, CHECK_ERROR_STATE, GET_NEW_ERROR, RECOVER, and TRY.

Referenced by eris_ifu_debug_frameset().

◆ eris_ifu_debug_frameset()

cpl_error_code eris_ifu_debug_frameset ( const cpl_frameset *  frameset)

Print all frames in a frameset for debugging.

Parameters
framesetThe frameset to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All frames contained in the frameset are printed for debugging purposes, including their filenames, tags, types, groups, and levels.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if frameset is NULL
Note
This function calls eris_ifu_debug_frame() for each frame in the set.

Definition at line 118 of file eris_ifu_debug.c.

References BRK_IF_NULL, CATCH, CATCH_MSG, CHECK_ERROR_STATE, eris_ifu_debug_frame(), GET_NEW_ERROR, RECOVER, and TRY.

◆ eris_ifu_debug_header()

cpl_error_code eris_ifu_debug_header ( const cpl_propertylist *  header)

Print all properties in a propertylist for debugging.

Parameters
headerThe propertylist to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All properties contained in the propertylist are printed as pairs of keyword and data for debugging purposes. The output is only generated when the message level is set to debug.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if header is NULL
Note
This function is for debugging purposes only and may generate large amounts of output for property lists with many entries.

Definition at line 46 of file eris_ifu_debug.c.

References BRK_IF_NULL, CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_debug_image()

cpl_error_code eris_ifu_debug_image ( const cpl_image *  img)

Print all pixel values in an image for debugging.

Parameters
imgThe image to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All pixel values contained in the image are printed for debugging purposes. Values are printed row by row.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if img is NULL
Note
This function may generate extremely large amounts of output for large images. Use only with small test images.
Uses a fixed buffer size which may overflow for very wide images.

Definition at line 449 of file eris_ifu_debug.c.

References CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

Referenced by eris_ifu_debug_cube().

◆ eris_ifu_debug_parameterlist()

cpl_error_code eris_ifu_debug_parameterlist ( const cpl_parameterlist *  plist)

Print all parameters in a parameterlist for debugging.

Parameters
plistThe parameterlist to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All parameters contained in the parameterlist are printed for debugging purposes, showing both current values and default values in the format "Parameter name: value [default]".

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if plist is NULL
  • CPL_ERROR_INVALID_TYPE if a parameter has an unsupported type
Note
Output is sent to stdout, not through the CPL messaging system.

Definition at line 174 of file eris_ifu_debug.c.

References BRK_WITH_ERROR, CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_debug_propertylist()

cpl_error_code eris_ifu_debug_propertylist ( const cpl_propertylist *  plist)

Print all properties in a propertylist for debugging.

Parameters
plistThe propertylist to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All properties contained in the propertylist are printed for debugging purposes using cpl_propertylist_dump().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if plist is NULL

Definition at line 250 of file eris_ifu_debug.c.

References CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_debug_table()

cpl_error_code eris_ifu_debug_table ( const cpl_table *  table)

Print all values in a table for debugging.

Parameters
tableThe table to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All values contained in the table are printed for debugging purposes using cpl_table_dump().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if table is NULL

Definition at line 622 of file eris_ifu_debug.c.

References CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_debug_vector()

cpl_error_code eris_ifu_debug_vector ( const cpl_vector *  vec)

Print all values in a vector for debugging.

Parameters
vecThe vector to print
Returns
CPL_ERROR_NONE on success, otherwise an error code

All values contained in the vector are printed for debugging purposes, one value per line.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if vec is NULL

Definition at line 500 of file eris_ifu_debug.c.

References BRK_IF_NULL, CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_plot_image()

cpl_error_code eris_ifu_plot_image ( const char *  pre,
const char *  opt,
const cpl_image *  img 
)

Plot an image for debugging.

Parameters
preOptional string with pre-plot commands (gnuplot syntax)
optOptional string with plotting options (gnuplot syntax)
imgThe image to plot
Returns
CPL_ERROR_NONE on success, otherwise an error code

Plots an image only if the message level is CPL_MSG_DEBUG. Uses gnuplot for visualization with appropriate 2D plotting settings.

Possible cpl_error_code set in this function:

  • Any error code possibly set by cpl_plot_image()
Note
Plotting only occurs when CPL_MSG_DEBUG level is active and img is not NULL.
Requires gnuplot to be available on the system.

Definition at line 878 of file eris_ifu_debug.c.

References BRK_IF_ERROR, CATCH, CATCH_MSG, and TRY.

◆ eris_ifu_plot_vector()

cpl_error_code eris_ifu_plot_vector ( const char *  pre,
const char *  opt,
const cpl_vector *  vector 
)

Plot a vector for debugging.

Parameters
preOptional string with pre-plot commands (gnuplot syntax)
optOptional string with plotting options (gnuplot syntax)
vectorThe vector to plot
Returns
CPL_ERROR_NONE on success, otherwise an error code

Plots a vector only if the message level is CPL_MSG_DEBUG. Uses gnuplot for visualization. On Darwin/macOS systems, automatically sets the terminal to x11.

Possible cpl_error_code set in this function:

  • Any error code possibly set by cpl_plot_vector()
Note
Plotting only occurs when CPL_MSG_DEBUG level is active and vector is not NULL.
Requires gnuplot to be available on the system.

Definition at line 665 of file eris_ifu_debug.c.

References BRK_IF_ERROR, CATCH, CATCH_MSG, and TRY.

◆ eris_ifu_plot_vectors2()

cpl_error_code eris_ifu_plot_vectors2 ( const char *  pre,
const char **  opt,
const cpl_vector *  x,
const cpl_vector *  y1,
const cpl_vector *  y2 
)

Plot two y-vectors against an x-vector for debugging.

Parameters
preOptional string with pre-plot commands (gnuplot syntax)
optOptional array of strings with plotting options for each plot
xThe x-axis vector
y1The first y-axis vector to plot
y2The second y-axis vector to plot
Returns
CPL_ERROR_NONE on success, otherwise an error code

Plots two y-vectors (y1 and y2) against a common x-vector in the same plot, only if the message level is CPL_MSG_DEBUG. Uses gnuplot for visualization.

Possible cpl_error_code set in this function:

  • Any error code possibly set by cpl_plot_bivectors()
Note
Plotting only occurs when CPL_MSG_DEBUG level is active and all vectors are not NULL.
Requires gnuplot to be available on the system.
The vectors are temporarily wrapped in bivectors for plotting but are not modified.

Definition at line 793 of file eris_ifu_debug.c.

References BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, CHECK_ERROR_STATE, and TRY.

◆ eris_ifu_plot_vectors_xy()

cpl_error_code eris_ifu_plot_vectors_xy ( const char *  pre,
const char *  opt,
const cpl_vector *  x,
const cpl_vector *  y 
)

Plot vector y against vector x for debugging.

Parameters
preOptional string with pre-plot commands (gnuplot syntax)
optOptional string with plotting options (gnuplot syntax)
xThe x-axis vector to plot
yThe y-axis vector to plot
Returns
CPL_ERROR_NONE on success, otherwise an error code

Plots vector y against vector x as an x-y plot only if the message level is CPL_MSG_DEBUG. Uses gnuplot for visualization.

Possible cpl_error_code set in this function:

  • Any error code possibly set by cpl_plot_bivector()
Note
Plotting only occurs when CPL_MSG_DEBUG level is active and both vectors are not NULL.
Requires gnuplot to be available on the system.
The vectors are temporarily wrapped in a bivector for plotting but are not modified.

Definition at line 720 of file eris_ifu_debug.c.

References BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, and TRY.