X-shooter Pipeline Reference Manual 3.8.15
xsh_data_grid.h
Go to the documentation of this file.
1/* *
2 * This file is part of the ESO X-shooter Pipeline *
3 * Copyright (C) 2006 European Southern Observatory *
4 * *
5 * This library is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18 * */
19
20/*
21 * $Author: amodigli $
22 * $Date: 2012-10-01 16:15:31 $
23 * $Revision: 1.9 $
24 * $Name: not supported by cvs2svn $
25 */
26#ifndef XSH_DATA_GRID_H
27#define XSH_DATA_GRID_H
28
29#include <cpl.h>
30#include <xsh_data_instrument.h>
31
32
33/* a grid point */
34typedef struct {
35 /* x coordinates */
36 int x;
37 /* y coordinates */
38 int y;
39 /* value */
40 double v;
41 double errs;
42 int qual;
43
45
46typedef struct{
47 /* size of the grid */
48 int size;
49 /* index of the grid */
50 int idx;
51 /* list */
54
56void xsh_grid_sort( xsh_grid* grid);
57void xsh_grid_free(xsh_grid** grid);
58void xsh_grid_add(xsh_grid* grid, int x, int y, double v, double errs, int qual);
61void xsh_grid_dump(xsh_grid* grid);
62cpl_table* xsh_grid2table( xsh_grid* grid);
63
64#endif /* XSH_DATA_GRID_H */
void xsh_grid_add(xsh_grid *grid, int x, int y, double v, double errs, int qual)
add a point to a grid
xsh_grid * xsh_grid_create(int size)
Create a grid.
void xsh_grid_dump(xsh_grid *grid)
Dump main info about a grid.
Definition: xsh_data_grid.c:87
void xsh_grid_sort(xsh_grid *grid)
sort grid points
int xsh_grid_get_index(xsh_grid *grid)
get the number of elements in the grid
xsh_grid_point * xsh_grid_point_get(xsh_grid *grid, int i)
get x points from the grid
void xsh_grid_free(xsh_grid **grid)
Free a grid.
cpl_table * xsh_grid2table(xsh_grid *grid)
Dump main info about a grid.
int size
int * y
int * x
xsh_grid_point ** list
Definition: xsh_data_grid.h:52