M3.h

Go to the documentation of this file.
00001 #include <stdint.h>
00002 
00160 /*******************************************************************************
00161 *                                                                              *
00162 *   M3:  M3.h                                                *
00163 *                                                                              *
00164 *   Version 1.0 May 2004                                                       *
00165 *                                                                              *
00166 *   Copyright (C) 2004  C.M. Cantalupo                                         *
00167 *                                                                              *
00168 *   This program is free software; you can redistribute it and/or modify       *
00169 *   it under the terms of the GNU General Public License as published by       *
00170 *   the Free Software Foundation; either version 2 of the License, or          *
00171 *   (at your option) any later version.                                        *
00172 *                                                                              *
00173 *   This program is distributed in the hope that it will be useful,            *
00174 *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00175 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
00176 *   GNU General Public License for more details.                               *
00177 *                                                                              *
00178 *   You should have received a copy of the GNU General Public License          *
00179 *   along with this program; if not, write to the Free Software                *
00180 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
00181 *                                                                              *
00182 *******************************************************************************/
00183 
00184 #ifndef _H_M3
00185 #define _H_M3
00186 
00187 #include <M3_error.h>
00188 
00189 
00202 #define M3_NUM_FILTER_TYPE 4
00203 
00204 #define M3_W_FILTER_TYPE 0
00205 
00206 #define M3_E_FILTER_TYPE 1
00207 
00208 #define M3_S_FILTER_TYPE 2
00209 
00210 #define M3_B_FILTER_TYPE 3
00211 
00219 #define M3_DEFAULT_PIXEL_TYPE 0
00220 
00221 #define M3_CMB_I_PIXEL_TYPE 1
00222 #define M3_CMB_Q_PIXEL_TYPE 2
00223 #define M3_CMB_U_PIXEL_TYPE 3
00224 
00232 #define M3_TT_SPECTRUM_TYPE 0
00233 #define M3_EE_SPECTRUM_TYPE 1
00234 #define M3_BB_SPECTRUM_TYPE 2
00235 #define M3_TE_SPECTRUM_TYPE 3
00236 #define M3_TB_SPECTRUM_TYPE 4
00237 #define M3_EB_SPECTRUM_TYPE 5
00238 
00245 #define M3_MADNES_RUN_TYPE 1
00246 #define M3_MADMAP_RUN_TYPE 2
00247 #define M3_MADSPEC_RUN_TYPE 3
00248 #define M3_SPRINGTIDE_RUN_TYPE 4
00249 
00254 /******************************************/
00255 /* Define The Basic M3 Data Elements */
00256 /******************************************/
00257 
00258 
00259 
00265 typedef struct 
00266 {
00268   int32_t pixel;
00270   float weight;
00271 } M3_PointingEl;
00272 
00273 
00279 typedef struct 
00280 {
00282   int32_t pixel;
00284   double value;
00285 } M3_MapEl;
00286 
00287 
00292 typedef struct 
00293 {
00295   double freq;
00297   double re;
00299   double im;
00300 } M3_FilterEl;
00301 
00302 
00307 typedef struct 
00308 {
00310   int64_t firstSample;
00312   int64_t lastSample;
00313 } M3_Interval;
00314 
00320 typedef struct 
00321 {
00323   int32_t pixel;
00325   double ra;
00327   double dec;
00328 } M3_CoordEl;
00329 
00334 typedef struct 
00335 {
00337   int32_t lmin;
00339   int32_t lmax;
00340 } M3_BinEl;
00341 
00348 typedef struct 
00349 {
00351   int32_t lmin;
00353   int32_t lmax;
00355   double power;
00357   double lowerBound;
00359   double upperBound;
00360 } M3_BPSel;
00361 
00368 typedef struct
00369 {
00371   int32_t rowClass;
00373   int32_t rowPixel;
00375   double value;
00376 } M3_SparsePixelMatrixEl;
00377 
00384 typedef struct
00385 {
00387   int32_t columnClass;
00389   int32_t columnPixel;
00391   int64_t numNZ;  
00392 } M3_SparsePixelMatrixColumn;
00393 
00400 typedef struct
00401 {
00403   int64_t numColumn;
00405   int64_t numNZ;
00407   M3_SparsePixelMatrixColumn *column;
00410   M3_SparsePixelMatrixEl *matrix;
00411 } M3_SparsePixelMatrixData;
00412 
00413 
00414 typedef struct
00415 {
00416   int64_t sec;
00417   double nsec;
00418 } M3_TimeEl;
00419 
00420 typedef struct 
00421 {
00422   M3_TimeEl firstTime;
00423   M3_TimeEl lastTime;
00424 } M3_TimeInterval;
00425 
00426 
00427 /* Include the other header files */
00428 
00429 #include "M3_internal.h"
00430 
00431 /*************************************/
00432 /* M3 Data Interface Functions  */
00433 /*************************************/
00434 
00435 /* OBJECT:  M3_RunConfigStruct */
00436 
00478 void M3_RunConfigStruct_Read( 
00479   M3_RunConfigStruct **runConfig,
00480   char *runConfigFileName, 
00481   int runType );
00482 
00483 
00484 void M3_RunConfigStruct_ReadBin( 
00485   M3_RunConfigStruct **runConfigOut, 
00486   char *runConfigFileName, 
00487   int runType );
00488 
00517 void M3_RunConfigStruct_Write(
00518   M3_RunConfigStruct *runConfig,
00519   char *runConfigFileName );
00520 
00545 void M3_RunConfigStruct_Destroy( 
00546   M3_RunConfigStruct *runConfig );
00547 
00576 void M3_RunConfigStruct_Duplicate( 
00577   M3_RunConfigStruct *inRunConfig,   
00578   M3_RunConfigStruct **outRunConfig );
00579 
00609 int M3_RunConfigStruct_GetDataSetRoot( 
00610   M3_RunConfigStruct *runConfig,
00611   M3_DataSetLL **dataSetRoot );
00612 
00644 int M3_RunConfigStruct_GetPixelClassRoot( 
00645   M3_RunConfigStruct *runConfig, 
00646   M3_PixelClassLL **pixelClassRoot );
00647 
00677 int M3_RunConfigStruct_GetPowerSpectrum( 
00678   M3_RunConfigStruct *runConfig, 
00679   M3_PowerSpectrumStruct **powerSpectrum );
00680 
00714 int M3_RunConfigStruct_GetSparseMatrixName(
00715   M3_RunConfigStruct *runConfig,
00716   char *name,
00717   long maxStringLength );
00718 
00744 int M3_RunConfigStruct_GetSparseMatrixNumNZ(
00745   M3_RunConfigStruct *runConfig,
00746   M3_SparsePixelMatrixData *sparsePixelMatrixData ); 
00747 
00748   /* sparsePixelMatrixData->numColumn INPUT
00749      sparsePixelMatrixData->numNZ     OUTPUT
00750      sparsePixelMatrixData->column    INPUT/OUTPUT (allocate numColumn elements before calling)
00751                                                    (columnClass and columnPixel elements set by user,
00752                                                     numNZ elements set by function call )
00753      sparsePixelMatrixData->matrix    NULL
00754   */
00755 
00777 int M3_RunConfigStruct_GetSparseMatrix( 
00778   M3_RunConfigStruct *runConfig,
00779   M3_SparsePixelMatrixData *sparsePixelMatrixData );
00780   /* sparsePixelMatrixData->numColumn INPUT
00781      sparsePixelMatrixData->numNZ     INPUT
00782      sparsePixelMatrixData->column    INPUT
00783      sparsePixelMatrixData->matrix    OUTPUT   (allocate total numNZ elemetns before calling)
00784   */
00785 
00807 int M3_RunConfigStruct_GetDenseMatrixName(
00808   M3_RunConfigStruct *runConfig,
00809   char *name,
00810   long maxStringLength );
00811 
00812 /* 
00813 int M3_RunConfigStruct_GetDenseMatrix(
00814   M3_RunConfigStruct *runConfig, 
00815   int64_t numColumn,
00816   int32_t *requestColumn);
00817 */
00818 
00819 int M3_RunConfigStruct_GetGCPointingGroupRoot( 
00820   M3_RunConfigStruct *runConfig, 
00821   M3_GCPointingGroupLL **GCPointingRoot );
00822 
00823 int M3_GCPointingGroupLL_GetNextNodeInList(
00824   M3_GCPointingGroupLL **GCPointingGroupNode );
00825 
00826 
00827 
00828 void M3_GCPointingGroupLL_GetStoreSize( 
00829   M3_GCPointingGroupLL *gcpointingGroupNode, 
00830   M3_TimeIntervalLL *timeIntervalList, 
00831   size_t *storeSize );
00832 
00833 void M3_GCPointingGroupLL_InitializeStore(M3_GCPointingGroupLL *gcpointingGroupNode, 
00834                                           M3_TimeIntervalLL *timeIntervalList, 
00835                                           void *workSpace );
00836 
00837 void M3_GCPointingGroupLL_DestroyStore( M3_GCPointingGroupLL *GCPointingGroup, 
00838                                         int destroyAuxStore );
00839 
00840 
00852 /* OBJECT:  M3_DataSetLL */
00853 
00868 int M3_DataSetLL_GetNextNodeInList( 
00869   M3_DataSetLL **dataSetNode );
00870 
00899 void M3_DataSetLL_GetName( 
00900   M3_DataSetLL *dataSetNode, 
00901   char *name,  
00902   long maxStringLength );
00903 
00938 int M3_DataSetLL_GetCoveredIntervalRoot( 
00939   M3_DataSetLL *dataSetNode, 
00940   M3_IntervalLL **intervalRoot );
00941 
00976 void M3_DataSetLL_GetNumNZ( 
00977   M3_DataSetLL *dataSetNode, 
00978   int32_t *numNZ );
00979 
01016 int M3_DataSetLL_GetPointingClassRoot( 
01017   M3_DataSetLL *dataSetNode, 
01018   M3_PointingClassLL **pointingClassRoot );
01019 
01046 void M3_DataSetLL_GetTOD( 
01047   M3_DataSetLL *dataSetNode, 
01048   M3_Interval readInterval, 
01049   double *tod );
01050 
01082 void M3_DataSetLL_GetPointing( 
01083   M3_DataSetLL *dataSetNode, 
01084   M3_Interval readInterval, 
01085   M3_PointingEl *pointing );
01086 
01115 void M3_DataSetLL_GetEuler(
01116   M3_DataSetLL *dataSetNode,
01117   M3_Interval readInterval,
01118   double *eulerAngles );
01119 
01120 
01121 int M3_DataSetLL_GetNoiseFileRoot(
01122   M3_DataSetLL *dataSetNode,
01123   M3_FileLL **noiseFileRoot );
01124 
01156 int M3_DataSetLL_GetNoiseFile( 
01157   M3_DataSetLL *dataSetNode, 
01158   M3_Interval stationaryInterval,
01159   M3_FileLL **noiseFile );
01160 
01161 int M3_DataSetLL_GetNoiseCorLength( 
01162   M3_DataSetLL *dataSetNode, 
01163   int64_t sample, 
01164   int64_t *corLength );
01165 
01166 int M3_DataSetLL_GetNoise( 
01167   M3_DataSetLL *dataSetNode, 
01168   int64_t sample, 
01169   double *noise );
01170 
01171 int M3_DataSetLL_GetFilterFileRoot( 
01172   M3_DataSetLL *dataSetNode,
01173   int32_t filterType,  
01174   M3_FileLL **filterFile );
01175 
01176 int M3_DataSetLL_GetFilterFile(
01177   M3_DataSetLL *dataSetNode, 
01178   M3_Interval stationaryInterval, 
01179   int32_t filterType, 
01180   M3_FileLL **filterFile );
01181 
01182 void M3_DataSetLL_GetSampleZeroTime( 
01183   M3_DataSetLL *dataSetNode,
01184   M3_TimeEl *zeroTime );
01185 
01186 void M3_DataSetLL_GetSampleFreq(
01187   M3_DataSetLL *dataSetNode, 
01188   double *sampleFreq );
01189 
01190 void M3_DataSetLL_SampleIntervalToTimeInterval( 
01191   M3_DataSetLL *dataSetNode,
01192   M3_Interval sampleInterval,
01193   M3_TimeInterval *timeInterval );
01194 
01195 char *M3_DataSetLL_GetGCPointingGroupNode(
01196   M3_DataSetLL *dataSetNode,
01197   M3_GCPointingGroupLL **GCPointingGroupNode );
01198 
01212 /* OBJECT:  M3_PixelClassLL */
01213 
01214 int M3_PixelClassLL_GetNextNodeInList( 
01215   M3_PixelClassLL **pixelClassNode );
01216 
01217 void M3_PixelClassLL_GetClassName( 
01218   M3_PixelClassLL *pixelClassNode, 
01219   char *className, 
01220   long maxStringLength );
01221 
01222 void M3_PixelClassLL_GetClassIndex(
01223   M3_PixelClassLL *pixelClassNode,
01224   int32_t *classIndex );
01225 
01226 void M3_PixelClassLL_GetPixelType( 
01227   M3_PixelClassLL *pixelClassNode, 
01228   int32_t *pixelType );
01229 
01230 void M3_PixelClassLL_GetNumPixelInClass( 
01231   M3_PixelClassLL *pixelClassNode, 
01232   int32_t *numPixelInClass );
01233 
01234 void M3_PixelClassLL_GetNumPixelInMap( 
01235   M3_PixelClassLL *pixelClassNode, 
01236   int32_t *numPixelInMap );
01237 
01238 int M3_PixelClassLL_GetMapName(
01239   M3_PixelClassLL *pixelClassNode,
01240   char *mapName,
01241   long maxStringLength );
01242 
01243 void M3_PixelClassLL_GetFullMap( 
01244   M3_PixelClassLL *pixelClassNode, 
01245   M3_MapEl *map );
01246 
01247 void M3_PixelClassLL_GetIndexedMap( 
01248   M3_PixelClassLL *pixelClassNode, 
01249   int32_t numPixel, 
01250   M3_MapEl *map );
01251 
01252 void M3_PixelClassLL_GetIndexedCoord( 
01253   M3_PixelClassLL *pixelClassNode, 
01254   int32_t numPixel, 
01255   M3_CoordEl *coord );
01256 
01257 void M3_PixelClassLL_GetWindow( 
01258   M3_PixelClassLL *pixelClassNode, 
01259   int32_t lmax, 
01260   double *window );
01261 
01262 void M3_PixelClassLL_GetIndexedMask( 
01263   M3_PixelClassLL *pixelClassNode, 
01264   int32_t numPixel, 
01265   M3_MapEl *mask );
01266 
01267 int M3_PixelClassLL_GetTemplateFileRoot( 
01268   M3_PixelClassLL *pixelClassNode, 
01269   M3_FileLL **templateFileRoot );
01270 
01281 /* OBJECT:  M3_PointingClassLL */
01282 
01283 int M3_PointingClassLL_GetNextNodeInList( 
01284   M3_PointingClassLL **pointingClassNode );
01285 
01286 void M3_PointingClassLL_GetNumNZ( 
01287   M3_PointingClassLL *pointingClassNode, 
01288   int32_t *numNZ );
01289 
01290 void M3_PointingClassLL_GetPixelClassNode( 
01291   M3_PointingClassLL *pointingClassNode, 
01292   M3_PixelClassLL **pixelClassNode );
01293 
01302 /* OBJECT:  M3_PowerSpectrumStruct */
01303 
01304 void M3_PowerSpectrumStruct_GetNumBin( 
01305   M3_PowerSpectrumStruct *powerSpectrum, 
01306   int32_t *numBin );
01307 
01308 int M3_PowerSpectrumStruct_GetSpectrumClassRoot( 
01309   M3_PowerSpectrumStruct *powerSpectrum, 
01310   M3_SpectrumClassLL **spectrumClassRoot );
01311 
01312 void M3_PowerSpectrumStruct_GetFisherMatrix( 
01313   M3_PowerSpectrumStruct *powerSpectrum, 
01314   double *fisherMatrix );
01315 
01328 /* OBJECT:  M3_SpectrumClassLL */
01329 
01330 
01331 int M3_SpectrumClassLL_GetNextNodeInList(
01332   M3_SpectrumClassLL **spectrumClassNode );
01333 
01334 void M3_SpectrumClassLL_GetSpectrumType( 
01335   M3_SpectrumClassLL *spectrumClassNode, 
01336   int32_t *spectrumType );
01337 
01338 void M3_SpectrumClassLL_GetMultipoleMax( 
01339   M3_SpectrumClassLL *spectrumClassNode, 
01340   int32_t *lmax );
01341 
01342 void M3_SpectrumClassLL_GetNumBin( 
01343   M3_SpectrumClassLL *spectrumClassNode, 
01344   int32_t *numBin );
01345 
01346 void M3_SpectrumClassLL_GetShape( 
01347   M3_SpectrumClassLL *spectrumClassNode, 
01348   double *shape );
01349 
01350 void M3_SpectrumClassLL_GetBin( 
01351   M3_SpectrumClassLL *spectrumClassNode, 
01352   M3_BinEl *bin );
01353 
01354 void M3_SpectrumClassLL_GetBPS( 
01355   M3_SpectrumClassLL *spectrumClassNode, 
01356   M3_BPSel *bps );
01357 
01358 
01368 /* OBJECT:  M3_IntervalLL */
01369 
01370 int M3_IntervalLL_GetNextNodeInList( 
01371   M3_IntervalLL **intervalNode );
01372 
01373 void M3_IntervalLL_GetInterval( 
01374   M3_IntervalLL *intervalNode, 
01375   M3_Interval *interval );
01376 
01377 /* OBJECT:  M3_TimeIntervalLL */
01378 
01379 int M3_TimeIntervalLL_GetNextNodeInList(
01380   M3_TimeIntervalLL **timeIntervalNode );
01381 
01382 void M3_TimeIntervalLL_GetInterval(
01383   M3_TimeIntervalLL *timeIntervalNode,
01384   M3_TimeInterval *timeInterval );
01385 
01386 void M3_TimeIntervalLL_InsertInterval(
01387   M3_TimeIntervalLL **timeIntervalList,
01388   M3_TimeInterval timeInterval );
01389 
01390 M3_TimeIntervalLL *M3_TimeIntervalLL_Union( 
01391   M3_TimeIntervalLL *aList, 
01392   M3_TimeIntervalLL *bList );
01393 
01394 void M3_TimeIntervalLL_DestroyList(
01395   M3_TimeIntervalLL *timeIntervalList );
01396 
01406 /* OBJECT:  M3_FileLL */
01407 
01408 int M3_FileLL_GetNextNodeInList( 
01409   M3_FileLL **fileNode );
01410 
01411 void M3_FileLL_GetIndexedTemplate( 
01412   M3_FileLL *templateFileNode, 
01413   int32_t numPixel, 
01414   M3_MapEl *theTemplate );
01415 
01416 void M3_FileLL_GetNoiseInterval(
01417   M3_FileLL *noiseFileNode,
01418   M3_Interval *noiseInterval );
01419 
01420 void M3_FileLL_GetNoiseCorLength( 
01421   M3_FileLL *noiseFileNode,
01422   int64_t *corLength );
01423 
01424 void M3_FileLL_GetNoise( 
01425   M3_FileLL *noiseFileNode, 
01426   double *noise );
01427 
01428 void M3_FileLL_GetFilterInterval(
01429   M3_FileLL *filterFileNode, 
01430   M3_Interval *interval );
01431 
01432 void M3_FileLL_GetFilterLength(
01433   M3_FileLL *filterFileNode,
01434   int64_t *length );
01435 
01436 void M3_FileLL_GetFilterBandWidth(
01437   M3_FileLL *filterFileNode, 
01438   int64_t *bandWidth );
01439 
01440 void M3_FileLL_GetFilter( 
01441   M3_FileLL *filterFileNode, 
01442   M3_FilterEl *filter );
01443 
01447 #include <M3_format.h>
01448 
01449 #endif

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