IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4201


Ignore:
Timestamp:
Jun 9, 2005, 1:41:57 PM (21 years ago)
Author:
desonia
Message:

made functions static, as needed.

Location:
trunk/psModules
Files:
3 edited

Legend:

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

    r4168 r4201  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-06-09 00:59:53 $
     7 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-06-09 23:41:56 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5555}
    5656
    57 static void p_psModelFree(psModel *tmp)
     57static void modelFree(psModel *tmp)
    5858{
    5959    psFree(tmp->params);
     
    6464pmModelAlloc(): Allocate the psModel structure, along with its parameters,
    6565and initialize the type member.  Initialize the params to 0.0.
    66 XXX EAM: changing params and dparams to psVector 
     66XXX EAM: changing params and dparams to psVector
    6767*****************************************************************************/
    6868psModel *pmModelAlloc(psModelType type)
     
    107107    }
    108108
    109     psMemSetDeallocator(tmp, (psFreeFcn) p_psModelFree);
     109    psMemSetDeallocator(tmp, (psFreeFcn) modelFree);
    110110    return(tmp);
    111111}
     
    115115We might need to increase the reference counter and decrease it here.
    116116*****************************************************************************/
    117 static void p_psSourceFree(psSource *tmp)
     117static void sourceFree(psSource *tmp)
    118118{
    119119    psFree(tmp->peak);
     
    137137    tmp->models = NULL;
    138138    tmp->type = 0;
    139     psMemSetDeallocator(tmp, (psFreeFcn) p_psSourceFree);
     139    psMemSetDeallocator(tmp, (psFreeFcn) sourceFree);
    140140
    141141    return(tmp);
     
    242242
    243243/******************************************************************************
    244 p_psGetRowVectorFromImage(): a private function which simply returns a
     244getRowVectorFromImage(): a private function which simply returns a
    245245psVector containing the specified row of data from the psImage.
    246246 
    247247XXX: Is there a better way to do this?
    248248*****************************************************************************/
    249 psVector *p_psGetRowVectorFromImage(psImage *image,
    250                                     psU32 row)
     249static psVector *getRowVectorFromImage(psImage *image,
     250                                       psU32 row)
    251251{
    252252    PS_ASSERT_IMAGE_NON_NULL(image, NULL);
     
    261261
    262262/******************************************************************************
    263 MyListAddPeak(): A private function which allocates a psArray, if the list
     263myListAddPeak(): A private function which allocates a psArray, if the list
    264264argument is NULL, otherwise it adds the peak to that list.
    265 XXX EAM : changed the output to psArray 
    266 XXX EAM : Switched row, col args 
     265XXX EAM : changed the output to psArray
     266XXX EAM : Switched row, col args
    267267XXX EAM : NOTE: this was changed in the call, so the new code is consistent
    268268*****************************************************************************/
    269 psArray *MyListAddPeak(psArray *list,
    270                        psS32 row,
    271                        psS32 col,
    272                        psF32 counts,
    273                        psPeakType type)
     269static psArray *myListAddPeak(psArray *list,
     270                              psS32 row,
     271                              psS32 col,
     272                              psF32 counts,
     273                              psPeakType type)
    274274{
    275275    psPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);
     
    320320    //
    321321    row = 0;
    322     tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
     322    tmpRow = getRowVectorFromImage((psImage *) image, row);
    323323    psVector *row1 = pmFindVectorPeaks(tmpRow, threshold);
    324324
     
    334334
    335335                if (image->data.F32[row][col] > threshold) {
    336                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     336                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    337337                }
    338338            }
     
    344344                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
    345345                if (image->data.F32[row][col] > threshold) {
    346                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     346                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    347347                }
    348348            }
     
    353353                    (image->data.F32[row][col] >= image->data.F32[row+1][col-1])) {
    354354                if (image->data.F32[row][col] > threshold) {
    355                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     355                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    356356                }
    357357            }
     
    373373    //
    374374    for (row = 1 ; row < (image->numRows - 1) ; row++) {
    375         tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
     375        tmpRow = getRowVectorFromImage((psImage *) image, row);
    376376        row1 = pmFindVectorPeaks(tmpRow, threshold);
    377377
     
    389389                        (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
    390390                    myType = PM_PEAK_EDGE;
    391                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], myType);
     391                    list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
    392392                }
    393393            } else if (col < (image->numCols - 1)) {
     
    424424                        }
    425425
    426                         list = MyListAddPeak(list, row, col, image->data.F32[row][col], myType);
     426                        list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
    427427                    }
    428428                }
     
    436436                        (image->data.F32[row][col] >= image->data.F32[row+1][col])) {
    437437                    myType = PM_PEAK_EDGE;
    438                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], myType);
     438                    list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
    439439                }
    440440            } else {
     
    449449    //
    450450    row = image->numRows - 1;
    451     tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
     451    tmpRow = getRowVectorFromImage((psImage *) image, row);
    452452    row1 = pmFindVectorPeaks(tmpRow, threshold);
    453453    for (psU32 i = 0 ; i < row1->n ; i++ ) {
     
    458458                    (image->data.F32[row][col] >  image->data.F32[row][col+1])) {
    459459                if (image->data.F32[row][col] > threshold) {
    460                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     460                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    461461                }
    462462            }
     
    468468                    (image->data.F32[row][col] >= image->data.F32[row][col+1])) {
    469469                if (image->data.F32[row][col] > threshold) {
    470                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     470                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    471471                }
    472472            }
     
    477477                    (image->data.F32[row][col] >  image->data.F32[row][col-1])) {
    478478                if (image->data.F32[row][col] > threshold) {
    479                     list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     479                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
    480480                }
    481481            }
     
    488488
    489489// XXX: Macro this.
    490 bool IsItInThisRegion(const psRegion *valid,
    491                       psS32 x,
    492                       psS32 y)
     490static bool isItInThisRegion(const psRegion *valid,
     491                             psS32 x,
     492                             psS32 y)
    493493{
    494494
     
    529529        if ((tmpPeak->counts > maxValue) ||
    530530                ((valid != NULL) &&
    531                  (true == IsItInThisRegion(valid, tmpPeak->x, tmpPeak->y)))) {
     531                 (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y)))) {
    532532            psListRemoveData(peaks, (psPtr) tmpPeak);
    533533        }
     
    556556            continue;
    557557        if (valid != NULL) {
    558             if (IsItInThisRegion(valid, tmpPeak->x, tmpPeak->y))
     558            if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))
    559559                continue;
    560560        }
     
    740740
    741741/******************************************************************************
    742 bool CheckRadius(*peak, radius, x, y): private function which simply
     742bool checkRadius(*peak, radius, x, y): private function which simply
    743743determines if the (x, y) point is within the radius of the specified peak.
    744744 
    745745XXX: macro this for performance.
    746746*****************************************************************************/
    747 bool CheckRadius(psPeak *peak,
    748                  psF32 radius,
    749                  psS32 x,
    750                  psS32 y)
     747static bool checkRadius(psPeak *peak,
     748                        psF32 radius,
     749                        psS32 x,
     750                        psS32 y)
    751751{
    752752    if (PS_SQR(radius) >= (psF32) (PS_SQR(x - peak->x) + PS_SQR(y - peak->y))) {
     
    758758
    759759/******************************************************************************
    760 bool CheckRadius2(): private function which simply determines if the (x, y)
     760bool checkRadius2(): private function which simply determines if the (x, y)
    761761point is within the radius of the specified peak.
    762762 
     
    764764XXX: this is rather inefficient - at least compute and compare against radius^2
    765765*****************************************************************************/
    766 bool CheckRadius2(psF32 xCenter,
    767                   psF32 yCenter,
    768                   psF32 radius,
    769                   psF32 x,
    770                   psF32 y)
     766static bool checkRadius2(psF32 xCenter,
     767                         psF32 yCenter,
     768                         psF32 radius,
     769                         psF32 x,
     770                         psF32 y)
    771771{
    772772    /// XXX EAM should compare with hypot (x,y) for speed
     
    840840                psS32 imgColCoord = col + source->pixels->col0;
    841841                psS32 imgRowCoord = row + source->pixels->row0;
    842                 if (CheckRadius(source->peak,
     842                if (checkRadius(source->peak,
    843843                                radius,
    844844                                imgColCoord,
     
    896896                psS32 imgColCoord = col + source->pixels->col0;
    897897                psS32 imgRowCoord = row + source->pixels->row0;
    898                 if (CheckRadius(source->peak,
     898                if (checkRadius(source->peak,
    899899                                radius,
    900900                                imgColCoord,
     
    12761276        for (psS32 col = 0 ; col < source->mask->numCols; col++) {
    12771277
    1278             if (CheckRadius2((psF32) radiusS32,
     1278            if (checkRadius2((psF32) radiusS32,
    12791279                             (psF32) radiusS32,
    12801280                             radius,
     
    15671567routine returns a psArray of coordinates that evaluate to the specified level.
    15681568 
    1569 XXX: Probably should remove the "image" argument. 
     1569XXX: Probably should remove the "image" argument.
    15701570XXX: What type should the output coordinate vectors consist of?  col,row?
    15711571XXX: Why a pmArray output?
     
    16681668}
    16691669
    1670 psVector *p_pmMinLM_Gauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
    1671 psVector *p_pmMinLM_PsuedoGauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
    1672 psVector *p_pmMinLM_Wauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
    1673 psVector *p_pmMinLM_TwistGauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
    1674 psVector *p_pmMinLM_Sersic_Vec(psImage *deriv, psVector *params, psArray *x);
    1675 psVector *p_pmMinLM_SersicCore_Vec(psImage *deriv, psVector *params, psArray *x);
     1670#if 0
     1671static psVector *minLM_Gauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
     1672static psVector *minLM_PsuedoGauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
     1673static psVector *minLM_Wauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
     1674static psVector *minLM_TwistGauss2D_Vec(psImage *deriv, psVector *params, psArray *x);
     1675static psVector *minLM_Sersic_Vec(psImage *deriv, psVector *params, psArray *x);
     1676static psVector *minLM_SersicCore_Vec(psImage *deriv, psVector *params, psArray *x);
     1677#endif
    16761678
    16771679// XXX EAM : these are better starting values, but should be available from metadata?
     
    16831685 
    16841686XXX: should there be a mask value?
    1685 XXX: Probably should remove the "image" argument. 
     1687XXX: Probably should remove the "image" argument.
    16861688*****************************************************************************/
    16871689bool pmSourceFitModel(psSource *source,
     
    17721774}
    17731775
    1774 bool p_pmSourceAddOrSubModel(psImage *image,
    1775                              psSource *src,
    1776                              bool center,
    1777                              psS32 flag)
     1776static bool sourceAddOrSubModel(psImage *image,
     1777                                psSource *src,
     1778                                bool center,
     1779                                psS32 flag)
    17781780{
    17791781    PS_ASSERT_PTR_NON_NULL(src, false);
     
    18471849                      bool center)
    18481850{
    1849     return(p_pmSourceAddOrSubModel(image, src, center, 0));
     1851    return(sourceAddOrSubModel(image, src, center, 0));
    18501852}
    18511853
     
    18561858                      bool center)
    18571859{
    1858     return(p_pmSourceAddOrSubModel(image, src, center, 1));
     1860    return(sourceAddOrSubModel(image, src, center, 1));
    18591861}
    18601862
     
    18741876 
    18751877   the argument "x" contains a single "x,y" coordinate pair.  The function computes the object
    1876    model, based on the parameters in "params" at the x,y point specified by *x, and returns the value. 
    1877    The derivatives are also caculated and returned in the "deriv" argument.  parameter error checking is 
     1878   model, based on the parameters in "params" at the x,y point specified by *x, and returns the value.
     1879   The derivatives are also caculated and returned in the "deriv" argument.  parameter error checking is
    18781880   skipped because speed is most important.
    18791881**/
  • trunk/psModules/test

    • Property svn:ignore
      •  

        old new  
        1111tst_pmReadoutCombine
        1212tst_pmSubtractSky
         13tst_pmImageSubtract
  • trunk/psModules/test/.cvsignore

    r3633 r4201  
    1111tst_pmReadoutCombine
    1212tst_pmSubtractSky
    13 
     13tst_pmImageSubtract
Note: See TracChangeset for help on using the changeset viewer.