00001 /* * 00002 * This file is part of the ESO X-shooter Pipeline * 00003 * Copyright (C) 2006 European Southern Observatory * 00004 * * 00005 * This library is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the Free Software * 00017 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA * 00018 * */ 00019 00020 /* 00021 * $Author: amodigli $ 00022 * $Date: 2009/09/27 10:37:36 $ 00023 * $Revision: 1.5 $ 00024 * $Name: HEAD $ 00025 */ 00026 #ifndef XSH_DATA_GRID_H 00027 #define XSH_DATA_GRID_H 00028 00029 #include <cpl.h> 00030 #include <xsh_data_instrument.h> 00031 00032 00033 /* a grid point */ 00034 typedef struct { 00035 /* x coordinates */ 00036 int x; 00037 /* y coordinates */ 00038 int y; 00039 /* value */ 00040 double v; 00041 } xsh_grid_point; 00042 00043 typedef struct{ 00044 /* size of the grid */ 00045 int size; 00046 /* index of the grid */ 00047 int idx; 00048 /* list */ 00049 xsh_grid_point** list; 00050 }xsh_grid; 00051 00052 xsh_grid* xsh_grid_create(int size); 00053 void xsh_grid_sort( xsh_grid* grid); 00054 void xsh_grid_free(xsh_grid** grid); 00055 void xsh_grid_add(xsh_grid* grid, int x, int y, double v); 00056 xsh_grid_point* xsh_grid_point_get(xsh_grid* grid, int i); 00057 int xsh_grid_get_index(xsh_grid* grid); 00058 void xsh_grid_dump(xsh_grid* grid); 00059 cpl_table* xsh_grid2table( xsh_grid* grid); 00060 00061 #endif /* XSH_DATA_GRID_H */