M3_format.h

00001 /*******************************************************************************
00002 *   M3:  M3_format.h                                          *
00003 *                                                                              *
00004 *   Version 1.0 May 2004                                                       *
00005 *                                                                              *
00006 *   Copyright (C) 2004  C.M. Cantalupo                                         *
00007 *                                                                              *
00008 *   This program is free software; you can redistribute it and/or modify       *
00009 *   it under the terms of the GNU General Public License as published by       *
00010 *   the Free Software Foundation; either version 2 of the License, or          *
00011 *   (at your option) any later version.                                        *
00012 *                                                                              *
00013 *   This program is distributed in the hope that it will be useful,            *
00014 *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00015 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
00016 *   GNU General Public License for more details.                               *
00017 *                                                                              *
00018 *   You should have received a copy of the GNU General Public License          *
00019 *   along with this program; if not, write to the Free Software                *
00020 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
00021 *                                                                              *
00022 *******************************************************************************/
00023 
00024 
00025 
00026 #ifndef _H_M3_format
00027 #define _H_M3_format
00028 
00029 typedef struct 
00030 {
00031   int64_t firstSample;
00032   int64_t lastSample;
00033 } M3_TODheader;
00034 
00035 typedef struct 
00036 {
00037   int64_t firstSample;
00038   int64_t lastSample;
00039 } M3_TOCheader;
00040 
00041 typedef struct 
00042 {
00043   int64_t firstSample;
00044   int64_t lastSample;
00045   int32_t numPixelInClass;
00046   int32_t numNZ;
00047 } M3_PointingHeader;
00048 
00049 typedef struct 
00050 {
00051   int64_t firstSample;
00052   int64_t lastSample;
00053   int64_t corLength;
00054 } M3_NoiseHeader;
00055 
00056 typedef struct 
00057 {
00058   int64_t firstSample;
00059   int64_t lastSample;
00060   int64_t length;
00061   int64_t bandWidth;
00062 } M3_FilterHeader;
00063 
00064 typedef struct 
00065 {
00066   int32_t numPixelInClass;
00067   int32_t numPixelInMap;
00068 } M3_MapHeader;
00069 
00070 typedef struct
00071 {
00072   int32_t numPixelInClass;
00073 } M3_MaskHeader;
00074 
00075 typedef struct
00076 {
00077   int32_t numPixelInClass;
00078 } M3_CoordHeader;
00079 
00080 typedef struct 
00081 {
00082   int32_t lmin;
00083   int32_t lmax;
00084 }M3_SpectrumHeader;
00085 
00086 typedef struct 
00087 {
00088   int32_t numBin;
00089 }M3_BinHeader;
00090 
00091 typedef struct
00092 {
00093   int32_t numBin;
00094 }M3_BPSheader;
00095 
00096 typedef struct
00097 {
00098   int32_t numBin;
00099 }M3_FisherHeader;
00100 
00101 typedef struct
00102 {
00103   int64_t numColumn;
00104   int64_t numNZ;
00105 }M3_SparseHeader;
00106 
00107 typedef struct
00108 {
00109   int64_t firstTime_sec;
00110   double firstTime_nsec;
00111   int64_t numSample;
00112   double sampleRate;
00113   int32_t numDataPerSample;
00114 }M3_GCPointingHeader;
00115 
00116 typedef struct 
00117 {
00118   size_t size;
00119 }M3_AuxHeader;
00120 
00121 typedef union
00122 {
00123   M3_TODheader tod;
00124   M3_TOCheader toc;
00125   M3_PointingHeader pointing;
00126   M3_NoiseHeader noise;
00127   M3_FilterHeader filter;
00128   M3_MapHeader map;
00129   M3_MaskHeader mask;
00130   M3_CoordHeader coord;
00131   M3_SpectrumHeader spectrum;
00132   M3_BinHeader bin;
00133   M3_BPSheader bps;
00134   M3_FisherHeader fisher;
00135   M3_SparseHeader sparse;
00136   M3_GCPointingHeader gcpointing;
00137   M3_AuxHeader aux;
00138 }M3_AnyHeader;
00139 
00140 
00141 
00142 /*******************************************************************************
00143 *  FILE TYPE  PARAMETER TYPE                                                   *
00144 *  ---------  --------------                                                   *
00145 *  tod:       M3_TODheader *header                                             *
00146 *  toc:       M3_TOCheader *header                                             *
00147 *  pointing:  M3_PointingHeader *header                                        *
00148 *  noise:     M3_NoiseHeader *header                                           *
00149 *  filter:    M3_FilterHeader *header                                          *
00150 *  map:       M3_MapHeader *header                                             *
00151 *  mask:      M3_MaskHeader *header                                            *
00152 *  coord:     M3_CoordHeader *header                                           *
00153 *  spectrum:  M3_SpetrumHeader *header                                         *
00154 *  bin:       M3_BinHeader *header                                             *
00155 *  bps:       M3_BPSheader *header                                             *
00156 *  fisher:    M3_FisherHeader *header                                          *
00157 *  sparse:    M3_SparsePixelMatrixHeader *header                               *
00158 *  gcpointing:M3_GCPointingHeader *header                                      *
00159 *******************************************************************************/
00160 void M3_File_ReadHeader( M3_File *theFile, void *header );
00161 
00162 
00163 /*******************************************************************************
00164 *  FILE TYPE  PARAMETER TYPE                                                   *
00165 *  ---------  --------------                                                   *
00166 *  tod:       M3_Interval *readArg(readInterval), double *data                 *
00167 *  toc:       M3_Interval *readArg(readInterval), double *data                 *
00168 *  pointing:  M3_Interval *readArg(readInterval), M3_PointingEl *data          *
00169 *  noise:     void *readArg, double *data                                      *
00170 *  filter:    void *readArg, M3_FilterEl *data                                 *
00171 *  map:       int32_t *readArg(numPixel), M3_MapEl *data                       *
00172 *  mask:      int32_t *readArg(numPixel), M3_MapEl *data                       *
00173 *  coord:     int32_t *readArg(numPixel), M3_CoordEl *data                     *
00174 *  spectrum:  int32_t *readArg(lmax), double *data                             *
00175 *  bin:       void *readArg, M3_BinEl *data                                    *
00176 *  bps:       void *readArg, M3_BPSel *data                                    *
00177 *  fisher:    void *readArg, double *data                                      *
00178 *  sparse:    void, M3_SparsePixelMatrixData *data                             *
00179 *  gcpointing:M3_Interval *readarg(readInterval), double *data                 *
00180 *******************************************************************************/
00181 void M3_File_ReadData( M3_File *theFile, void *readArg, void *data );
00182 
00183 char *M3_FormatString_GetFirstParam( char *formatString, char *parameter, char *value);
00184 char *M3_FormatString_GetNextParam( char *formatPtr, char *parameter, char *value );
00185 
00186 
00187 #endif

Generated on Mon Nov 24 10:05:12 2008 for M3 by  doxygen 1.5.3-20071008