photometry.c

00001 /******************************************************************************
00002 *******************************************************************************
00003 *               European Southern Observatory
00004 *             VLTI MIDI Data Reduction Software
00005 *
00006 * Module name:  photometry.c
00007 * Description:
00008 *
00009 * History:
00010 * 03-Feb-03     (jmeisner) Created
00011 * 03-Mar-03     (csabet) Added title, directives and included in the MIDI pipeline
00012 * 21-Jan-05     (csabet) Major clean up and redesign
00013 *******************************************************************************
00014 ******************************************************************************/
00015 
00016 /******************************************************************************
00017 *   Compiler directives
00018 ******************************************************************************/
00019 
00020 /******************************************************************************
00021 *   Include files
00022 ******************************************************************************/
00023 #include <stdio.h>
00024 #include <cpl.h>
00025 #include <stdlib.h>
00026 #include <math.h>
00027 #include "midiGlobal.h"
00028 #include <string.h>
00029 #include "midiLib.h"
00030 #include "statistics.h"
00031 #include "diagnostics.h"
00032 #include "photometry.h"
00033 #include "errorHandling.h"
00034 
00035 
00036 /**********************************************************
00037 *   Constant definitions
00038 **********************************************************/
00039 
00040 /**********************************************************
00041 *   Global Variables
00042 **********************************************************/
00043 
00044 /*============================ C O D E    A R E A ===========================*/
00045 
00046 
00047 /******************************************************************************
00048 *                European Southern Observatory
00049 *              VLTI MIDI Data Reduction Software 
00050 *
00051 * Module name:  estimatePhotom
00052 * Input/Output: See function arguments to avoid duplication
00053 * Description:  
00054 *
00055 * History:        
00056 * 11-Aug-05        (csabet) Created
00057 *****************************************************************************/
00058 void estimatePhotom(
00059     char            key,            // In: Strig character indicating type
00060     CompressedData    *compressed,    // In: Compressed data
00061     ImageFormat        *format,        // In: Photometry size
00062     float            **photom,        // Ou: Photometry result
00063     float            **photomErr,    // Ou: Estimated photometry RMS error
00064     int                *error)
00065 {
00066     
00067     //    Local Declarations
00068     //    ------------------
00069     const char    routine[] = "estimatePhotom";
00070     int            region, X, regionId;
00071     float         choppingRMS;        // Measure of chop-to-chop rms RELATIVE to full photometry, NOT USED;
00072     char        *string, *title;
00073     float        *arrayPlot;
00074 
00075     //    Algorithm
00076     //    ---------
00077     if (diagnostic > 4)cpl_msg_info(cpl_func,"\nInvoking      routine   '%s' \n", routine);
00078     if (diagnostic > 4) fprintf(midiReportPtr, "\nInvoking      routine   '%s' \n", routine);
00079 
00080     //    Reset parameters
00081     *error = 0;
00082     
00083     //    Exception
00084     if (format->numOfFrames < 2)
00085     {
00086        cpl_msg_info(cpl_func,"Not enough data. Expected more than 1. Found %d", format->numOfFrames);
00087         fprintf (midiReportPtr, "Not enough data. Expected more than 1. Found %d", format->numOfFrames);
00088         *error = 1;
00089         return;
00090     }
00091 
00092     //    If not chopped exit
00093     if (!(format->chopped))
00094     {
00095         *error = 1;
00096         return;
00097     }
00098 
00099    cpl_msg_info(cpl_func,"\n");
00100     fprintf (midiReportPtr, "\n");
00101 
00102     for (region = 0; region < format->numOfRegionsToProcess; region++)
00103     {
00104         if (plotFile)
00105             arrayPlot = (float *) calloc (format->iXWidth, sizeof(float));
00106 
00107         if (strcmp (format->beamCombiner, "SCI_PHOT") == 0)
00108         {
00109             if (key == 'A') regionId = 1;
00110             else if (key == 'B') regionId = 4;
00111             else regionId = region+2;
00112         }
00113         else
00114             regionId = region+1;
00115 
00116         if (diagnostic)cpl_msg_info(cpl_func, "Running dispersed Photom %c, for region %d\n", key, regionId);
00117         fprintf (midiReportPtr, "Running dispersed Photom %c, for region %d\n", key, regionId);
00118 
00119         for (X = 0; X < format->iXWidth; X++)
00120         {
00121             if (badChannelList[X])
00122                 continue;
00123             
00124             if (strcmp (format->beamCombiner, "SCI_PHOT") == 0)
00125             {
00126                 photom[region][X] = getChopPhotomSP (X, (((compressed->iDispFringe)[region])[X]), 
00127                     format->numOfScans, format->framesPerScan, compressed->rejectList[X], &(photomErr[region][X]), 
00128                     &choppingRMS);
00129             }
00130             else
00131             {
00132                 photom[region][X] = getChopPhotom (X, (((compressed->iDispFringe)[region])[X]), 
00133                     compressed->tarType, &(photomErr[region][X]), &choppingRMS, format->numOfFrames);
00134             }
00135 
00136             if (isnan(photom[region][X]))
00137                 badChannelList[X] |= BSL_DATA_ERROR;
00138 
00139             if (plotFile)
00140             {
00141                 if (isnan(photom[region][X]))
00142                     arrayPlot[X] = 0.0;
00143                 else
00144                     arrayPlot[X] = photom[region][X];
00145             }
00146         }
00147         
00148         if (plotFile)
00149         {
00150             title = (char *) calloc (MAX_STRING_LENGTH, sizeof (char));
00151             string = (char *) calloc (MAX_STRING_LENGTH, sizeof (char));
00152             sprintf (string, "Photom%cDATA%d", key, regionId);
00153             sprintf (title, "Photometry %c, for Region %d", key, regionId);
00154             midiCreatePlotFile2D (string, title, "Channel", "Photometry", 0, photom[region], 0, format->iXWidth, 1, 0);
00155             sprintf (string, "Photom%cErrDATA%d", key, regionId);
00156             sprintf (title, "Photometry %c Error, for Region %d", key, regionId);
00157             midiCreatePlotFile2D (string, title, "Channel", "Photometry Error", 0, photomErr[region], 0, format->iXWidth, 1, 0);
00158             free (string);
00159             free (title);
00160             free (arrayPlot);
00161         }
00162     }
00163 
00164     return;
00165 }
00166 /*****************************************************************************/
00167 
00168 
00169 
00170 /******************************************************************************
00171 *                European Southern Observatory
00172 *              VLTI MIDI Data Reduction Software 
00173 *
00174 * Module name:  getChopPhotomSP
00175 * Input/Output: See function arguments to avoid duplication
00176 * Description:  
00177 *
00178 * History:        
00179 * 14-Feb-06        (csabet) Created
00180 ******************************************************************************/
00181 float getChopPhotomSP (        // Ou: Photometry
00182     int        X,                // In: Wavelength channel
00183     float    *compressed,    // In: Pointer to compressed data for one X and one R
00184     int     numOfScans,        // In: Number of frames
00185     int     framesPerScan,    // In: Number of frames per scan
00186     int        *rejectList,    // In: Bad Frame List
00187     float    *errRMS,        // Ou: rms error returned
00188     float    *choppingRMS)    // Ou: Measure of chop-to-chop rms RELATIVE to full photometry;
00189 {
00190 
00191     //    Local Declarations
00192     //    ------------------
00193     const char    routine[] = "getChopPhotomSP";
00194     int            f, j, s, numOfAccum, length;
00195     float        accum, *results, photom, variance, rms;
00196 
00197     //    Algorithm
00198     //    ---------
00199 
00200     //    Allocate memory
00201     results = (float *) calloc (numOfScans, sizeof (float));
00202         
00203     //    Create an array of photometric results for 'T' only
00204     length = 0;
00205     for (s = 0; s < numOfScans; s++)
00206     {
00207         numOfAccum = 0;
00208         accum = 0.F;
00209         for (j = 0; j < framesPerScan; j++)
00210         {
00211             f = j + s * framesPerScan;
00212             if (!(rejectList[f]))
00213             {
00214                 accum += (float) compressed[f];
00215                 numOfAccum++;
00216             }
00217         }
00218         if (numOfAccum)
00219         {
00220             results[length] = accum / ((float) numOfAccum);
00221             length++;
00222         }
00223     }
00224 
00225     //    Compute statistics
00226     if (length)
00227     {
00228         photom = signalMean (results, 0, length);
00229         variance = signalVariance (results, 0, length, &rms);
00230 
00231         //    If zero variance, set rms to a small value
00232         if (variance == 0.0)
00233             rms = 0.1F;
00234     
00235         *errRMS = rms / sqrt((float)length);
00236 
00237         //    Return relative error per chop
00238         if (photom > 0.0)    
00239             *choppingRMS = rms / photom;
00240     }
00241     
00242     //    Exception
00243     if (photom <= 0.0 || !length)
00244     {
00245         photom = NOT_A_NUMBER;
00246         sprintf (midiMessage, "Cannot compute photometry for channel %3d", X);
00247         midiReportWarning (midiReportPtr, routine, __FILE__, __LINE__, midiMessage);
00248         
00249         //    Reject this channel
00250         badChannelList[X] |= BSL_DATA_ERROR;
00251     }
00252 
00253     //    Release local memory
00254     free(results);
00255     
00256     return (photom);
00257 }
00258 /*****************************************************************************/
00259 
00260 
00261 
00262 /******************************************************************************
00263 *                European Southern Observatory
00264 *              VLTI MIDI Data Reduction Software 
00265 *
00266 * Module name:  getChopPhotom
00267 * Input/Output: See function arguments to avoid duplication
00268 * Description:  
00269 *
00270 * History:        
00271 * 14-Feb-06        (csabet) Created from JM. Removed goto statements and restructured
00272 ******************************************************************************/
00273 float getChopPhotom (
00274     int        X,                // In: Wavelength channel
00275     float    *collapsedData,    // In: Pointer to linear array of chopping data, sequential with time
00276     char    *targetType,    // In: Pointer to description array. 'S'=offsource, 'T'=on source, 'U'=???
00277     float    *errRMS,          // Ou: rms error returned
00278     float    *choppingRMS,    // Ou: Measure of chop-to-chop rms RELATIVE to full photometry;
00279     int     numData)        // In: Number of data points in the above arrays to use.
00280 {
00281 
00282     //    Local Declarations
00283     //    ------------------
00284     const char    routine[] = "getChopPhotom";
00285     char        lastType;
00286     int            index, numOfaccum;
00287     float        accum, accum2, *results, photom, mean, variance, rms;
00288 
00289     //    Algorithm
00290     //    ---------
00291 
00292     //    Initialise
00293     lastType = 'U';
00294     accum = 0.F;
00295     numOfaccum = 0;
00296 
00297     //    Allocate memory
00298     results = (float *) calloc (numData, sizeof (float));
00299     
00300     //    Create an array of photometric results for 'T' only
00301     for (index = 0; index < numData; index++)
00302     {
00303         //    If state has changed then compute the average brightness in the previous state
00304         if ((targetType[index] != lastType) && numOfaccum)
00305         {
00306             if (targetType[index] == 'T')
00307             {
00308                 results[index] = accum / ((float) numOfaccum);
00309             
00310                 //    Reset parameters
00311                 numOfaccum = 0;
00312                 accum = 0.F;
00313             }
00314         }
00315         
00316         //    Now accumulate
00317         if (targetType[index] == 'T')
00318         {
00319             accum += (float) collapsedData[index];
00320             numOfaccum++;
00321         }
00322         
00323         //    Save current state
00324         lastType = targetType[index];
00325     }
00326 
00327     //    Alright, now results[] has a number of non-zero values. Compute statistics
00328     accum = 0.F;
00329     accum2 = 0.F;
00330     numOfaccum = 0;
00331     for (index = 0; index < numData; index++)
00332     {
00333         if (results[index] != 0.F)
00334         {
00335             accum += results[index];
00336             accum2 += results[index] * results[index];
00337             numOfaccum++;
00338         }
00339     }
00340 
00341     //    Compute mean and variance
00342     if (numOfaccum)
00343     {
00344         mean = accum / ((float) numOfaccum);
00345         variance = (accum2 - mean * mean * ((float) numOfaccum)) / ((float) (numOfaccum - 1));
00346     
00347         //    If zero variance, set rms to a small value
00348         if (variance > 0.0)
00349             rms = sqrt(variance);
00350         else
00351             rms = 0.1F;
00352     
00353         *errRMS = rms / sqrt((float)numOfaccum);
00354         photom = mean;
00355 
00356         //    Return relative error per chop
00357         if (photom > 0.0)    
00358             *choppingRMS = rms / photom;
00359     }
00360 
00361     //    Exception
00362     if (photom <= 0.0 || !numOfaccum)
00363     {
00364         photom = NOT_A_NUMBER;
00365         sprintf (midiMessage, "Cannot compute photometry for channel %3d", X);
00366         midiReportWarning (midiReportPtr, routine, __FILE__, __LINE__, midiMessage);
00367         
00368         //    Reject this channel
00369         badChannelList[X] |= BSL_DATA_ERROR;
00370     }
00371 
00372     //    Release local memory
00373     free(results);
00374     
00375     return (photom);
00376 }
00377 /*****************************************************************************/
00378 
00379 
00380 
00381 
00382 /******************************************************************************
00383 *                European Southern Observatory
00384 *              VLTI MIDI Data Reduction Software 
00385 *
00386 * Module name:  estimatePhotomUndisp
00387 * Input/Output: See function arguments to avoid duplication
00388 * Description:  For UNDISPERSED processing
00389 *
00390 * History:        
00391 * 03-Mar-03        (csabet) Cleaned up and Integrated
00392 ******************************************************************************/
00393 void estimatePhotomUndisp (
00394     ImageFormat        *format,
00395     CompressedData    *inData,        // In: Compressed photometry data
00396     float            *errs,            // Ou: array of rms error returned (size = numOfRegionsChopped)
00397     float            *choppingRMS,    // Ou: Measure of chop-to-chop rms RELATIVE to full photometry;
00398     float            *results)        // Ou: array of photometric results
00399 {
00400 
00401     /*  Local Declarations
00402     --------------------*/
00403     int        region;
00404     double    *thisdata;
00405 
00406     /*  Algorithm
00407     -----------*/
00408     for (region = 0; region < format->numOfRegionsToProcess; region++)
00409     {
00410         if (region == 0)
00411             thisdata = inData->iFringe1;
00412         else
00413             thisdata = inData->iFringe2;
00414 
00415         results[region] =  getChopPhotomUndisp ((double *)thisdata, inData->tarType, errs+region, 
00416             choppingRMS+region, format->numOfFrames);
00417 
00418         if (diagnostic > 1)
00419         {
00420            cpl_msg_info(cpl_func,"Photometric measurement for region %d: %f \n", region+1, results[region]);
00421            cpl_msg_info(cpl_func,"Relative chop-to-chop rms:             %4.1f%% \n", 100.F*choppingRMS[region]);
00422             fprintf (midiReportPtr, "Photometric measurement for region %d: %f \n", region+1, results[region]);
00423             fprintf(midiReportPtr, "Relative chop-to-chop rms:              %4.1f%% \n", 100.F*choppingRMS[region]);
00424         }
00425     }
00426     
00427     return;
00428 }
00429 /*****************************************************************************/
00430 
00431 
00432 
00433 
00434 /******************************************************************************
00435 *                European Southern Observatory
00436 *              VLTI MIDI Data Reduction Software 
00437 *
00438 * Module name:  getChopPhotomDoubleUndisp
00439 * Input/Output: See function arguments to avoid duplication
00440 * Description:  
00441 *
00442 * History:        
00443 * 14-Feb-06        (csabet) Created from JM. Removed goto statements and restructured
00444 ******************************************************************************/
00445 float getChopPhotomUndisp (
00446     double    *collapsedData,    // In: Pointer to linear array of chopping data, sequential with time
00447     char    *targetType,    // In: Pointer to description array. 'S'=offsource, 'T'=on source, 'U'=???
00448     float    *err,              // Ou: rms error returned
00449     float    *choppingRMS,    // Ou: Measure of chop-to-chop rms RELATIVE to full photometry;
00450     int     numData)        // In: Number of data points in the above arrays to use.
00451 {
00452 
00453     //    Local Declarations
00454     //    ------------------
00455     const char    routine[] = "getChopPhotomUndisp";
00456     char        lastType;
00457     int            index, numOfaccum;
00458     float        accum, accum2, *results, photom, mean, variance, rms;
00459 
00460     //    Algorithm
00461     //    ---------
00462 
00463     //    Initialise
00464     lastType = 'U';
00465     accum = 0.F;
00466     numOfaccum = 0;
00467 
00468     //    Allocate memory
00469     results = (float *) calloc (numData, sizeof (float));
00470     
00471     //    Create an array of photometric results for 'T' only
00472     for (index = 0; index < numData; index++)
00473     {
00474         //    If state has changed then compute the average brightness in the previous state
00475         if ((targetType[index] != lastType) && numOfaccum)
00476         {
00477             if (targetType[index] == 'T')
00478             {
00479                 results[index] = accum / ((float) numOfaccum);
00480             
00481                 //    Reset parameters
00482                 numOfaccum = 0;
00483                 accum = 0.F;
00484             }
00485         }
00486         
00487         //    Now accumulate
00488         if (targetType[index] == 'T')
00489         {
00490             accum += (float) collapsedData[index];
00491             numOfaccum++;
00492         }
00493         
00494         //    Save current state
00495         lastType = targetType[index];
00496     }
00497 
00498     //    Alright, now results[] has a number of non-zero values. Compute statistics
00499     accum = 0.F;
00500     accum2 = 0.F;
00501     numOfaccum = 0;
00502     for (index = 0; index < numData; index++)
00503     {
00504         if (results[index] != 0.F)
00505         {
00506             accum += results[index];
00507             accum2 += results[index] * results[index];
00508             numOfaccum++;
00509         }
00510     }
00511 
00512     //    Compute mean and variance
00513     mean = accum / ((float) numOfaccum);
00514     variance = (accum2 - mean * mean * ((float) numOfaccum)) / ((float) (numOfaccum - 1));
00515 
00516     //    Compute rms. If zero variance, set rms to a small value
00517     if (variance > 0.0)
00518         rms = sqrt(variance);
00519     else
00520         rms = 0.1F;
00521 
00522     *err = rms / sqrt((float)numOfaccum);
00523     photom = mean;
00524 
00525     //    Singularity check
00526     if (photom > 0.0)    
00527         *choppingRMS = rms / photom;    //    Return relative err per chop.
00528     else
00529     {
00530         /*    In dispsersed mode, this will always happen on detector 
00531         columns with zero weighting. So don't want to get too upset about it */
00532         *choppingRMS = NOT_A_NUMBER;
00533         sprintf (midiMessage, "Singularity detected. Values in this batch are unreliable");
00534         midiReportWarning (midiReportPtr, routine, __FILE__, __LINE__, midiMessage);
00535     }
00536 
00537     //    Release local memory
00538     free(results);
00539     
00540     return (photom);
00541 }
00542 /*****************************************************************************/
00543 
00544 
00545 /******************************************************************************
00546 *                European Southern Observatory
00547 *              VLTI MIDI Data Reduction Software 
00548 *
00549 * Module name:  computeBinnedPhotom
00550 * Input/Output: See function arguments to avoid duplication
00551 * Description:  This function computes HIGH_SENS combined photometry levels of 
00552 *                regions 1 and 2 at the follwing spectral channels:
00553 *                1) Channels:    113 -> 121    (PRISM)
00554 *                                052 -> 068    (GRISM) i.e. [ArIII] band
00555 *
00556 *                2) Channels:    088 -> 098    (PRISM)
00557 *                                116 -> 136    (GRISM) i.e. [SIV] band
00558 *
00559 *                3) Channels:    036 -> 050    (PRISM)
00560 *                                217 -> 245    (GRISM) i.e. [NeII] band
00561 * History:        
00562 * 21-Sep-06        (csabet) Created
00563 ******************************************************************************/
00564 void computeBinnedPhotom (
00565     CompressedData    *photomA,    // In: Compressed data
00566     CompressedData    *photomB,    // In: Compressed data
00567     ImageFormat        *format,    // In: Photometry size
00568     float            *photomA1,    // Ou: Binned photometry
00569     float            *photomA2,    // Ou: Binned photometry
00570     float            *photomA3,    // Ou: Binned photometry
00571     float            *photomB1,    // Ou: Binned photometry
00572     float            *photomB2,    // Ou: Binned photometry
00573     float            *photomB3,    // Ou: Binned photometry
00574     int                *error)        // Ou: Error status
00575 {
00576 
00577     //    Local Declarations
00578     //    ------------------
00579     const char    routine[] = "computeBinnedPhotom";
00580     int            i, j;
00581 
00582     //    Algorithm
00583     //    ---------
00584 
00585     //    Reset parameters
00586     *error = 0;
00587     *photomA1 = *photomA2 = *photomA3 = 0.0;
00588     *photomB1 = *photomB2 = *photomB3 = 0.0;
00589 
00590     if (strcmp(format->grismId, "PRISM") == 0)
00591     {
00592         for (i = 36; i < 51; i++)
00593         {
00594             if (badChannelList[i])
00595                 continue;
00596                 
00597             for (j = 0; j < format->numOfFrames; j++)
00598             {
00599                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00600                     *photomA3 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00601                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00602                     *photomB3 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00603             }
00604         }
00605         for (i = 88; i < 99; i++)
00606         {
00607             if (badChannelList[i])
00608                 continue;
00609                 
00610             for (j = 0; j < format->numOfFrames; j++)
00611             {
00612                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00613                     *photomA2 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00614                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00615                     *photomB2 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00616             }
00617         }
00618         for (i = 113; i < 122; i++)
00619         {
00620             if (badChannelList[i])
00621                 continue;
00622                 
00623             for (j = 0; j < format->numOfFrames; j++)
00624             {
00625                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00626                     *photomA1 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00627                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00628                     *photomB1 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00629             }
00630         }
00631     }
00632     else if (strcmp(format->grismId, "GRISM") == 0)
00633     {
00634         for (i = 52; i < 69; i++)
00635         {
00636             if (badChannelList[i])
00637                 continue;
00638                 
00639             for (j = 0; j < format->numOfFrames; j++)
00640             {
00641                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00642                     *photomA1 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00643                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00644                     *photomB1 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00645             }
00646         }
00647         for (i = 116; i < 137; i++)
00648         {
00649             if (badChannelList[i])
00650                 continue;
00651                 
00652             for (j = 0; j < format->numOfFrames; j++)
00653             {
00654                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00655                     *photomA2 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00656                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00657                     *photomB2 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00658             }
00659         }
00660         for (i = 217; i < 245; i++)
00661         {
00662             if (badChannelList[i])
00663                 continue;
00664                 
00665             for (j = 0; j < format->numOfFrames; j++)
00666             {
00667                 if (photomA->tarType[j] == 'T' && !(photomA->rejectList[i][j]))
00668                     *photomA3 += ( (((photomA->iDispFringe)[0])[i])[j] + (((photomA->iDispFringe)[1])[i])[j] );
00669                 if (photomB->tarType[j] == 'T' && !(photomB->rejectList[i][j]))
00670                     *photomB3 += ( (((photomB->iDispFringe)[0])[i])[j] + (((photomB->iDispFringe)[1])[i])[j] );
00671             }
00672         }
00673     }
00674     else
00675     {
00676         sprintf (midiMessage, "Unknown GRISM ID ... %s", format->grismId);
00677         midiReportWarning (midiReportPtr, routine, __FILE__, __LINE__, midiMessage);
00678         *error = 1;
00679         return;
00680     }
00681 
00682     return;
00683 }
00684 /*****************************************************************************/
00685 

Generated on 15 Mar 2012 for MIDI Pipeline Reference Manual by  doxygen 1.6.1