00001 00002 /*---------------------------------------------------------------------------- 00003 * E.S.O. 00004 *---------------------------------------------------------------------------- 00005 * File name : cube_load.h 00006 * Author : Nicolas Devillard 00007 * Created on : May 1999 00008 * Language : ANSI C 00009 * Part of ECLIPSE library for Adonis 00010 * Description : cube loading 00011 *--------------------------------------------------------------------------*/ 00012 00013 /* 00014 00015 $Id: cube_load.h,v 1.2 2005/04/08 13:37:49 amodigli Exp $ 00016 $Author: amodigli $ 00017 $Date: 2005/04/08 13:37:49 $ 00018 $Revision: 1.2 $ 00019 00020 */ 00021 00022 #ifndef _CUBE_LOAD_H_ 00023 #define _CUBE_LOAD_H_ 00024 00025 /*---------------------------------------------------------------------------- 00026 * Includes 00027 *--------------------------------------------------------------------------*/ 00028 00029 #include <stdio.h> 00030 #include <math.h> 00031 #include <limits.h> 00032 00033 #include "static_sz.h" 00034 #include "memory.h" 00035 #include "mmap_i.h" 00036 #include "cube_defs.h" 00037 #include "image_handling.h" 00038 #include "conversions.h" 00039 #include "file_handling.h" 00040 #include "simple.h" 00041 00042 00043 /*---------------------------------------------------------------------------- 00044 * Function codes 00045 *--------------------------------------------------------------------------*/ 00046 00047 00048 /*---------------------------------------------------------------------------- 00049 * Function : load_cube() 00050 * In : filename 00051 * Out : 1 newly allocated cube 00052 * Job : load a cube into a cube structure 00053 * Notice : wrapper around supported file formats 00054 so far, only FITS cubes and ASCII lists are supported 00055 *--------------------------------------------------------------------------*/ 00056 00057 /* <python> */ 00058 OneCube * load_cube(const char * filename); 00059 /* </python> */ 00060 00061 00062 00063 /*--------------------------------------------------------------------------- 00064 Function : load_cube_FITS() 00065 In : filename 00066 Out : 1 newly allocated cube 00067 Job : load a FITS file into a cube structure 00068 Notice : 00069 ---------------------------------------------------------------------------*/ 00070 00071 /* <python> */ 00072 OneCube * load_cube_FITS(char * filename); 00073 /* </python> */ 00074 00075 00076 /*--------------------------------------------------------------------------- 00077 Function : load_cube_string_list() 00078 In : list of filenames, number of file names, a la argc,argv 00079 Out : 1 newly allocated cube 00080 Job : load a cube from a list of file names 00081 Notice : outsourced from load_cube_ASCII_list() 00082 ---------------------------------------------------------------------------*/ 00083 00084 OneCube * 00085 load_cube_string_list(char ** filenames, int nfiles); 00086 00087 00088 /*--------------------------------------------------------------------------- 00089 Function : load_cube_ASCII_list() 00090 In : list name (string) 00091 Out : 1 newly allocated cube 00092 Job : load a cube from an ASCII list 00093 Notice : 00094 ---------------------------------------------------------------------------*/ 00095 00096 /* <python> */ 00097 OneCube * load_cube_ASCII_list(char * listname); 00098 /* </python> */ 00099 00100 00101 /*--------------------------------------------------------------------------- 00102 Function : get_ASCII_list_names() 00103 In : file name of an ASCII list 00104 Out : list of names as *argv[] like array, nfiles 00105 Job : retrieve a list of file names from an ASCII list 00106 Notice : free the returned array with free_ASCII_list_names() 00107 ---------------------------------------------------------------------------*/ 00108 00109 char ** get_ASCII_list_names(char * list, int * nfiles); 00110 00111 /*--------------------------------------------------------------------------- 00112 Function : get_ASCII_list_first_name() 00113 In : char * 00114 Out : char *, newly allocated character string 00115 Job : returned string must be freed by user 00116 Notice : 00117 ---------------------------------------------------------------------------*/ 00118 00119 char * get_ASCII_list_first_name(char * listname); 00120 00121 00122 /*--------------------------------------------------------------------------- 00123 Function : get_ASCII_list_tags() 00124 In : file name of an ASCII list 00125 Out : list of tags as *argv[] like array, nfiles 00126 Job : retrieve a list of tags from an ASCII list 00127 Notice : free the returned array with free_ASCII_list_names() 00128 a 'tag' is the second string on the line in an ASCII 00129 file. Example: 00130 00131 ---- framelist contains: ----- 00132 00133 file1 object 00134 file2 sky 00135 file3 sky 00136 file4 object 00137 00138 ---- end of framelist -------- 00139 00140 this function would return "object", "sky", "sky", "object" 00141 ---------------------------------------------------------------------------*/ 00142 00143 char ** get_ASCII_list_tags(char * list, int * ntags); 00144 00145 00146 /*--------------------------------------------------------------------------- 00147 Function : free_ASCII_list_names() 00148 In : name list to delete, number of names in this list 00149 Out : void 00150 Job : free memory associated to a list of names 00151 Notice : 00152 ---------------------------------------------------------------------------*/ 00153 00154 void free_ASCII_list_names(char ** names, int nfiles); 00155 00156 00157 /*--------------------------------------------------------------------------- 00158 Function : is_cube_readonly() 00159 In : 1 pointer to a cube 00160 Out : int 00161 Job : returns 1 is the cube is read-only, 0 if not, -1 if error 00162 Notice : a cube is read-only e.g. when it is an mmap'ing of a file 00163 ---------------------------------------------------------------------------*/ 00164 00165 boolean is_cube_readonly(OneCube * in); 00166 00167 00168 /*---------------------------------------------------------------------------- 00169 * Function : get_cube_info() 00170 * In : FITS file name 00171 * Out : values to fill information structure in working area 00172 * Job : checks validity of a FITS file to Adonis requirements, 00173 * and fills up information structure about file. 00174 * Notice : returns NULL if error 00175 *--------------------------------------------------------------------------*/ 00176 00177 cube_info * get_cube_info(char *filename); 00178 00179 00180 /*--------------------------------------------------------------------------- 00181 Function : labelize_frames() 00182 In : list of file names, number of files, ptr to int, 00183 ptr to a setting_compare function 00184 Out : int array which identify the setting for each file 00185 Job : 00186 Notice : 00187 ---------------------------------------------------------------------------*/ 00188 int * labelize_frames( 00189 char ** lnames, 00190 int nfiles, 00191 int * nsettings, 00192 int (*compare)(char*,char*)); 00193 00194 00195 #endif 00196
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001