IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2928 for trunk/psModules/src


Ignore:
Timestamp:
Jan 7, 2005, 10:00:34 AM (22 years ago)
Author:
gusciora
Message:

Fixed a few error conditions.

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmNonLinear.c

    r2916 r2928  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-01-05 23:43:58 $
     7 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-01-07 20:00:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4141    psS32 j;
    4242
    43     for (i=0;i<(inputReadout->image)->numRows;i++) {
    44         for (j=0;j<(inputReadout->image)->numCols;j++) {
    45             (inputReadout->image)->data.F32[i][j] = psPolynomial1DEval(input1DPoly, (inputReadout->image)->data.F32[i][j]);
     43    for (i=0;i<inputReadout->image->numRows;i++) {
     44        for (j=0;j<inputReadout->image->numCols;j++) {
     45            inputReadout->image->data.F32[i][j] = psPolynomial1DEval(input1DPoly, inputReadout->image->data.F32[i][j]);
    4646        }
    4747    }
     
    6565    PS_IMAGE_CHECK_TYPE(inputReadout->image, PS_TYPE_F32, NULL);
    6666    PS_PTR_CHECK_NULL(inFlux,NULL);
    67     psS32 tableSize = inFlux->n;
    6867    if (inFlux->n < 2) {
    6968        psError(PS_ERR_UNKNOWN,true, "pmNonLinearityLookup(): input vector less than 2 elements.  Returning inputReadout image.");
     
    7170    }
    7271    PS_PTR_CHECK_NULL(outFlux,NULL);
     72    psS32 tableSize = inFlux->n;
    7373    if (inFlux->n != outFlux->n) {
    7474        tableSize = PS_MIN(inFlux->n, outFlux->n);
     
    8787
    8888    x.type.type = PS_TYPE_F32;
    89     for (i=0;i<(inputReadout->image)->numRows;i++) {
    90         for (j=0;j<(inputReadout->image)->numCols;j++) {
    91             x.data.F32 = (inputReadout->image)->data.F32[i][j];
    92 
     89    for (i=0;i<inputReadout->image->numRows;i++) {
     90        for (j=0;j<inputReadout->image->numCols;j++) {
     91            x.data.F32 = inputReadout->image->data.F32[i][j];
    9392            binNum = p_psVectorBinDisect((psVector *)inFlux, &x);
    9493
    9594            if (binNum == -2) {
    9695                // We get here if x is below the table lookup range.
    97                 (inputReadout->image)->data.F32[i][j] = outFlux->data.F32[0];
     96                inputReadout->image->data.F32[i][j] = outFlux->data.F32[0];
    9897                numPixels++;
    9998
    10099            } else if (binNum == -1) {
    101100                // We get here if x is above the table lookup range.
    102                 (inputReadout->image)->data.F32[i][j] = outFlux->data.F32[tableSize-1];
     101                inputReadout->image->data.F32[i][j] = outFlux->data.F32[tableSize-1];
     102                numPixels++;
    103103
    104                 numPixels++;
    105104            } else if (binNum < -2) {
    106105                // We get here if there was some other problem.
     
    112111                slope = (outFlux->data.F32[binNum+1] - outFlux->data.F32[binNum]) /
    113112                        (inFlux->data.F32[binNum+1]  - inFlux->data.F32[binNum]);
    114                 (inputReadout->image)->data.F32[i][j] = outFlux->data.F32[binNum] +
    115                                                         ((x.data.F32 - inFlux->data.F32[binNum]) * slope);
     113                inputReadout->image->data.F32[i][j] = outFlux->data.F32[binNum] +
     114                                                      ((x.data.F32 - inFlux->data.F32[binNum]) * slope);
    116115            }
    117116        }
  • trunk/psModules/src/pmReadoutCombine.c

    r2916 r2928  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-01-05 23:43:58 $
     7 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-01-07 20:00:34 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727    psS32 numBits = 0;
    2828
    29     for (i=0;i<4 * sizeof(psStatsOptions);i++) {
     29    for (i=0;i<8 * sizeof(psStatsOptions);i++) {
    3030        if (0x0001 & tmpData) {
    3131            numBits++;
  • trunk/psModules/src/pmSubtractSky.c

    r2916 r2928  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-01-05 23:43:58 $
     8 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-01-07 20:00:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929    psS32 numBits = 0;
    3030
    31     for (i=0;i<4 * sizeof(psStatsOptions);i++) {
     31    for (i=0;i<8 * sizeof(psStatsOptions);i++) {
    3232        if (0x0001 & tmpData) {
    3333            numBits++;
     
    439439    psStatsOptions statOptions = 0;
    440440
     441    //
    441442    // Return the original input readout if the fit specs are poorly defined.
     443    // No warning or error messages should be generated.
     444    //
    442445    if ((fitSpec == NULL) ||
    443446            ((fit == PM_FIT_NONE) || (fit == PM_FIT_SPLINE))) {
    444         psLogMsg(__func__, PS_LOG_WARN, "Fit specs are poorly defined.  Returning in image.\n");
     447        //        psLogMsg(__func__, PS_LOG_WARN, "Fit specs are poorly defined.  Returning in image.\n");
    445448        return(in);
    446449    }
Note: See TracChangeset for help on using the changeset viewer.