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: 2012/10/01 16:15:31 $ 00023 * $Revision: 1.9 $ 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 double errs; 00042 int qual; 00043 00044 } xsh_grid_point; 00045 00046 typedef struct{ 00047 /* size of the grid */ 00048 int size; 00049 /* index of the grid */ 00050 int idx; 00051 /* list */ 00052 xsh_grid_point** list; 00053 }xsh_grid; 00054 00055 xsh_grid* xsh_grid_create(int size); 00056 void xsh_grid_sort( xsh_grid* grid); 00057 void xsh_grid_free(xsh_grid** grid); 00058 void xsh_grid_add(xsh_grid* grid, int x, int y, double v, double errs, int qual); 00059 xsh_grid_point* xsh_grid_point_get(xsh_grid* grid, int i); 00060 int xsh_grid_get_index(xsh_grid* grid); 00061 void xsh_grid_dump(xsh_grid* grid); 00062 cpl_table* xsh_grid2table( xsh_grid* grid); 00063 00064 #endif /* XSH_DATA_GRID_H */