IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2587


Ignore:
Timestamp:
Dec 1, 2004, 11:39:30 AM (22 years ago)
Author:
gusciora
Message:

astyle

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/Makefile.am

    r2271 r2587  
    11lib_LIBRARIES = libpsmodule.a
    22
    3 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c
    4 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h
     3libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c pmSubtractSky.c
     4libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h pmSubtractSky.h
    55libpsmodule_adir = $(includedir)
  • trunk/psModules/src/Makefile.in

    r2271 r2587  
    9696lib_LIBRARIES = libpsmodule.a
    9797
    98 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c
    99 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h
     98libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c pmSubtractSky.c
     99libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h pmSubtractSky.h
    100100libpsmodule_adir = $(includedir)
    101101subdir = src
     
    110110        pmMaskBadPixels.$(OBJEXT) pmSubtractBias.$(OBJEXT) \
    111111        psTest.$(OBJEXT) pmSubtractBias.$(OBJEXT) pmNonLinear.$(OBJEXT) \
    112         pmReadoutCombine.$(OBJEXT)
     112        pmReadoutCombine.$(OBJEXT) pmSubtractSky.$(OBJEXT)
    113113libpsmodule_a_OBJECTS = $(am_libpsmodule_a_OBJECTS)
    114114
     
    124124@AMDEP_TRUE@    ./$(DEPDIR)/pmNonLinear.Po \
    125125@AMDEP_TRUE@    ./$(DEPDIR)/pmReadoutCombine.Po \
    126 @AMDEP_TRUE@    ./$(DEPDIR)/pmSubtractBias.Po ./$(DEPDIR)/psTest.Po
     126@AMDEP_TRUE@    ./$(DEPDIR)/pmSubtractBias.Po \
     127@AMDEP_TRUE@    ./$(DEPDIR)/pmSubtractSky.Po ./$(DEPDIR)/psTest.Po
    127128COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    128129        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     
    212213@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmReadoutCombine.Po@am__quote@
    213214@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmSubtractBias.Po@am__quote@
     215@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmSubtractSky.Po@am__quote@
    214216@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psTest.Po@am__quote@
    215217
  • trunk/psModules/src/pmSubtractSky.c

    r2586 r2587  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-12-01 21:27:26 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-12-01 21:39:30 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1616#include "pslib.h"
    1717#include "psConstants.h"
     18
     19typedef enum {
     20    PM_FIT_NONE,                              ///< No fit
     21    PM_FIT_POLYNOMIAL,                        ///< Fit polynomial
     22    PM_FIT_SPLINE                             ///< Fit cubic splines
     23} pmFit;
    1824
    1925int p_psDetermineNumBits(unsigned int data)
     
    5056        return(PS_STAT_ROBUST_MODE);
    5157    }
    52     psError(XXX);
     58    //    psError(XXX);
    5359    return(-1);
    5460}
     
    6874    psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32);
    6975    psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8);
    70     psStats *myStats = psStatsAlloc(statOptions)
    71 
    72                        if (binFactor <= 0) {
    73                            psLogMsg(__func__, PS_LOG_WARN,
    74                                     "WARNING: binImage(): binFactor is %d\n", binFactor);
    75                            return(origImage);
    76                        }
    77                        if (binFactor == 1) {
    78                            return(origImage);
    79                        }
    80 
    81                        for (int row = 0; row < origImage->numRows ; row+=binFactor) {
    82                            for (int col = 0; col < origImage->numCols ; col+=binFactor) {
    83                                int count = 0;
    84                                for (int binRow = 0; binRow <= binFactor ; binRow++) {
    85                                    for (int binCol = 0; binCol <= binFactor ; binCol++) {
    86                                        if (((row + binRow) < origImage->numRows) &&
    87                                                ((col + binCol) < origImage->numCol)) {
    88                                            binVector->data.F32[count] =
    89                                                origImage->data.F32[row + binRow][col + binCol];
    90                                            binMask->data.U8[count] = 0;
    91                                        } else {
    92                                            binVector->data.F32[count] = 0.0;
    93                                            binMask->data.U8[count] = 1;
    94                                        }
    95                                        count++;
    96                                    }
    97                                }
    98                                myStats = psVectorStats(myStats, binVector, binMask, 1);
    99                                psF64 statValue;
    100                                psBool rc = p_psGetStatValue(myStats, &statValue);
    101 
    102                                if (rc == true) {
    103                                    origImage->data.F32[row][col] = (psF32) statValue;
    104                                } else {
    105                                    origImage->data.F32[row][col] = 0.0;
    106                                    psLogMsg(__func__, PS_LOG_WARN,
    107                                             "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n");
    108                                }
    109                            }
    110                        }
    111                        psFree(myStats);
     76    psStats *myStats = psStatsAlloc(statOptions);
     77
     78    if (binFactor <= 0) {
     79        psLogMsg(__func__, PS_LOG_WARN,
     80                 "WARNING: binImage(): binFactor is %d\n", binFactor);
     81        return(origImage);
     82    }
     83    if (binFactor == 1) {
     84        return(origImage);
     85    }
     86
     87    for (int row = 0; row < origImage->numRows ; row+=binFactor) {
     88        for (int col = 0; col < origImage->numCols ; col+=binFactor) {
     89            int count = 0;
     90            for (int binRow = 0; binRow <= binFactor ; binRow++) {
     91                for (int binCol = 0; binCol <= binFactor ; binCol++) {
     92                    if (((row + binRow) < origImage->numRows) &&
     93                            ((col + binCol) < origImage->numCol)) {
     94                        binVector->data.F32[count] =
     95                            origImage->data.F32[row + binRow][col + binCol];
     96                        binMask->data.U8[count] = 0;
     97                    } else {
     98                        binVector->data.F32[count] = 0.0;
     99                        binMask->data.U8[count] = 1;
     100                    }
     101                    count++;
     102                }
     103            }
     104            myStats = psVectorStats(myStats, binVector, binMask, 1);
     105            psF64 statValue;
     106            psBool rc = p_psGetStatValue(myStats, &statValue);
     107
     108            if (rc == true) {
     109                origImage->data.F32[row][col] = (psF32) statValue;
     110            } else {
     111                origImage->data.F32[row][col] = 0.0;
     112                psLogMsg(__func__, PS_LOG_WARN,
     113                         "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n");
     114            }
     115        }
     116    }
     117    psFree(myStats);
    112118    psFree(binVector);
    113119    psFree(binMask);
Note: See TracChangeset for help on using the changeset viewer.