IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2025, 4:10:23 PM (15 months ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20230313
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313

  • branches/eam_branches/ipp-20230313/psModules

  • branches/eam_branches/ipp-20230313/psModules/src/camera/pmFPA.c

    r26893 r42820  
    5353    }
    5454    psTrace("psModules.camera", 9, "Freeing cell %zd\n", (size_t)cell);
     55
    5556    pmCellFreeReadouts(cell);
    5657    psFree(cell->readouts);
    57 
    5858    psFree(cell->concepts);
    5959    psFree(cell->analysis);
     
    166166    psFree(readout->variance);
    167167    psFree(readout->covariance);
     168    psFree(readout->analysis);
    168169    psFree(readout->bias);
    169170
     
    173174    readout->variance = NULL;
    174175    readout->covariance = NULL;
     176    readout->analysis = NULL;
    175177    readout->mask = NULL;
    176 
    177     readout->bias = psListAlloc(NULL);
     178    readout->bias = NULL;
    178179
    179180    readout->col0 = 0;
  • branches/eam_branches/ipp-20230313/psModules/src/camera/pmFPAConstruct.c

    r41892 r42820  
    5252
    5353// Parse a list of first:second:third pairs in a string
     54// EAM : this function takes an input 'string' and attempts to parse out
     55// groups of the form FIRST:SECOND:THIRD into the arrays (first, second, third).
     56
     57// The input string may have multiple entries of this form separated by spaces, commas, or
     58// semi-colons.  The number of arrays which are supplied must match the string format or
     59// an error will be raised.
     60
     61// e.g., the string could be CHIP:CELL:TYPE in which case all three arrays must exist
     62// or, the string could be CHIP:CELL only, in which case the array 'third' must be NULL
     63 
    5464static int parseContent(psArray **first, // Array of the first values
    5565                         psArray **second, // Array of the second values
     
    8393    while ((value = psListGetAndIncrement(valuesIter))) {
    8494        psArray *fst = psStringSplitArray(value, ":", true); // First, second, third
     95        if (fst->n != numArrays) {
     96          psError(PS_ERR_BAD_PARAMETER_VALUE, false, "string %s does not match expected format (%ld colon-separated items supplied, %d expected)", value, fst->n, numArrays);
     97          return 0;
     98        }
    8599        switch (numArrays) {
    86100          case 3:
     
    11261140    pmFPAview *view = pmFPAviewAlloc(0); // View, to be returned
    11271141    if (phuView) {
    1128         // Copy the view, for the case where we're given a view.
     1142        // Copy the view values, for the case where we're given a view.
    11291143        *view = *phuView;
    11301144    }
  • branches/eam_branches/ipp-20230313/psModules/src/detrend/pmDark.c

    r42379 r42820  
    252252    }
    253253
     254# if (PS_TRACE_ON)
    254255    if (psTraceGetLevel("psModules.detrend") > 9) {
    255256        for (int i = 0; i < inputs->n; i++) {
    256257            psVector *val = values->data[i];
    257             (void) val; // avoid unused variable message when tracing is compiled out
    258258            for (int j = 0; j < ordinates->n; j++) {
    259259                psTrace("psModules.detrend", 9, "Image %d, ordinate %d: %f\n", i, j, val->data.F32[j]);
     
    261261        }
    262262    }
     263# endif
    263264
    264265    int numTerms = 1;                   // Number of terms in polynomial
     
    292293        pmReadout *readout = output->readouts->data[i]; // Readout to update
    293294        if (!readout) {
    294             readout = output->readouts->data[i] = pmReadoutAlloc(output);
    295         }
    296 
     295            // pmReadoutAlloc places a reference to the readout on cell->readouts
     296            // and returns a second mem reference to the readout
     297            readout = pmReadoutAlloc(output);
     298            psFree (readout); // free the extra mem reference returned by pmReadoutAlloc
     299        }
    297300        pmReadoutStackDefineOutput(readout, col0, row0, numCols, numRows, false, false, 0);
    298301        psTrace("psModules.imcombine", 7, "Output minimum: %d,%d\n", col0, row0);
     
    469472              for (int m = 0; m < poly->deviations->n; m++) {
    470473                logL->data.F64[k] += pow(poly->deviations->data.F32[m] / polySig->stdevFit,2);
    471 /*              if ((xOut == 20) && (yOut == 256)) { */
    472 /*                psTrace("psModules.detrend",3,"pmDarkCombine DEV: %d %d: input %d models: Norders: %d logL: %g value: %g\n", */
    473 /*                        xOut,yOut,m,k,logL->data.F64[k],poly->deviations->data.F32[m]); */
    474 /*              } */
    475474              }
    476475              if (k > 0) {
     
    487486              k_best = 1;
    488487            }
    489 /*          k_best = 1; */
     488
    490489            // Select the polynomial that seems best.
    491490            psPolynomialMD *poly = poly_set->data[k_best];
    492491             
    493             //            for (int k = 0; k < poly->coeff->n; k++) {
    494492            for (int k = 0; k < max_orders->n + 1; k++) { // There is one more coefficient than is stored here.
    495493                pmReadout *ro = output->readouts->data[k]; // Readout of interest
    496494                if (k < poly->coeff->n) {
    497495                  ro->image->data.F32[yOut][xOut] = poly->coeff->data.F64[k];
    498                 }
    499                 else {
     496                } else {
    500497                  ro->image->data.F32[yOut][xOut] = 0.0;
    501498                }
Note: See TracChangeset for help on using the changeset viewer.