Grid
[Data Format Handling functions]

Functions

static int xsh_grid_point_compare (const void *one, const void *two)
void xsh_grid_dump (xsh_grid *grid)
 Dump main info about a grid.
cpl_table * xsh_grid2table (xsh_grid *grid)
 Dump main info about a grid.
xsh_gridxsh_grid_create (int size)
 Create a grid.
void xsh_grid_free (xsh_grid **grid)
 Free a grid.
void xsh_grid_add (xsh_grid *grid, int x, int y, double data, double errs, int qual)
 add a point to a grid
void xsh_grid_sort (xsh_grid *grid)
 sort grid points
xsh_grid_pointxsh_grid_point_get (xsh_grid *grid, int i)
 get x points from the grid
int xsh_grid_get_index (xsh_grid *grid)
 get the number of elements in the grid

Function Documentation

cpl_table* xsh_grid2table ( xsh_grid grid  ) 

Dump main info about a grid.

Parameters:
grid pointer

Definition at line 113 of file xsh_data_grid.c.

References xsh_grid_point::errs, xsh_grid::idx, xsh_grid::list, xsh_grid_point::v, xsh_grid_point::x, XSH_ASSURE_NOT_NULL, and xsh_grid_point::y.

Referenced by xsh_subtract_background().

void xsh_grid_add ( xsh_grid grid,
int  x,
int  y,
double  data,
double  errs,
int  qual 
)

add a point to a grid

Parameters:
grid The grid
x x coordinate of the point
y y coordinate of the point
v value of the point

Definition at line 215 of file xsh_data_grid.c.

References xsh_grid_point::errs, xsh_grid::idx, xsh_grid::list, xsh_grid_point::qual, xsh_grid::size, xsh_grid_point::v, xsh_grid_point::x, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_MALLOC, and xsh_grid_point::y.

Referenced by xsh_crea_grid_from_mask(), and xsh_crea_grid_from_samples().

xsh_grid* xsh_grid_create ( int  size  ) 

Create a grid.

Parameters:
size size of the grid
Returns:
the grid structure

Definition at line 165 of file xsh_data_grid.c.

References xsh_grid::idx, xsh_grid::list, xsh_grid::size, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, and xsh_grid_free().

Referenced by xsh_crea_grid_from_mask(), and xsh_crea_grid_from_samples().

void xsh_grid_dump ( xsh_grid grid  ) 

Dump main info about a grid.

Parameters:
grid pointer

Definition at line 87 of file xsh_data_grid.c.

References xsh_grid::idx, xsh_grid::list, xsh_grid::size, xsh_grid_point::v, xsh_grid_point::x, XSH_ASSURE_NOT_NULL, xsh_msg, and xsh_grid_point::y.

void xsh_grid_free ( xsh_grid **  grid  ) 

Free a grid.

Parameters:
grid the grid pointer

Definition at line 191 of file xsh_data_grid.c.

References XSH_FREE.

Referenced by xsh_grid_create(), and xsh_subtract_background().

int xsh_grid_get_index ( xsh_grid grid  ) 

get the number of elements in the grid

Parameters:
grid the grid pointer
Returns:
the number of elements in the grid

Definition at line 284 of file xsh_data_grid.c.

References xsh_grid::idx, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_crea_grid_from_samples(), and xsh_image_fit_spline().

static int xsh_grid_point_compare ( const void *  one,
const void *  two 
) [static]

Definition at line 56 of file xsh_data_grid.c.

References xsh_grid_point::x.

Referenced by xsh_grid_sort().

xsh_grid_point* xsh_grid_point_get ( xsh_grid grid,
int  i 
)

get x points from the grid

Parameters:
grid the grid pointer
i grid index point
Returns:
the x points

Definition at line 264 of file xsh_data_grid.c.

References xsh_grid::list, XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_image_fit_spline().

void xsh_grid_sort ( xsh_grid grid  ) 

sort grid points

Parameters:
grid The grid

Definition at line 244 of file xsh_data_grid.c.

References xsh_grid::idx, xsh_grid::list, XSH_ASSURE_NOT_NULL, and xsh_grid_point_compare().

Referenced by xsh_crea_grid_from_mask(), and xsh_crea_grid_from_samples().


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1