IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13814


Ignore:
Timestamp:
Jun 13, 2007, 4:46:25 PM (19 years ago)
Author:
Paul Price
Message:

Using pmFPADarkNorm to apply polynomial correction to the darktime.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeScaleZero.c

    r10744 r13814  
    146146    }
    147147
     148    pmFPAview *view = pmFPAviewAlloc(0);
     149
    148150    bool status = true;                 // Status of getting the scale and zero --- did everything go right?
    149151    for (int i = 0; i < filenames->n; i++) {
     
    176178                // Normalising by the exposure time
    177179                if (options->darktime) {
    178                     darktime->data.F32[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,
    179                                                                         "CELL.DARKTIME");
    180                     if (!mdok || isnan(darktime->data.F32[i][cellNum])) {
    181                         psLogMsg(__func__, PS_LOG_WARN, "CELL.DARKTIME for file %s chip %d cell %d is not "
    182                                  "set.\n", name, j, k);
    183                         darktime->data.F32[i][cellNum] = NAN;
     180                    darktime->data.F32[i][cellNum] = psMetadataLookupF32(NULL, cell->concepts,
     181                                                                         "CELL.DARKTIME");
     182                    if (isnan(darktime->data.F32[i][cellNum])) {
     183                        psWarning("CELL.DARKTIME for file %s chip %d cell %d is not set.\n", name, j, k);
    184184                        status = false;
     185                    } else {
     186                        view->chip = j;
     187                        view->cell = k;
     188                        darktime->data.F32[i][cellNum] = pmFPADarkNorm(fpa, view,
     189                                                                       darktime->data.F32[i][cellNum]);
     190                        if (isnan(darktime->data.F32[i][cellNum])) {
     191                            psWarning("Cannot get dark normalisation for file %s chip %d cell %d.\n",
     192                                      name, j, k);
     193                            status = false;
     194                        }
    185195                    }
    186196                }
     
    237247                    }
    238248                    status = psVectorStats(bgStats, sample, sampleMask, NULL, options->combine->maskVal);
    239                     if (!status) {
    240                       psTrace("ppMerge", 3, "failed to get stats for for %s, cell %d is %f\n", name, cellNum,
    241                               background->data.F32[i][cellNum]);
    242                       psErrorClear();
    243                     }
     249                    if (!status) {
     250                      psTrace("ppMerge", 3, "failed to get stats for for %s, cell %d is %f\n", name, cellNum,
     251                              background->data.F32[i][cellNum]);
     252                      psErrorClear();
     253                    }
    244254                    psFree(sample);
    245255                    psFree(sampleMask);
     
    256266    }
    257267    psFree(bgStats);
     268    psFree(view);
    258269
    259270    if (options->scale) {
Note: See TracChangeset for help on using the changeset viewer.