IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4992


Ignore:
Timestamp:
Sep 11, 2005, 12:25:39 PM (21 years ago)
Author:
gusciora
Message:

....

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimize.c

    r4991 r4992  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.135 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-09-11 22:18:40 $
     12 *  @version $Revision: 1.136 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-09-11 22:25:29 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    306306    PS_ASSERT_VECTOR_NON_NULL(beta, NAN);
    307307    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
    308     PS_ASSERT_VECTOR_NON_NULL(x, NAN);
     308    PS_ASSERT_PTR_NON_NULL(x, NAN);
    309309    PS_ASSERT_VECTOR_NON_NULL(y, NAN);
    310310    PS_ASSERT_VECTOR_NON_NULL(dy, NAN);
  • trunk/psModules/src/pmAstrometry.c

    r4779 r4992  
    88*  @author GLG, MHPCC
    99*
    10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-08-16 02:29:29 $
     10*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-09-11 22:25:39 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    106106}
    107107
    108 
     108// XXX: Verify these default values for row0, col0, rowBins, colBins
    109109pmReadout *pmReadoutAlloc(pmCell *cell)
    110110{
     
    707707*/
    708708
     709// XXX: How should we handle errors?  What if psMetadataLookup() is NULL?
    709710psMetadataItem *pmReadoutGetConcept(pmReadout *readout, const char *concept)
    710711{
     
    794795}
    795796
    796 psRegion *pmCellGetTrimSec(pmCell *cell) // CELL.TRIMSEC
     797psRegion pmCellGetTrimSec(pmCell *cell) // CELL.TRIMSEC
    797798{
    798799    psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.TRIMSEC");
    799     return((psRegion *) tmp->data.V);
     800    return((psRegion) *((psRegion *) (tmp->data.V)));
    800801}
    801802
     
    824825}
    825826
    826 psPixelCoord *pmCellGetBin(pmCell *cell) // CELL.BIN
     827
     828psPixelCoord pmCellGetBin(pmCell *cell) // CELL.BIN
    827829{
    828830    psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.BIN");
    829     return((psPixelCoord *) tmp->data.V);
    830 }
    831 
    832 psPixelCoord *pmCellGetParity(pmCell *cell) // CELL.PARITY
     831    return((psPixelCoord)  *((psPixelCoord *) (tmp->data.V)));
     832}
     833
     834psPixelCoord pmCellGetParity(pmCell *cell) // CELL.PARITY
    833835{
    834836    psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.PARITY");
    835     return((psPixelCoord *) tmp->data.V);
     837    return((psPixelCoord)  *((psPixelCoord *) (tmp->data.V)));
    836838}
    837839
  • trunk/psModules/src/pmAstrometry.h

    r4779 r4992  
    88*  @author GLG, MHPCC
    99*
    10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-08-16 02:29:29 $
     10*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-09-11 22:25:39 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    441441psTime *pmCellGetTime(pmCell *cell); // CELL.TIME
    442442psList *pmCellGetBiasSec(pmCell *cell); // CELL.BIASSEC
    443 psRegion *pmCellGetTrimSec(pmCell *cell); // CELL.TRIMSEC
     443psRegion pmCellGetTrimSec(pmCell *cell); // CELL.TRIMSEC
    444444float pmCellGetGain(pmCell *cell); // CELL.GAIN
    445445float pmCellGetReadNoise(pmCell *cell); // CELL.READNOISE
    446446float pmCellGetSaturation(pmCell *cell); // CELL.SATURATION
    447447float pmCellGetBad(pmCell *cell); // CELL.BAD
    448 psPixelCoord *pmCellGetBin(pmCell *cell); // CELL.BIN
    449 psPixelCoord *pmCellGetParity(pmCell *cell); // CELL.PARITY
     448psPixelCoord pmCellGetBin(pmCell *cell); // CELL.BIN
     449psPixelCoord pmCellGetParity(pmCell *cell); // CELL.PARITY
    450450float pmReadoutGetExposure(pmReadout *readout); // READOUT.EXPOSURE
    451451float pmReadoutGetDarkTime(pmReadout *readout); // READOUT.DARKTIME
  • trunk/psModules/src/pmImageCombine.c

    r4425 r4992  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-29 01:39:10 $
     10 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-09-11 22:25:39 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    308308/******************************************************************************
    309309XXX: Directly from Paul Price
    310 XXX: Must add mask parameter, use it in gradient calculation.
    311310 *****************************************************************************/
    312 static psF32 CalcGradient(psImage *image,
    313                           psS32 x,
    314                           psS32 y)
     311static psF32 CalcGradient(
     312    psImage *image,
     313    psImage *imageMask,
     314    psS32 x,
     315    psS32 y
     316)
    315317{
    316318    psTrace("ImageCombine.CalcGradient", 4, "Calling CalcGradient(%d, %d)\n", x, y);
     
    324326    int yMin = PS_MAX(y - 1, 0);
    325327    int yMax = PS_MIN(y + 1, image->numRows - 1);
    326     for (int j = yMin; j <= yMax; j++) {
    327         for (int i = xMin; i <= xMax; i++) {
    328             if ((i != x) && (j != y)) {
    329                 pixels->data.F32[num] = image->data.F32[j][i];
    330                 mask->data.U8[num] = 0;
    331                 num++;
     328    if (imageMask != NULL) {
     329        for (int j = yMin; j <= yMax; j++) {
     330            for (int i = xMin; i <= xMax; i++) {
     331                if ((i != x) && (j != y) && (0 == imageMask->data.U8[j][i])) {
     332                    pixels->data.F32[num] = image->data.F32[j][i];
     333                    mask->data.U8[num] = 0;
     334                    num++;
     335                } else {
     336                    mask->data.U8[num] = 1;
     337                }
    332338            }
    333339        }
    334     }
     340    } else {
     341        //
     342        // This code is simply the previous loop without the imageMask.
     343        // XXX: Consider restructuring this.
     344        //
     345        for (int j = yMin; j <= yMax; j++) {
     346            for (int i = xMin; i <= xMax; i++) {
     347                if ((i != x) && (j != y)) {
     348                    pixels->data.F32[num] = image->data.F32[j][i];
     349                    mask->data.U8[num] = 0;
     350                    num++;
     351                } else {
     352                    mask->data.U8[num] = 1;
     353                }
     354            }
     355        }
     356    }
     357
    335358    pixels->n = num;
    336359    mask->n = num;
     
    472495XXX: The inToOut and outToIn transforms are confusing.  Verify that what
    473496     I think they mean syncs with PWP.
    474 XXX: Must add mask parameter, use it in gradient calculation.
    475497 *****************************************************************************/
    476 psArray *pmRejectPixels(const psArray *images,          ///< Array of input images
    477                         const psArray *errors,          ///< The pixels which were rejected in the combination
    478                         const psArray *inToOut,         ///< Transformation from input to output system
    479                         const psArray *outToIn,         ///< Transformation from output to input system
    480                         psF32 rejThreshold,             ///< Rejection threshold
    481                         psF32 gradLimit                 ///< Gradient limit
    482                        )
     498psArray *pmRejectPixels(
     499    const psArray *images,              ///< Array of input images
     500    const psArray *masks,               ///< Array of input image masks
     501    const psArray *errors,              ///< The pixels which were rejected in the combination
     502    const psArray *inToOut,             ///< Transformation from input to output system
     503    const psArray *outToIn,             ///< Transformation from output to input system
     504    psF32 rejThreshold,                 ///< Rejection threshold
     505    psF32 gradLimit                     ///< Gradient limit
     506)
    483507{
    484508    psTrace("ImageCombine.pmRejectPixels", 3, "Calling pmRejectPixels()\n");
    485509    PS_ASSERT_PTR_NON_NULL(images, NULL);
     510    for (psS32 im = 0 ; im < images->n ; im++) {
     511        psImage *tmpImage = (psImage *) images->data[im];
     512        PS_ASSERT_IMAGE_NON_NULL(tmpImage, NULL);
     513        PS_ASSERT_IMAGE_NON_EMPTY(tmpImage, NULL);
     514        PS_ASSERT_IMAGE_TYPE(tmpImage, PS_TYPE_F32, NULL);
     515        if (masks != NULL) {
     516            PS_ASSERT_INT_EQUAL(images->n, masks->n, NULL);
     517            psImage *tmpMask = (psImage *) masks->data[im];
     518            PS_ASSERT_IMAGE_NON_NULL(tmpMask, NULL);
     519            PS_ASSERT_IMAGE_NON_EMPTY(tmpMask, NULL);
     520            PS_ASSERT_IMAGE_TYPE(tmpMask, PS_TYPE_F32, NULL);
     521            PS_ASSERT_IMAGES_SIZE_EQUAL(tmpImage, tmpMask, NULL);
     522        }
     523        PS_ASSERT_IMAGES_SIZE_EQUAL(((psImage *) images->data[0]), tmpImage, NULL);
     524    }
    486525    PS_ASSERT_PTR_NON_NULL(errors, NULL);
    487526    PS_ASSERT_PTR_NON_NULL(inToOut, NULL);
     
    492531    PS_ASSERT_INT_EQUAL(numImages, inToOut->n, NULL);
    493532    PS_ASSERT_INT_EQUAL(numImages, outToIn->n, NULL);
    494     // XXX: Loop through all images, ensure their sizes are equal
    495533
    496534    //
     
    570608                    if (im != otherImg) {
    571609                        // Map the outCoords to inCoords that for otherImg space.
     610                        psImage *tmpMask = NULL;
     611                        if (masks != NULL) {
     612                            tmpMask = masks->data[otherImg];
     613                        }
    572614                        psPlaneTransformApply(inCoords,
    573615                                              (psPlaneTransform * )outToIn->data[otherImg],
     
    577619                        if ((xPix >= 0) && (xPix <= ((psImage*)(images->data[otherImg]))->numCols - 1) &&
    578620                                (yPix >= 0) && (yPix <= ((psImage*)(images->data[otherImg]))->numRows - 1)) {
    579                             meanGrads += CalcGradient(images->data[otherImg], xPix, yPix);
     621                            meanGrads += CalcGradient(images->data[otherImg], tmpMask, xPix, yPix);
    580622                            numGrads++;
    581623                        }
  • trunk/psModules/src/pmImageCombine.h

    r4217 r4992  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-13 19:36:12 $
     10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-09-11 22:25:39 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "pslib.h"
    2727
    28 psImage *pmCombineImages(psImage *combine,              ///< Combined image (output)
    29                          psArray **questionablePixels,  ///< Array of rejection masks
    30                          const psArray *images,         ///< Array of input images
    31                          const psArray *errors,         ///< Array of input error images
    32                          const psArray *masks,          ///< Array of input masks
    33                          psU32 maskVal,                 ///< Mask value
    34                          const psPixels *pixels,        ///< Pixels to combine
    35                          psS32 numIter,                 ///< Number of rejection iterations
    36                          psF32 sigmaClip,               ///< Number of standard deviations at which to reject
    37                          const psStats *stats           ///< Statistics to use in the combination
    38                         );
     28psImage *pmCombineImages(
     29    psImage *combine,                   ///< Combined image (output)
     30    psArray **questionablePixels,       ///< Array of rejection masks
     31    const psArray *images,              ///< Array of input images
     32    const psArray *errors,              ///< Array of input error images
     33    const psArray *masks,               ///< Array of input masks
     34    psU32 maskVal,                      ///< Mask value
     35    const psPixels *pixels,             ///< Pixels to combine
     36    psS32 numIter,                      ///< Number of rejection iterations
     37    psF32 sigmaClip,                    ///< Number of standard deviations at which to reject
     38    const psStats *stats                ///< Statistics to use in the combination
     39);
    3940
    40 psArray *pmRejectPixels(const psArray *images,          ///< Array of input images
    41                         const psArray *errors,          ///< The pixels which were rejected in the combination
    42                         const psArray *inToOut,         ///< Transformation from input to output system
    43                         const psArray *outToIn,         ///< Transformation from output to input system
    44                         psF32 rejThreshold,             ///< Rejection threshold
    45                         psF32 gradLimit                 ///< Gradient limit
    46                        );
     41psArray *pmRejectPixels(
     42    const psArray *images,              ///< Array of input images
     43    const psArray *masks,               ///< Array of input image masks
     44    const psArray *errors,              ///< The pixels which were rejected in the combination
     45    const psArray *inToOut,             ///< Transformation from input to output system
     46    const psArray *outToIn,             ///< Transformation from output to input system
     47    psF32 rejThreshold,                 ///< Rejection threshold
     48    psF32 gradLimit                     ///< Gradient limit
     49);
    4750#endif
  • trunk/psModules/src/pmImageSubtract.c

    r4579 r4992  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-19 01:44:48 $
     9 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-09-11 22:25:39 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    124124    tmp->subIndex = 0;
    125125    tmp->preCalc = NULL;
    126     tmp->p_size = size;
    127     tmp->p_spatialOrder = spatialOrder;
     126    tmp->size = size;
     127    tmp->spatialOrder = spatialOrder;
    128128
    129129    //
     
    220220    tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32);
    221221    tmp->subIndex = 0;
    222     tmp->p_size = size;
    223     tmp->p_spatialOrder = spatialOrder;
     222    tmp->size = size;
     223    tmp->spatialOrder = spatialOrder;
    224224    tmp->preCalc = psArrayAlloc(nBF);
    225225
     
    499499    psTrace("ImageSubtract.IsisKernelConvolve", 4,
    500500            "Calling IsisKernelConvolve(%d, %d, %d)\n", kernelID, col, row);
    501     psS32 spatialOrder = kernels->p_spatialOrder;
    502     psS32 kernelSize = kernels->p_size;
     501    psS32 spatialOrder = kernels->spatialOrder;
     502    psS32 kernelSize = kernels->size;
    503503    psS32 xOrder = (psS32) kernels->xOrder->data.F32[kernelID];
    504504    psS32 yOrder = (psS32) kernels->yOrder->data.F32[kernelID];
     
    557557    psF32 numRowsHalf = 0.5 * (psF32) input->numRows;
    558558    psF32 background = solution->data.F64[solution->n-1];
    559     psS32 spatialOrder = kernels->p_spatialOrder;
     559    psS32 spatialOrder = kernels->spatialOrder;
    560560    psF32 conv = background; // Initial convolved value
    561561
     
    671671    psS32 numCols = input->numCols;
    672672    psS32 numRows = input->numRows;
    673     psS32 kernelSize = kernels->p_size;
     673    psS32 kernelSize = kernels->size;
    674674
    675675    psImage *convolved = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     
    746746        PS_ASSERT_VECTORS_SIZE_EQUAL(kernels->u, kernels->preCalc, false);
    747747    }
    748     psS32 kernelSize = kernels->p_size;
     748    psS32 kernelSize = kernels->size;
    749749    PS_ASSERT_INT_NONNEGATIVE(footprint, false);
    750750    //
     
    777777    psS32 numHalfRows = reference->numRows;
    778778    psS32 numHalfCols = reference->numCols;
    779     psS32 spatialOrder = kernels->p_spatialOrder;
     779    psS32 spatialOrder = kernels->spatialOrder;
    780780
    781781    //
     
    11631163    PS_ASSERT_VECTOR_SIZE(solution, nBF+1, NULL);
    11641164
    1165     psS32 kernelSize = kernels->p_size;
     1165    psS32 kernelSize = kernels->size;
    11661166    int xSize = footprint + kernelSize;
    11671167    int ySize = footprint + kernelSize;
     
    13321332
    13331333    psS32 nBF = kernels->u->n;
    1334     psS32 spatialOrder = kernels->p_spatialOrder;
    1335     psS32 kernelSize = kernels->p_size;
     1334    psS32 spatialOrder = kernels->spatialOrder;
     1335    psS32 kernelSize = kernels->size;
    13361336
    13371337    if (out != NULL) {
  • trunk/psModules/src/pmImageSubtract.h

    r4417 r4992  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-28 23:23:55 $
     9 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-09-11 22:25:39 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727
    2828typedef enum {
    29     PM_SUBTRACTION_KERNEL_POIS,    ///< POIS kernel --- delta functions
    30     PM_SUBTRACTION_KERNEL_ISIS     ///< ISIS kernel --- gaussians modified by polynomials
     29    PM_SUBTRACTION_KERNEL_POIS,         ///< POIS kernel --- delta functions
     30    PM_SUBTRACTION_KERNEL_ISIS          ///< ISIS kernel --- gaussians modified by polynomials
    3131} pmSubtractionKernelsType;
    3232
    3333typedef struct
    3434{
    35     pmSubtractionKernelsType type;   ///< Type ofKernels --- allowing the use of multiple kernels
    36     psVector *u, *v;                 ///< Offset (for POIS) or polynomial order (for ISIS)
    37     psVector *sigma;                 ///< Width of Gaussian (for ISIS)
    38     psVector *xOrder, *yOrder;       ///< Spatial Polynomial order (for all)
    39     int subIndex;                    ///< Index of kernel to be subtracted to maintain flux conservation
    40     psArray *preCalc;                ///< Array of images containing pre-calculated kernel (to
     35    pmSubtractionKernelsType type;      ///< Type ofKernels --- allowing the use of multiple kernels
     36    psVector *u, *v;                    ///< Offset (for POIS) or polynomial order (for ISIS)
     37    psVector *sigma;                    ///< Width of Gaussian (for ISIS)
     38    psVector *xOrder, *yOrder;          ///< Spatial Polynomial order (for all)
     39    int subIndex;                       ///< Index of kernel to be subtracted to maintain flux conservation
     40    psArray *preCalc;                   ///< Array of images containing pre-calculated kernel (to
    4141    ///< accelerate ISIS; don't use for POIS)
    42     psS32 p_size;                    ///< The halfsize of the kernel
    43     psS32 p_spatialOrder;            ///< The spatial order of the kernels
     42    psS32 size;                         ///< The halfsize of the kernel
     43    psS32 spatialOrder;                 ///< The spatial order of the kernels
    4444}
    4545psSubtractionKernels;
    4646
    47 psSubtractionKernels *pmSubtractionKernelsAllocPOIS(int size,
    48         int SpatialOrder);
     47psSubtractionKernels *pmSubtractionKernelsAllocPOIS(
     48    int size,
     49    int SpatialOrder
     50);
    4951
    50 psSubtractionKernels *pmSubtractionKernelsAllocISIS(const psVector *sigmas,
    51         const psVector *orders,
    52         int size,
    53         int SpatialOrder);
     52psSubtractionKernels *pmSubtractionKernelsAllocISIS(
     53    const psVector *sigmas,
     54    const psVector *orders,
     55    int size,
     56    int SpatialOrder
     57);
    5458
    5559typedef enum {
    56     PM_STAMP_INIT,                   ///< Initial state
    57     PM_STAMP_USED,                   ///< Use this stamp
    58     PM_STAMP_REJECTED,               ///< This stamp has been rejected
    59     PM_STAMP_RECALC,                 ///< Having been reset, this stamp is to be recalculated
    60     PM_STAMP_NONE                    ///< No stamp in this region
     60    PM_STAMP_INIT,                      ///< Initial state
     61    PM_STAMP_USED,                      ///< Use this stamp
     62    PM_STAMP_REJECTED,                  ///< This stamp has been rejected
     63    PM_STAMP_RECALC,                    ///< Having been reset, this stamp is to be recalculated
     64    PM_STAMP_NONE                       ///< No stamp in this region
    6165} pmStampStatus;
    6266
    6367typedef struct
    6468{
    65     int x, y;      ///< Position
     69    int x, y;                           ///< Position
    6670    int p_xSize;
    6771    int p_ySize;
     
    7074    int p_yMin;
    7175    int p_yMax;
    72     psImage *matrix;     ///< Associated matrix
    73     psVector *vector;     ///< Assoicated vector
    74     pmStampStatus status;    ///< Status ofstamp
     76    psImage *matrix;                    ///< Associated matrix
     77    psVector *vector;                   ///< Assoicated vector
     78    pmStampStatus status;               ///< Status ofstamp
    7579}
    7680pmStamp;
    7781
    78 psArray *pmSubtractionFindStamps(psArray *stamps, ///< Output stamps, or NULL
    79                                  const psImage *image, ///< Image for which to find stamps
    80                                  const psImage *mask, ///< Mask
    81                                  psU32 maskVal,  ///< Value for mask
    82                                  psF32 threshold, ///< Threshold for stamps in the image
    83                                  psS32 xNum,  ///< Number of stamps in x
    84                                  psS32 yNum,  ///< Number of stamps in y
    85                                  psS32 border  ///< Border around image to ignore (should be size of kernel)
    86                                 );
     82psArray *pmSubtractionFindStamps(
     83    psArray *stamps,                    ///< Output stamps, or NULL
     84    const psImage *image,               ///< Image for which to find stamps
     85    const psImage *mask,                ///< Mask
     86    psU32 maskVal,                      ///< Value for mask
     87    psF32 threshold,                    ///< Threshold for stamps in the image
     88    psS32 xNum,                         ///< Number of stamps in x
     89    psS32 yNum,                         ///< Number of stamps in y
     90    psS32 border                        ///< Border around image to ignore (should be size of kernel)
     91);
    8792
    88 bool pmSubtractionCalculateEquation(psArray *stamps, ///< The stamps for which to calculate the equation,
    89                                     const psImage *reference, ///< Reference image
    90                                     const psImage *input, ///< Input image
    91                                     const psSubtractionKernels *kernels, ///< The kernel basis functions
    92                                     psS32 footprint ///< Half-size of region over which to calculate equation
    93                                    );
     93bool pmSubtractionCalculateEquation(
     94    psArray *stamps,                    ///< The stamps for which to calculate the equation,
     95    const psImage *reference,           ///< Reference image
     96    const psImage *input,               ///< Input image
     97    const psSubtractionKernels *kernels,///< The kernel basis functions
     98    psS32 footprint                     ///< Half-size of region over which to calculate equation
     99);
    94100
    95101
    96 psVector *pmSubtractionSolveEquation(psVector *solution, ///< Solution vector, or NULL
    97                                      const psArray *stamps ///< Array of stamps
    98                                     );
     102psVector *pmSubtractionSolveEquation(
     103    psVector *solution,                 ///< Solution vector, or NULL
     104    const psArray *stamps               ///< Array of stamps
     105);
    99106
    100 bool pmSubtractionRejectStamps(psArray *stamps,  ///< Array of stamps to check for rejection
    101                                psImage *mask,  ///< Mask image
    102                                psU32 badStampMaskVal, ///< Value to use in mask for bad stamp
    103                                psS32 footprint,  ///< Region to mask if stamp is bad
    104                                psF32 sigmaRej,  ///< Number of RMS deviations above zero at which to reject
    105                                const psImage *refImage, ///< Reference image
    106                                const psImage *inImage, ///< Input image
    107                                const psVector *solution, ///< Solution vector
    108                                const psSubtractionKernels *kernels ///< Array of kernel parameters
    109                               );
     107bool pmSubtractionRejectStamps(
     108    psArray *stamps,                    ///< Array of stamps to check for rejection
     109    psImage *mask,                      ///< Mask image
     110    psU32 badStampMaskVal,              ///< Value to use in mask for bad stamp
     111    psS32 footprint,                    ///< Region to mask if stamp is bad
     112    psF32 sigmaRej,                     ///< Number of RMS deviations above zero at which to reject
     113    const psImage *refImage,            ///< Reference image
     114    const psImage *inImage,             ///< Input image
     115    const psVector *solution,           ///< Solution vector
     116    const psSubtractionKernels *kernels ///< Array of kernel parameters
     117);
    110118
    111 psImage *pmSubtractionKernelImage(psImage *out,
    112                                   const psVector *solution,
    113                                   const psSubtractionKernels *kernels,
    114                                   psF32 x,
    115                                   psF32 y
    116                                  );
     119psImage *pmSubtractionKernelImage(
     120    psImage *out,
     121    const psVector *solution,
     122    const psSubtractionKernels *kernels,
     123    psF32 x,
     124    psF32 y
     125);
    117126
    118127#endif
  • trunk/psModules/src/pmObjects.c

    r4770 r4992  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-08-16 01:10:34 $
     8 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-09-11 22:25:39 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    491491
    492492// XXX: Macro this.
    493 static bool isItInThisRegion(const psRegion *valid,
     493static bool isItInThisRegion(const psRegion valid,
    494494                             psS32 x,
    495495                             psS32 y)
    496496{
    497497
    498     if ((x >= valid->x0) &&
    499             (x <= valid->x1) &&
    500             (y >= valid->y0) &&
    501             (y <= valid->y1)) {
     498    if ((x >= valid.x0) &&
     499            (x <= valid.x1) &&
     500            (y >= valid.y0) &&
     501            (y <= valid.y1)) {
    502502        return(true);
    503503    }
     
    519519psList *pmCullPeaks(psList *peaks,
    520520                    psF32 maxValue,
    521                     const psRegion *valid)
     521                    const psRegion valid)
    522522{
    523523    PS_ASSERT_PTR_NON_NULL(peaks, NULL);
     
    531531        pmPeak *tmpPeak = (pmPeak *) tmpListElem->data;
    532532        if ((tmpPeak->counts > maxValue) ||
    533                 ((valid != NULL) &&
    534                  (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y)))) {
     533                (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))) {
    535534            psListRemoveData(peaks, (psPtr) tmpPeak);
    536535        }
     
    545544// XXX EAM: I changed this to return a new, subset array
    546545//          rather than alter the existing one
    547 psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion *valid)
     546psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion valid)
    548547{
    549548    PS_ASSERT_PTR_NON_NULL(peaks, NULL);
     
    558557        if (tmpPeak->counts > maxValue)
    559558            continue;
    560         if (valid != NULL) {
    561             if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))
    562                 continue;
    563         }
     559        if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))
     560            continue;
    564561        psArrayAdd (output, 200, tmpPeak);
    565562    }
  • trunk/psModules/src/pmObjects.h

    r4770 r4992  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-08-16 01:10:34 $
     7 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-09-11 22:25:39 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4242/** pmPeak data structure
    4343 * 
    44  * 
    45  * 
    4644 */
    4745typedef struct
     
    5553
    5654/** pmMoments data structure
    57  * 
    58  * 
    5955 * 
    6056 */
     
    7571/** pmModelType enumeration
    7672 * 
    77  * 
    78  * 
    7973 */
    8074typedef enum {
     
    8983
    9084/** pmModel data structure
    91  * 
    92  * 
    9385 * 
    9486 */
     
    194186    psList *peaks,                      ///< The psList of peaks to be culled
    195187    float maxValue,                     ///< Cull peaks above this value
    196     const psRegion *valid               ///< Cull peaks otside this psRegion
     188    const psRegion valid               ///< Cull peaks otside this psRegion
    197189);
    198190
     
    399391pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type);
    400392pmModelRadius pmModelRadius_GetFunction (pmModelType type);
     393psS32 pmModelParameterCount(pmModelType type);
     394psS32 pmModelSetType(char *name);
     395char *pmModelGetType(pmModelType type);
    401396
    402397#endif
  • trunk/psModules/src/pmReadoutCombine.c

    r4770 r4992  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-08-16 01:10:34 $
     7 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-09-11 22:25:39 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    102102        PS_ASSERT_READOUT_NON_EMPTY(tmpReadout, output);
    103103        PS_ASSERT_READOUT_TYPE(tmpReadout, PS_TYPE_F32, output);
     104
    104105        outputType = tmpReadout->image->type.type;
    105106
     
    242243            // At this point, we have scanned all input readouts for this
    243244            // one output pixel.
     245            //            for (psS32 r = 0; r < numInputs ; r++) printf("(0)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]);
    244246
    245247            // Determine how many pixels lie between fracLow and fracHigh.
     
    311313                }
    312314                // Calculate the specified statistic on the stack of pixels.
     315                //                for (psS32 r = 0; r < numInputs ; r++) printf("(1)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]);
    313316                psStats *rc = psVectorStats(stats,
    314317                                            tmpPixels,
     
    335338
    336339                // Calculate the specified statistic on the stack of pixels.
     340                //                for (psS32 r = 0; r < numInputs ; r++) printf("(2)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]);
    337341                psStats *rc = psVectorStats(stats,
    338342                                            tmpPixels,
  • trunk/psModules/test/Makefile.am

    r4219 r4992  
    1212        tst_pmImageSubtract \
    1313        tst_pmImageCombine \
    14         tst_pmObjects01
     14        tst_pmObjects01 \
     15        tst_psAstrometry \
     16        tst_psAstrometry01
    1517
    1618check_PROGRAMS = $(TESTS)
     
    3335tst_pmImageCombine_SOURCES = tst_pmImageCombine.c
    3436tst_pmObjects01_SOURCES = tst_pmObjects01.c
     37tst_psAstrometry_SOURCES = tst_psAstrometry.c
     38tst_psAstrometry01_SOURCES = tst_psAstrometry01.c
    3539
    3640test: check
  • trunk/psModules/test/tst_pmImageCombine.c

    r4770 r4992  
    88 *
    99 *  XXX: Must verify the results internally.  Don't use stdout file.
    10  *
    11  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-08-16 01:10:36 $
     10 *  XXX: Must test masks with pmRejectPixels()
     11 *
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-09-11 22:25:39 $
    1314 *
    1415 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    304305    //
    305306    printf("\n\n\nCalling pmRejectPixels() with acceptable data.  Should generate a psArray.\n");
    306     psArray *pixelRejects = pmRejectPixels(images, questionablePixels, expandTransforms,
     307    psArray *pixelRejects = pmRejectPixels(images, NULL, questionablePixels, expandTransforms,
    307308                                           contractTransforms, TST00_REJECTION_THRESHOLD,
    308309                                           TST00_GRADIENT_LIMIT);
    309310    if (pixelRejects == NULL) {
    310         printf("TEST ERROR: pmCombineImages() returned a NULL psArray.\n");
     311        printf("TEST ERROR: pmRejectPixels() returned a NULL psArray.\n");
    311312        testStatus = true;
    312313    } else {
Note: See TracChangeset for help on using the changeset viewer.