IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4579


Ignore:
Timestamp:
Jul 18, 2005, 3:44:48 PM (21 years ago)
Author:
drobbin
Message:

psModules now works with the reorganized version of psLib

Location:
trunk/psModules
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/psmodule.kdevses

    r3696 r4579  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="2" >
    5   <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psModule/src/pmSubtractSky.h" >
     4 <DocsAndViews NumberOfDocuments="8" >
     5  <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/Makefile.am" >
    66   <View0 line="24" Type="Source" />
    77  </Doc0>
    8   <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psModule/Makefile.am" >
    9    <View0 line="2" Type="Source" />
     8  <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/psAstrometry.h" >
     9   <View0 line="402" Type="Source" />
    1010  </Doc1>
     11  <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/pmImageCombine.h" >
     12   <View0 line="27" Type="Source" />
     13  </Doc2>
     14  <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/pmImageCombine.c" >
     15   <View0 line="36" Type="Source" />
     16  </Doc3>
     17  <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/pmObjects.c" >
     18   <View0 line="1464" Type="Source" />
     19  </Doc4>
     20  <Doc5 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/pmObjects.h" >
     21   <View0 line="261" Type="Source" />
     22  </Doc5>
     23  <Doc6 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/src/psAstrometry.c" >
     24   <View0 line="26" Type="Source" />
     25  </Doc6>
     26  <Doc7 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/ps/psModule/test/tst_pmImageCombine.c" >
     27   <View0 line="0" Type="Source" />
     28  </Doc7>
    1129 </DocsAndViews>
    1230 <pluginList>
    13   <kdevdebugger>
    14    <breakpointList/>
    15   </kdevdebugger>
    1631  <kdevbookmarks>
    1732   <bookmarks/>
    1833  </kdevbookmarks>
     34  <kdevsubversion>
     35   <subversion recurseresolve="1" recurserelocate="1" recursemerge="1" recursecommit="1" base="" recursepropget="1" recurseswitch="1" recurseupdate="1" recursepropset="1" recursediff="1" recurserevert="1" forcemove="1" recursecheckout="1" forceremove="1" recurseadd="1" recurseproplist="1" forcemerge="1" />
     36  </kdevsubversion>
    1937  <kdevvalgrind>
    2038   <executable path="" params="" />
     
    2341   <kcachegrind path="" />
    2442  </kdevvalgrind>
     43  <kdevdebugger>
     44   <breakpointList/>
     45  </kdevdebugger>
    2546 </pluginList>
    2647</KDevPrjSession>
  • trunk/psModules/src/Makefile.am

    r3877 r4579  
    99  pmReadoutCombine.c \
    1010  pmSubtractBias.c \
    11   pmSubtractSky.c
     11  pmSubtractSky.c \
     12  psAstrometry.c
    1213
    1314libpsmodule_a_HEADERS = pmFlatFieldErrors.h \
     
    2122  pmReadoutCombine.h \
    2223  pmSubtractBias.h \
    23   pmSubtractSky.h
     24  pmSubtractSky.h \
     25  psAstrometry.h
    2426
    2527EXTRA_DIST = psErrorCodes.dat
  • trunk/psModules/src/pmFlatField.h

    r1849 r4579  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2004-09-22 19:58:57 $
     20 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2005-07-19 01:44:48 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    2424 */
     25
     26#include "pslib.h"
     27#include "psAstrometry.h"
     28
    2529
    2630/** Execute flat field module.
  • trunk/psModules/src/pmImageSubtract.c

    r4424 r4579  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-29 01:17:23 $
     9 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-19 01:44:48 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6565    stamp->status = status;
    6666
    67     psMemSetDeallocator(stamp, (psFreeFcn)p_pmStampFree);
     67    psMemSetDeallocator(stamp, (psFreeFunc)p_pmStampFree);
    6868
    6969    return(stamp);
     
    8888
    8989    tmp->type = type;
    90     psMemSetDeallocator(tmp, (psFreeFcn) p_pmSubtractionKernelsFree);
     90    psMemSetDeallocator(tmp, (psFreeFunc) p_pmSubtractionKernelsFree);
    9191    return(tmp);
    9292}
  • trunk/psModules/src/pmMaskBadPixels.h

    r1822 r4579  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-09-17 00:49:04 $
     21 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-07-19 01:44:48 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626
    2727#include "pslib.h"
     28#include "psAstrometry.h"
    2829
    2930/** Mask values */
  • trunk/psModules/src/pmNonLinear.h

    r3024 r4579  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-01-17 19:58:18 $
     7 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-07-19 01:44:48 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1616
    1717#include "pslib.h"
     18#include "psAstrometry.h"
    1819
    1920psReadout *pmNonLinearityPolynomial(psReadout *in,
  • trunk/psModules/src/pmObjects.c

    r4222 r4579  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-13 20:00:49 $
     8 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-19 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    108108    }
    109109
    110     psMemSetDeallocator(tmp, (psFreeFcn) modelFree);
     110    psMemSetDeallocator(tmp, (psFreeFunc) modelFree);
    111111    return(tmp);
    112112}
     
    138138    tmp->models = NULL;
    139139    tmp->type = 0;
    140     psMemSetDeallocator(tmp, (psFreeFcn) sourceFree);
     140    psMemSetDeallocator(tmp, (psFreeFunc) sourceFree);
    141141
    142142    return(tmp);
     
    18951895    params->data.F32[6] = Sxy;
    18961896*****************************************************************************/
    1897 psF64 pmMinLM_Gauss2D(psVector *deriv,
    1898                       psVector *params,
    1899                       psVector *x)
     1897float pmMinLM_Gauss2D(
     1898    psVector *deriv,
     1899    const psVector *params,
     1900    const psVector *x)
    19001901{
    19011902    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     
    19311932    params->data.F32[6] = Sxy;
    19321933*****************************************************************************/
    1933 psF64 pmMinLM_PsuedoGauss2D(psVector *deriv,
    1934                             psVector *params,
    1935                             psVector *x)
     1934float pmMinLM_PsuedoGauss2D(
     1935    psVector *deriv,
     1936    const psVector *params,
     1937    const psVector *x)
    19361938{
    19371939    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     
    19711973    params->data.F32[8] = B3;
    19721974*****************************************************************************/
    1973 psF64 pmMinLM_Wauss2D(psVector *deriv,
    1974                       psVector *params,
    1975                       psVector *x)
     1975float pmMinLM_Wauss2D(
     1976    psVector *deriv,
     1977    const psVector *params,
     1978    const psVector *x)
    19761979{
    19771980    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     
    20192022    params->data.F32[10] = N;
    20202023*****************************************************************************/
    2021 psF64 pmMinLM_TwistGauss2D(psVector *deriv,
    2022                            psVector *params,
    2023                            psVector *x)
     2024float pmMinLM_TwistGauss2D(
     2025    psVector *deriv,
     2026    const psVector *params,
     2027    const psVector *x)
    20242028{
    20252029    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     
    20772081    params->data.F32[7] = Nexp;
    20782082*****************************************************************************/
    2079 psF64 pmMinLM_Sersic(psVector *deriv,
    2080                      psVector *params,
    2081                      psVector *x)
     2083float pmMinLM_Sersic(
     2084    psVector *deriv,
     2085    const psVector *params,
     2086    const psVector *x)
    20822087{
    20832088    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
     
    21022107    params->data.F32[11] = Nexp;
    21032108*****************************************************************************/
    2104 psF64 pmMinLM_SersicCore(psVector *deriv,
    2105                          psVector *params,
    2106                          psVector *x)
     2109float pmMinLM_SersicCore(
     2110    psVector *deriv,
     2111    const psVector *params,
     2112    const psVector *x)
    21072113{
    21082114    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
  • trunk/psModules/src/pmObjects.h

    r4187 r4579  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-06-09 06:19:27 $
     7 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-07-19 01:44:48 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    209209XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32
    210210 *****************************************************************************/
    211 psF64 pmMinLM_Gauss2D(psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
    212                       psVector *params,  ///< A psVector which holds the parameters of this function
    213                       psVector *x  ///< A psVector which holds the row/col coordinate
    214                      );
    215 
    216 /******************************************************************************
    217  *****************************************************************************/
    218 psF64 pmMinLM_PsuedoGauss2D(psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    219                             psVector *params, ///< A psVector which holds the parameters of this function
    220                             psVector *x  ///< A psVector which holds the row/col coordinate
    221                            );
    222 
    223 /******************************************************************************
    224  *****************************************************************************/
    225 psF64 pmMinLM_Wauss2D(psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
    226                       psVector *params,  ///< A psVector which holds the parameters of this function
    227                       psVector *x  ///< A psVector which holds the row/col coordinate
    228                      );
    229 
    230 /******************************************************************************
    231  *****************************************************************************/
    232 psF64 pmMinLM_TwistGauss2D(psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    233                            psVector *params, ///< A psVector which holds the parameters of this function
    234                            psVector *x  ///< A psVector which holds the row/col coordinate
    235                           );
    236 
    237 /******************************************************************************
    238  *****************************************************************************/
    239 psF64 pmMinLM_Sersic(psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
    240                      psVector *params,  ///< A psVector which holds the parameters of this function
    241                      psVector *x  ///< A psVector which holds the row/col coordinate
    242                     );
    243 
    244 /******************************************************************************
    245  *****************************************************************************/
    246 psF64 pmMinLM_SersicCore(psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    247                          psVector *params, ///< A psVector which holds the parameters of this function
    248                          psVector *x  ///< A psVector which holds the row/col coordinate
    249                         );
    250 
    251 /******************************************************************************
    252  *****************************************************************************/
    253 psF64 pmMinLM_PsuedoSersic(psVector *deriv, ///< A possibly-NULL structure for the output derivatives
    254                            psVector *params, ///< A psVector which holds the parameters of this function
    255                            psVector *x  ///< A psVector which holds the row/col coordinate
    256                           );
     211float pmMinLM_Gauss2D(
     212    psVector *deriv,                   ///< A possibly-NULL structure for the output derivatives
     213    const psVector *params,            ///< A psVector which holds the parameters of this function
     214    const psVector *x                  ///< A psVector which holds the row/col coordinate
     215);
     216
     217/******************************************************************************
     218 *****************************************************************************/
     219float pmMinLM_PsuedoGauss2D(
     220    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
     221    const psVector *params, ///< A psVector which holds the parameters of this function
     222    const psVector *x  ///< A psVector which holds the row/col coordinate
     223);
     224
     225/******************************************************************************
     226 *****************************************************************************/
     227float pmMinLM_Wauss2D(
     228    psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
     229    const psVector *params,  ///< A psVector which holds the parameters of this function
     230    const psVector *x  ///< A psVector which holds the row/col coordinate
     231);
     232
     233/******************************************************************************
     234 *****************************************************************************/
     235float pmMinLM_TwistGauss2D(
     236    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
     237    const psVector *params, ///< A psVector which holds the parameters of this function
     238    const psVector *x  ///< A psVector which holds the row/col coordinate
     239);
     240
     241/******************************************************************************
     242 *****************************************************************************/
     243float pmMinLM_Sersic(
     244    psVector *deriv,  ///< A possibly-NULL structure for the output derivatives
     245    const psVector *params,  ///< A psVector which holds the parameters of this function
     246    const psVector *x  ///< A psVector which holds the row/col coordinate
     247);
     248
     249/******************************************************************************
     250 *****************************************************************************/
     251float pmMinLM_SersicCore(
     252    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
     253    const psVector *params, ///< A psVector which holds the parameters of this function
     254    const psVector *x  ///< A psVector which holds the row/col coordinate
     255);
     256
     257/******************************************************************************
     258 *****************************************************************************/
     259float pmMinLM_PsuedoSersic(
     260    psVector *deriv, ///< A possibly-NULL structure for the output derivatives
     261    const psVector *params, ///< A psVector which holds the parameters of this function
     262    const psVector *x  ///< A psVector which holds the row/col coordinate
     263);
    257264
    258265
  • trunk/psModules/src/pmReadoutCombine.h

    r3668 r4579  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-04-05 22:55:05 $
     7 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-07-19 01:44:48 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#include "pslib.h"
    2424#include "psConstants.h"
     25#include "psAstrometry.h"
    2526
    2627typedef struct
  • trunk/psModules/src/pmSubtractBias.c

    r4131 r4579  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-07 22:13:42 $
     8 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-19 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    352352
    353353            PS_ASSERT_IMAGE_TYPE(myOverscanImage, PS_TYPE_F32, NULL);
    354             psStats *rc = psImageStats(myStats, myOverscanImage, NULL, 0xffffffff);
     354            psStats *rc = psImageStats(myStats, myOverscanImage, NULL, (psMaskType)0xffffffff);
    355355            if (rc == NULL) {
    356356                psError(PS_ERR_UNKNOWN, false, "psImageStats(): could not perform requested statistical operation.  Returning in image.\n");
  • trunk/psModules/src/pmSubtractBias.h

    r4132 r4579  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-07 22:20:55 $
     8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-19 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#include<math.h>
    2424#include "pslib.h"
     25#include "psAstrometry.h"
    2526
    2627typedef enum {
  • trunk/psModules/src/pmSubtractSky.h

    r3668 r4579  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-04-05 22:55:05 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-19 01:44:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#include<math.h>
    2424#include "pslib.h"
     25#include "psAstrometry.h"
    2526
    2627// XXX: this is pmFit in pmSubtractBias.c, named psFit here.
  • trunk/psModules/src/psAstrometry.c

    r4577 r4579  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-07-18 18:48:29 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-07-19 01:44:48 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2525#include "psError.h"
    2626#include "psConstants.h"
    27 #include "psAstronomyErrors.h"
     27//#include "psAstronomyErrors.h"
    2828#include "psMatrix.h"
    2929#include "psTrace.h"
    3030#include "psLogMsg.h"
     31
    3132
    3233/*****************************************************************************
     
    3536psImage.
    3637 *****************************************************************************/
     38/*
    3739static psS32 checkValidImageCoords(double x,
    3840                                   double y,
     
    4042{
    4143    PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0);
    42 
     44 
    4345    if ((x < 0.0) || (x > (double)tmpImage->numCols) ||
    4446            (y < 0.0) || (y > (double)tmpImage->numRows)) {
    4547        return (0);
    4648    }
    47 
     49 
    4850    return (1);
    4951}
    50 
    51 
     52*/
     53/*
    5254static void FPAFree(psFPA* fpa)
    5355{
     
    6567    }
    6668}
    67 
     69*/
     70
     71/*
    6872static void chipFree(psChip* chip)
    6973{
     
    7579    }
    7680}
    77 
     81*/
     82
     83/*
    7884static void cellFree(psCell* cell)
    7985{
     
    8894    }
    8995}
     96*/
    9097
    9198static void readoutFree(psReadout* readout)
     
    99106}
    100107
     108/*
    101109static void observatoryFree(psObservatory* obs)
    102110{
     
    105113    }
    106114}
    107 
     115*/
     116/*
    108117static void exposureFree(psExposure* exp)
    109118{
     
    115124    }
    116125}
    117 
     126*/
     127/*
    118128static void fixedPatternFree(psFixedPattern* fp)
    119129{
     
    122132            psFree(fp->x[i]);
    123133        }
    124 
     134 
    125135        for (psS32 j = 0; j < fp->p_ps_yRows; j++) {
    126136            psFree(fp->y[j]);
    127137        }
    128 
     138 
    129139        psFree(fp->x);
    130140        psFree(fp->y);
    131141    }
    132142}
    133 
     143*/
    134144/*****************************************************************************/
    135145/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     
    141151 * XXX: This assumes that x,y must be of type F64
    142152 */
     153/*
    143154psFixedPattern* psFixedPatternAlloc(double x0,
    144                                     double y0,
    145                                     double xScale,
    146                                     double yScale,
    147                                     const psImage *x,
    148                                     const psImage *y)
    149 {
    150     psFixedPattern *tmp;
    151     psS32 i;
    152     psS32 j;
    153 
    154     PS_ASSERT_IMAGE_NON_NULL(x, NULL);
    155     PS_ASSERT_IMAGE_NON_NULL(y, NULL);
    156     PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
    157     PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
    158 
    159     tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
    160     // XXX: Is this correct?
    161     tmp->nX = (x->numCols * x->numRows);
    162     tmp->nY = (y->numCols * y->numRows);
    163     tmp->x0 = x0;
    164     tmp->y0 = y0;
    165     tmp->xScale = xScale;
    166     tmp->yScale = yScale;
    167     tmp->p_ps_xRows = x->numRows;
    168     tmp->p_ps_xCols = x->numCols;
    169     tmp->p_ps_yRows = y->numRows;
    170     tmp->p_ps_yCols = y->numCols;
    171     tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
    172     for (i=0;i<x->numRows;i++) {
    173         (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
    174     }
    175     for (i=0;i<x->numRows;i++) {
    176         for (j=0;j<x->numCols;j++) {
    177             (tmp->x)[i][j] = x->data.F64[i][j];
    178         }
    179     }
    180 
    181     tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
    182     for (i=0;i<y->numRows;i++) {
    183         (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
    184     }
    185     for (i=0;i<y->numRows;i++) {
    186         for (j=0;j<y->numCols;j++) {
    187             (tmp->y)[i][j] = y->data.F64[i][j];
    188         }
    189     }
    190 
    191     psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
    192 
    193     return(tmp);
    194 }
    195 
    196 
     155                                   double y0,
     156                                   double xScale,
     157                                   double yScale,
     158                                   const psImage *x,
     159                                   const psImage *y)
     160{
     161   psFixedPattern *tmp;
     162   psS32 i;
     163   psS32 j;
     164
     165   PS_ASSERT_IMAGE_NON_NULL(x, NULL);
     166   PS_ASSERT_IMAGE_NON_NULL(y, NULL);
     167   PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
     168   PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
     169
     170   tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
     171   // XXX: Is this correct?
     172   tmp->nX = (x->numCols * x->numRows);
     173   tmp->nY = (y->numCols * y->numRows);
     174   tmp->x0 = x0;
     175   tmp->y0 = y0;
     176   tmp->xScale = xScale;
     177   tmp->yScale = yScale;
     178   tmp->p_ps_xRows = x->numRows;
     179   tmp->p_ps_xCols = x->numCols;
     180   tmp->p_ps_yRows = y->numRows;
     181   tmp->p_ps_yCols = y->numCols;
     182   tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
     183   for (i=0;i<x->numRows;i++) {
     184       (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
     185   }
     186   for (i=0;i<x->numRows;i++) {
     187       for (j=0;j<x->numCols;j++) {
     188           (tmp->x)[i][j] = x->data.F64[i][j];
     189       }
     190   }
     191
     192   tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
     193   for (i=0;i<y->numRows;i++) {
     194       (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
     195   }
     196   for (i=0;i<y->numRows;i++) {
     197       for (j=0;j<y->numCols;j++) {
     198           (tmp->y)[i][j] = y->data.F64[i][j];
     199       }
     200   }
     201
     202   psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
     203
     204   return(tmp);
     205}
     206*/
     207/*
    197208psExposure* psExposureAlloc(double ra,
    198209                            double dec,
     
    210221{
    211222    PS_ASSERT_PTR_NON_NULL(observatory, NULL);
    212 
     223 
    213224    psExposure* exp = psAlloc(sizeof(psExposure));
    214225    *(double *)&exp->ra = ra;
     
    223234    *(float *)&exp->exposureTime = exposureTime;
    224235    *(float *)&exp->wavelength = wavelength;
    225 
     236 
    226237    exp->time = psMemIncrRefCounter((psPtr)time);
    227238    exp->observatory = psMemIncrRefCounter((psPtr)observatory);
    228 
     239 
    229240    // XXX: how is this value derived?
    230241    *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude);
     
    235246    exp->cameraName = NULL;
    236247    exp->telescopeName = NULL;
    237 
     248 
    238249    psMemSetDeallocator(exp,(psFreeFunc)exposureFree);
    239 
     250 
    240251    return exp;
    241252}
    242 
     253*/
     254/*
    243255psObservatory* psObservatoryAlloc(const char* name,
    244256                                  double latitude,
     
    248260{
    249261    psObservatory* obs = psAlloc(sizeof(psObservatory));
    250 
     262 
    251263    if (name == NULL) {
    252264        obs->name = NULL;
     
    255267        strcpy((char*)obs->name, name);
    256268    }
    257 
     269 
    258270    *(double *)&obs->latitude = latitude;
    259271    *(double *)&obs->longitude = longitude;
    260272    *(double *)&obs->height = height;
    261273    *(double *)&obs->tlr = tlr;
    262 
     274 
    263275    psMemSetDeallocator(obs,(psFreeFunc)observatoryFree);
    264 
     276 
    265277    return obs;
    266278}
    267 
     279*/
     280/*
    268281psFPA* psFPAAlloc(psS32 nChips,
    269282                  const psExposure* exp)
    270283{
    271284    PS_ASSERT_INT_NONNEGATIVE(nChips, NULL);
    272 
     285 
    273286    psFPA* newFPA = psAlloc(sizeof(psFPA));
    274 
     287 
    275288    // create array of NULL chips of the size nChips
    276289    newFPA->chips = psArrayAlloc(nChips);
     
    280293    }
    281294    newFPA->chips->n = 0; // per requirement
    282 
     295 
    283296    newFPA->metadata = NULL;
    284297    newFPA->fromTangentPlane = NULL;
    285298    newFPA->toTangentPlane = NULL;
    286299    newFPA->pattern = NULL;
    287 
     300 
    288301    if (exp != NULL) {
    289302        newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
     
    293306        newFPA->grommit = NULL;
    294307    }
    295 
     308 
    296309    newFPA->colorPlus = NULL;
    297310    newFPA->colorMinus = NULL;
    298311    newFPA->projection = NULL;
    299 
     312 
    300313    newFPA->rmsX = 0.0f;
    301314    newFPA->rmsY = 0.0f;
    302315    newFPA->chi2 = 0.0f;
    303 
     316 
    304317    psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree);
    305 
     318 
    306319    return newFPA;
    307320}
    308 
     321*/
    309322/*
    310323 * psChip constructor
    311324 */
     325/*
    312326psChip* psChipAlloc(psS32 nCells,
    313327                    psFPA *parentFPA)
    314328{
    315329    PS_ASSERT_INT_NONNEGATIVE(nCells, NULL);
    316 
     330 
    317331    psChip* chip = psAlloc(sizeof(psChip));
    318 
     332 
    319333    // create array of NULL psCells
    320334    int n = (nCells > 0) ? nCells : 1;
     
    325339    }
    326340    chip->cells->n = 0; // per requirement
    327 
     341 
    328342    *(int*)&chip->row0 = 0;
    329343    *(int*)&chip->col0 = 0;
    330 
     344 
    331345    chip->metadata = NULL;
    332 
     346 
    333347    chip->toFPA = NULL;
    334348    chip->fromFPA = NULL;
    335 
     349 
    336350    chip->parent = parentFPA;
    337 
     351 
    338352    psMemSetDeallocator(chip,(psFreeFunc)chipFree);
    339 
     353 
    340354    return chip;
    341 
    342 }
    343 
     355 
     356}
     357*/
    344358/*
    345359 * psCell constructor
    346360 */
     361/*
    347362psCell* psCellAlloc(psS32 nReadouts,
    348363                    psChip* parentChip)
    349364{
    350365    PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL);
    351 
     366 
    352367    psCell* cell = psAlloc(sizeof(psCell));
    353 
     368 
    354369    // create array of NULL psReadouts
    355370    int n = (nReadouts > 0) ? nReadouts : 1;
     
    360375    }
    361376    cell->readouts->n = 0; // per requirement
    362 
     377 
    363378    *(int*)&cell->row0 = 0;
    364379    *(int*)&cell->col0 = 0;
    365 
     380 
    366381    cell->metadata = NULL;
    367 
     382 
    368383    cell->toChip = NULL;
    369384    cell->fromChip = NULL;
     
    371386    cell->toTP = NULL;
    372387    cell->toSky = NULL;
    373 
     388 
    374389    cell->parent = parentChip;
    375 
     390 
    376391    psMemSetDeallocator(cell,(psFreeFunc)cellFree);
    377 
     392 
    378393    return cell;
    379 
    380 
    381 }
    382 
     394 
     395 
     396}
     397*/
    383398psReadout* psReadoutAlloc()
    384399{
     
    402417}
    403418
     419/*
    404420psGrommit* psGrommitAlloc(const psExposure* exp)
    405421{
    406422    PS_ASSERT_PTR_NON_NULL(exp, NULL);
    407 
     423 
    408424    psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time);
    409 
     425 
    410426    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
    411 
     427 
    412428    *(double*)&grommit->latitude = exp->observatory->latitude;
    413429    *(double*)&grommit->longitude = exp->observatory->longitude;
     
    422438    *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too.
    423439    *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct
    424 
     440 
    425441    psFree(polarMotion);
    426 
     442 
    427443    return (grommit);
    428444}
    429 
     445*/
     446/*
    430447psCell* psCellInFPA(const psPlane* fpaCoord,
    431448                    const psFPA* FPA)
     
    433450    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
    434451    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    435 
     452 
    436453    psChip* tmpChip = NULL;
    437454    psPlane chipCoord;
    438455    psCell* outCell = NULL;
    439 
     456 
    440457    // Determine which chip contains the fpaCoords.
    441458    tmpChip = psChipInFPA(fpaCoord, FPA);
     
    443460        return(NULL);
    444461    }
    445 
     462 
    446463    // Convert to those chip coordinates.
    447464    psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip);
    448 
     465 
    449466    // Determine which cell contains those chip coordinates.
    450467    outCell = psCellInChip(&chipCoord, tmpChip);
    451 
     468 
    452469    return (outCell);
    453470}
    454 
     471*/
     472/*
    455473psChip* psChipInFPA(const psPlane* fpaCoord,
    456474                    const psFPA* FPA)
     
    459477    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    460478    PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL);
    461 
     479 
    462480    psArray* chips = FPA->chips;
    463481    psS32 nChips = chips->n;
    464482    psPlane chipCoord;
    465483    psCell *tmpCell = NULL;
    466 
     484 
    467485    // Loop through every chip in this FPA.  Convert the original FPA
    468486    // coordinates to chip coordinates for that chip.  Then, determine if any
    469487    // cells in that chip contain those chip coordinates.
    470 
     488 
    471489    for (psS32 i = 0; i < nChips; i++) {
    472490        psChip* tmpChip = chips->data[i];
    473491        PS_ASSERT_PTR_NON_NULL(tmpChip, NULL);
    474492        PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL);
    475 
     493 
    476494        psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
    477 
     495 
    478496        tmpCell = psCellInChip(&chipCoord, tmpChip);
    479497        if (tmpCell != NULL) {
     
    481499        }
    482500    }
    483 
     501 
    484502    // XXX: Print warning here?
    485503    return (NULL);
    486504}
    487 
     505*/
     506/*
    488507psCell* psCellInChip(const psPlane* chipCoord,
    489508                     const psChip* chip)
     
    491510    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
    492511    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    493 
     512 
    494513    psPlane cellCoord;
    495514    psArray* cells;
    496 
     515 
    497516    cells = chip->cells;
    498517    if (cells == NULL) {
    499518        return NULL;
    500519    }
    501 
     520 
    502521    // We loop over each cell in the chip.  We transform the chipCoord into
    503522    // a cellCoord for that cell and determine if that cellCoord is valid.
    504523    // If so, then we return that cell.
    505 
     524 
    506525    for (psS32 i = 0; i < cells->n; i++) {
    507526        psCell* tmpCell = (psCell* ) cells->data[i];
     
    509528        PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL);
    510529        psArray* readouts = tmpCell->readouts;
    511 
     530 
    512531        if (readouts != NULL) {
    513532            for (psS32 j = 0; j < readouts->n; j++) {
    514533                psReadout* tmpReadout = readouts->data[j];
    515534                PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL);
    516 
     535 
    517536                psPlaneTransformApply(&cellCoord,
    518537                                      tmpCell->fromChip,
    519538                                      chipCoord);
    520 
     539 
    521540                if (checkValidImageCoords(cellCoord.x,
    522541                                          cellCoord.y,
     
    527546        }
    528547    }
    529 
     548 
    530549    return (NULL);
    531550}
    532 
     551*/
     552/*
    533553psPlane* psCoordCellToChip(psPlane* outCoord,
    534554                           const psPlane* inCoord,
     
    537557    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    538558    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    539 
     559 
    540560    return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
    541561}
    542 
     562*/
     563/*
    543564psPlane* psCoordChipToFPA(psPlane* outCoord,
    544565                          const psPlane* inCoord,
     
    547568    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    548569    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    549 
     570 
    550571    return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
    551572}
    552 
     573*/
     574/*
    553575psPlane* psCoordFPAToTP(psPlane* outCoord,
    554576                        const psPlane* inCoord,
     
    559581    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    560582    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    561 
     583 
    562584    return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
    563585                               color, magnitude));
    564586}
    565 
     587*/
    566588/*****************************************************************************
    567589XXX: What about units for the (x,y) coords?
    568590 *****************************************************************************/
     591/*
    569592psSphere* psCoordTPToSky(psSphere* outSphere,
    570593                         const psPlane* tpCoord,
     
    573596    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
    574597    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    575 
     598 
    576599    if (outSphere == NULL) {
    577600        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    578601    }
    579 
     602 
    580603    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    581604    psWarning("Warning!  psCoordTPToSky functionality is no longer implemented");
    582     /* slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
    583              &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d); */
    584 
     605    // slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
     606    //         &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
     607 
    585608    return (outSphere);
    586609}
    587 
     610*/
     611/*
    588612psPlane* psCoordCellToFPA(psPlane* fpaCoord,
    589613                          const psPlane* cellCoord,
     
    592616    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
    593617    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    594 
     618 
    595619    return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
    596620}
    597 
     621*/
     622/*
    598623psSphere* psCoordCellToSky(psSphere* skyCoord,
    599624                           const psPlane* cellCoord,
     
    609634    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL);
    610635    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
    611 
     636 
    612637    psPlane* fpaCoord = NULL;
    613638    psPlane* tpCoord = NULL;
    614639    psFPA* parFPA = (cell->parent)->parent;
    615640    psGrommit* tmpGrommit = NULL;
    616 
     641 
    617642    // Convert the input cell coordinates to FPA coordinates.
    618643    fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord);
    619 
     644 
    620645    // Convert the FPA coordinates to tangent plane Coordinates.
    621646    tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane,
    622647                                  fpaCoord, color, magnitude);
    623 
     648 
    624649    // Generate a grommit for this FPA.
    625650    tmpGrommit = psGrommitAlloc(parFPA->exposure);
    626 
     651 
    627652    // Convert the tangent plane Coordinates to sky coordinates.
    628653    skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
    629 
     654 
    630655    psFree(fpaCoord);
    631656    psFree(tpCoord);
    632657    psFree(tmpGrommit);
    633 
     658 
    634659    return(skyCoord);
    635660}
    636 
     661 
     662*/
     663/*
    637664psSphere* psCoordCellToSkyQuick(psSphere* outSphere,
    638665                                const psPlane* cellCoord,
     
    650677                 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    651678    }
    652 
     679 
    653680    psPlane *tpCoord = NULL;
    654681    psChip *chip = cell->parent;
    655682    psFPA *FPA = chip->parent;
    656683    psProjectionType oldProjectionType;
    657 
     684 
    658685    if (outSphere == NULL) {
    659686        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    660687    }
    661 
     688 
    662689    // Determine the tangent plane coordinates.
    663690    tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
    664 
     691 
    665692    // Save the old projection type and set the new projection type to TAN.
    666693    oldProjectionType = FPA->projection->type;
    667694    FPA->projection->type = PS_PROJ_TAN;
    668 
     695 
    669696    // Deproject the tangent plane coordinates a sphere.
    670697    outSphere = psDeproject(tpCoord, FPA->projection);
    671 
     698 
    672699    // Restore old projection type.  Free memory.
    673700    FPA->projection->type = oldProjectionType;
    674701    psFree(tpCoord);
    675 
     702 
    676703    return (outSphere);
    677704}
     705*/
    678706
    679707/*****************************************************************************
    680708XXX: What about units for the (x,y) coords?
    681709 *****************************************************************************/
     710/*
    682711psPlane* psCoordSkyToTP(psPlane* tpCoord,
    683712                        const psSphere* in,
     
    686715    PS_ASSERT_PTR_NON_NULL(in, NULL);
    687716    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    688 
     717 
    689718    // char* type = "RA";
    690 
     719 
    691720    if (tpCoord == NULL) {
    692721        tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    693722    }
    694 
     723 
    695724    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    696725    psWarning("Warning!  psCoordSkyToTP functionality is no longer implemented");
    697     /* slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y); */
    698 
     726    // slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
     727 
    699728    return(tpCoord);
    700729}
    701 
    702 
     730*/
     731/*
    703732psPlane* psCoordTPToFPA(psPlane* fpaCoord,
    704733                        const psPlane* tpCoord,
     
    710739    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    711740    PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL);
    712 
     741 
    713742    return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
    714743                                tpCoord, color, magnitude));
    715744}
    716 
     745*/
     746/*
    717747psPlane* psCoordFPAToChip(psPlane* chipCoord,
    718748                          const psPlane* fpaCoord,
     
    722752    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    723753    PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL);
    724 
     754 
    725755    chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
    726756    return(chipCoord);
    727757}
    728 
     758*/
     759/*
    729760psPlane* psCoordChipToCell(psPlane* cellCoord,
    730761                           const psPlane* chipCoord,
     
    734765    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    735766    PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL);
    736 
     767 
    737768    cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
    738769    return(cellCoord);
    739770}
    740 
     771*/
     772/*
    741773psPlane* psCoordSkyToCell(psPlane* cellCoord,
    742774                          const psSphere* skyCoord,
     
    750782    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    751783    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
    752 
     784 
    753785    psChip *parChip = cell->parent;
    754786    psFPA *parFPA = parChip->parent;
    755787    psGrommit* grommit = parFPA->grommit;
    756 
     788 
    757789    // Convert the skyCoords to tangent plane coords.
    758790    psPlane *tpCoord = psCoordSkyToTP(tpCoord, skyCoord, grommit);
    759 
     791 
    760792    // Convert the tangent plane coords to FPA coords.
    761793    psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color,
    762794                                       magnitude, parFPA);
    763 
     795 
    764796    // Convert the FPA coords to chip coords.
    765797    psPlane *chipCoord = psCoordFPAToChip(chipCoord, fpaCoord, parChip);
    766 
     798 
    767799    // Convert the chip coords to cell coords.
    768800    cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell);
    769 
     801 
    770802    psFree(tpCoord);
    771803    psFree(fpaCoord);
    772804    psFree(chipCoord);
    773 
     805 
    774806    return (cellCoord);
    775807}
    776 
     808*/
     809/*
    777810psPlane* psCoordSkyToCellQuick(psPlane* cellCoord,
    778811                               const psSphere* skyCoord,
     
    790823                 "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    791824    }
    792 
     825 
    793826    psPlane *tpCoord = NULL;
    794827    psChip *whichChip = cell->parent;
     
    796829    psProjectionType oldProjectionType;
    797830    psPlaneTransform *TPtoCell = NULL;
    798 
     831 
    799832    // Save the old projection type and set the new projection type to TAN.
    800833    oldProjectionType = whichFPA->projection->type;
    801834    whichFPA->projection->type = PS_PROJ_TAN;
    802 
     835 
    803836    if (cellCoord == NULL) {
    804837        cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    805838    }
    806 
     839 
    807840    tpCoord = psProject(skyCoord, whichFPA->projection);
    808 
     841 
    809842    // generate an error if cell->toTP is not linear.
    810843    if (0 == p_psIsProjectionLinear(cell->toTP)) {
     
    813846                "cell to tangent plane");
    814847    }
    815 
     848 
    816849    TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
    817850    cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
    818 
     851 
    819852    // Restore old projection type.  Free memory.
    820853    whichFPA->projection->type = oldProjectionType;
     
    822855    return (cellCoord);
    823856}
    824 
    825 
    826 
     857*/
     858
     859
  • trunk/psModules/src/psAstrometry.h

    r4577 r4579  
    88*  @author GLG, MHPCC
    99*
    10 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-07-18 18:48:29 $
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-07-19 01:44:48 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1717#define PS_ASTROMETRY_H
    1818
    19 #include "psType.h"
    20 #include "psImage.h"
    21 #include "psArray.h"
    22 #include "psList.h"
    23 #include "psFunctions.h"
    24 #include "psMetadata.h"
    25 #include "psCoord.h"
    26 #include "psPhotometry.h"
    27 
     19#include "pslib.h"
     20
     21/*
    2822struct psCell;
    2923struct psChip;
    3024struct psFPA;
    3125struct psExposure;
    32 
     26*/
    3327/// @addtogroup AstroImage
    3428/// @{
     
    4236 *
    4337 */
     38
     39/*
    4440typedef struct
    4541{
    46     const double latitude;           ///< geodetic latitude (radians)
    47     const double longitude;          ///< longitude + ... (radians)
    48     const double height;             ///< height (HM)
    49     const double abberationMag;      ///< magnitude of diurnal aberration vector
    50     const double temperature;        ///< ambient temperature (TDK)
    51     const double pressure;           ///< pressure (PMB)
    52     const double humidity;           ///< relative humidity (RH)
    53     const double wavelength;         ///< wavelength (WL)
    54     const double lapseRate;          ///< lapse rate (TLR)
    55     const double refractA, refractB; ///< refraction constants A and B (radians)
    56     const double siderealTime;       ///< local apparent sidereal time (radians)
     42   const double latitude;           ///< geodetic latitude (radians)
     43   const double longitude;          ///< longitude + ... (radians)
     44   const double height;             ///< height (HM)
     45   const double abberationMag;      ///< magnitude of diurnal aberration vector
     46   const double temperature;        ///< ambient temperature (TDK)
     47   const double pressure;           ///< pressure (PMB)
     48   const double humidity;           ///< relative humidity (RH)
     49   const double wavelength;         ///< wavelength (WL)
     50   const double lapseRate;          ///< lapse rate (TLR)
     51   const double refractA, refractB; ///< refraction constants A and B (radians)
     52   const double siderealTime;       ///< local apparent sidereal time (radians)
    5753}
    5854psGrommit;
     55*/
     56
    5957
    6058/** Fixed Pattern Corrections
     
    6765 *  of the grid in x and y as well as the origin of the grid.
    6866 */
     67/*
    6968typedef struct
    7069{
     
    8483}
    8584psFixedPattern;
     85*/
    8686
    8787/** Readout data structure.
     88 
    8889 *
    8990 *  A readout is the result of a single read of a cell (or a portion thereof).
     
    121122 *
    122123 */
     124/*
    123125typedef struct
    124126{
    125127    const psS32 col0;                  ///< Offset from the left of chip
    126128    const psS32 row0;                  ///< Offset from the bottom of chip
    127 
     129 
    128130    psArray* readouts;                 ///< readouts from the cell
    129 
     131 
    130132    psMetadata* metadata;              ///< cell-level metadata
    131 
     133 
    132134    psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
    133135    psPlaneTransform* fromChip;        ///< transformations from cell to chip coordinates
     
    135137    psPlaneTransform* toTP;            ///< transformations from cell to FPA coordinates
    136138    psPlaneTransform* toSky;           ///< transformations from cell to tangent plane coordinates
    137 
     139 
    138140    struct psChip* parent;             ///< chip in which contains this cell
    139141}
    140142psCell;
     143*/
    141144
    142145/** Chip data structure
     
    148151 *
    149152 */
    150 typedef struct psChip
     153/*typedef struct psChip
    151154{
    152155    const psS32 col0;                  ///< Offset from the left of FPA
    153156    const psS32 row0;                  ///< Offset from the bottom of FPA
    154 
     157 
    155158    psArray* cells;                    ///< cells in the chip
    156 
     159 
    157160    psMetadata* metadata;              ///< chip-level metadata
    158 
     161 
    159162    psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
    160163    psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
    161 
     164 
    162165    struct psFPA* parent;              ///< FPA which contains this chip
    163166}
    164167psChip;
     168*/
    165169
    166170/** A Focal-Plane
     
    177181 *
    178182 */
    179 typedef struct psFPA
     183/*typedef struct psFPA
    180184{
    181185    psArray* chips;                    ///< chips in the focal plane array
    182186    psMetadata* metadata;              ///< focal-plane's metadata
    183 
     187 
    184188    psPlaneDistort* fromTangentPlane;  ///< transformation from tangent plane to focal plane
    185189    psPlaneDistort* toTangentPlane;    ///< transformation from focal plane to tangent plane
    186190    psFixedPattern* pattern;           ///< fixed pattern residual offsets
    187 
     191 
    188192    const struct psExposure* exposure; ///< information about this exposure
    189193    psGrommit *grommit;                ///< Wallace's grommit
    190 
     194 
    191195    psPhotSystem* colorPlus;           ///< Color reference
    192196    psPhotSystem* colorMinus;          ///< Color reference
    193197    psProjection *projection;          ///< projection
    194 
     198 
    195199    float rmsX;                        ///< RMS for x transformation fits
    196200    float rmsY;                        ///< RMS for y transformation fits
     
    198202}
    199203psFPA;
     204*/
    200205
    201206/** Observatory Information
     
    204209 *
    205210 */
    206 typedef struct
     211/*typedef struct
    207212{
    208213    const char* name;                  ///< Name of observatory
     
    213218}
    214219psObservatory;
     220*/
    215221
    216222/** Exposure Information
     
    221227 *
    222228 */
    223 typedef struct psExposure
     229/*typedef struct psExposure
    224230{
    225231    const double ra;                   ///< Telescope boresight, right ascention
     
    236242    const float wavelength;            ///< Wavelength in microns
    237243    const psObservatory* observatory;  ///< Observatory data
    238 
    239     /* Derived quantities */
     244 
     245    // Derived quantities
    240246    const double lst;                  ///< Local Sidereal Time
    241247    const float positionAngle;         ///< Position angle
     
    247253}
    248254psExposure;
     255*/
    249256
    250257/** Allocator for psFixedPattern struct
     
    255262 *  @return psFixedPattern*     New psFixedPattern struct.
    256263 */
    257 psFixedPattern* psFixedPatternAlloc(
     264/*psFixedPattern* psFixedPatternAlloc(
    258265    double x0,           ///< X Position of 0,0 corner on focal plane
    259266    double y0,           ///< Y Position of 0,0 corner on focal plane
     
    263270    const psImage *y     ///< The grid of offsets in y
    264271);
    265 
     272*/
    266273
    267274/** Allocator for psExposure
     
    273280 *  @return     psExposure*    New psExposure struct
    274281 */
    275 psExposure* psExposureAlloc(
     282/*psExposure* psExposureAlloc(
    276283    double ra,                         ///< Telescope boresight, right ascention
    277284    double dec,                        ///< Telescope boresight, declination
     
    288295    const psObservatory* observatory   ///< Observatory data
    289296);
     297*/
    290298
    291299/** Allocator for psObservatory
     
    296304 *  @return psObservatory*    new psObservatory struct
    297305 */
    298 psObservatory* psObservatoryAlloc(
     306/*psObservatory* psObservatoryAlloc(
    299307    const char* name,                  ///< Name of observatory
    300308    double latitude,                   ///< Latitude of observatory, east positive
     
    303311    double tlr                         ///< Tropospheric Lapse Rate
    304312);
     313*/
    305314
    306315/** Allocator for psFPA
     
    313322 *  @return psFPA*    a newly allocated psFPA
    314323 */
    315 psFPA* psFPAAlloc(
     324/*psFPA* psFPAAlloc(
    316325    psS32 nChips,                        ///< number of chips in the FPA
    317326    const psExposure* exp              ///< the exposure information
    318327);
     328*/
    319329
    320330/** Allocates a psChip
     
    326336 *  @return psChip*    newly allocated psChip
    327337 */
    328 psChip* psChipAlloc(
     338/*psChip* psChipAlloc(
    329339    psS32 nCells,                        ///< number of cells in Chip
    330340    psFPA* parentFPA                   ///< parent FPA
    331341);
     342*/
    332343
    333344/** Allocates a psCell
     
    339350 *  @return psCell*    newly allocated psCell
    340351 */
    341 psCell* psCellAlloc(
     352/*psCell* psCellAlloc(
    342353    psS32 nReadouts,                     ///< number of readouts in cell
    343354    psChip* parentChip                 ///< parent Chip
    344355);
     356*/
    345357
    346358/** Allocates a psReadout
     
    360372 *  @return psGrommit* New grommit structure.
    361373 */
    362 psGrommit* psGrommitAlloc(
     374/*psGrommit* psGrommitAlloc(
    363375    const psExposure* exp              ///< the cooresponding exposure structure.
    364376);
     377*/
    365378
    366379/** Find cooresponding cell for given FPA coordinate
     
    368381 *  @return psCell*    the cell cooresponding to the coord in FPA
    369382 */
    370 psCell* psCellInFPA(
     383/*psCell* psCellInFPA(
    371384    const psPlane* coord,              ///< the coordinate in FPA plane
    372385    const psFPA* FPA                   ///< the FPA to search for the cell
    373386);
     387*/
    374388
    375389/** Find cooresponding chip for given FPA coordinate
     
    377391 *  @return psChip*    the chip cooresponding to coord
    378392 */
    379 psChip* psChipInFPA(
     393/*psChip* psChipInFPA(
    380394    const psPlane* coord,              ///< the coordinate in FPA plane
    381395    const psFPA* FPA                   ///< the FPA to search for the cell
    382396);
     397*/
    383398
    384399/** Find cooresponding cell for given Chip coordinate
     
    386401 *  @return psCell*    the cell cooresponding to coord
    387402 */
    388 psCell* psCellInChip(
     403/*psCell* psCellInChip(
    389404    const psPlane* coord,              ///< the coordinate in Chip plane
    390405    const psChip* chip                 ///< the chip to search for the cell
    391406);
     407*/
    392408
    393409/** Translate a cell coordinate into a chip coordinate
     
    395411 *  @return psPlane*    the resulting chip coordinate
    396412 */
    397 psPlane* psCoordCellToChip(
     413/*psPlane* psCoordCellToChip(
    398414    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    399415    const psPlane* in,                 ///< the coordinate within Cell
    400416    const psCell* cell                 ///< the Cell in interest
    401417);
     418*/
    402419
    403420/** Translate a chip coordinate into a FPA coordinate
     
    405422 *  @return psPlane*    the resulting FPA coordinate
    406423 */
    407 psPlane* psCoordChipToFPA(
     424/*psPlane* psCoordChipToFPA(
    408425    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    409426    const psPlane* in,                 ///< the coordinate within Chip
    410427    const psChip* chip                 ///< the chip in interest
    411428);
     429*/
    412430
    413431/** Translate a FPA coordinate into a Tangent Plane coordinate
     
    415433 *  @return psPlane*    the resulting Tangent Plane coordinate
    416434 */
    417 psPlane* psCoordFPAToTP(
     435/*psPlane* psCoordFPAToTP(
    418436    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    419437    const psPlane* in,                 ///< the coordinate within FPA
     
    422440    const psFPA* fpa                   ///< the FPA in interest
    423441);
     442*/
    424443
    425444/** Translate a Tangent Plane coordinate into a Sky coordinate
     
    427446 *  @return psSphere*    the resulting Sky coordinate
    428447 */
    429 psSphere* psCoordTPToSky(
     448/*psSphere* psCoordTPToSky(
    430449    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    431450    const psPlane* in,                 ///< the coordinate within Tangent Plane
    432451    const psGrommit* grommit           ///< the grommit of the tangent plane
    433452);
     453*/
    434454
    435455/** Translate a cell coordinate into a FPA coordinate
     
    437457 *  @return psPlane*    the resulting FPA coordinate
    438458 */
    439 psPlane* psCoordCellToFPA(
     459/*psPlane* psCoordCellToFPA(
    440460    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    441461    const psPlane* in,                 ///< the coordinate within cell
    442462    const psCell* cell                 ///< the cell in interest
    443463);
     464*/
    444465
    445466/** Translate a cell coordinate into a Sky coordinate
     
    447468 *  @return psSphere*    the resulting Sky coordinate
    448469 */
    449 psSphere* psCoordCellToSky(
     470/*psSphere* psCoordCellToSky(
    450471    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    451472    const psPlane* in,                 ///< the coordinate within cell
     
    454475    const psCell* cell                 ///< the cell in interest
    455476);
     477*/
    456478
    457479/** Translate a cell coordinate into a Sky coordinate using a 'quick and
     
    460482 *  @return psSphere*    the resulting Sky coordinate
    461483 */
    462 psSphere* psCoordCellToSkyQuick(
     484/*psSphere* psCoordCellToSkyQuick(
    463485    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    464486    const psPlane* in,                 ///< the coordinate within cell
    465487    const psCell* cell                 ///< the cell in interest
    466488);
     489*/
    467490
    468491/** Translate a Sky coordinate into a Tangent Plane coordinate
     
    470493 *  @return psPlane*    the resulting Tangent Plane coordinate
    471494 */
    472 psPlane* psCoordSkyToTP(
     495/*psPlane* psCoordSkyToTP(
    473496    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    474497    const psSphere* in,                ///< the sky coordinate
    475498    const psGrommit* grommit           ///< the grommit
    476499);
     500*/
    477501
    478502/** Translate a Tangent Plane coordinate into a FPA coordinate
     
    480504 *  @return psPlane*    the resulting FPA coordinate
    481505 */
    482 psPlane* psCoordTPToFPA(
     506/*psPlane* psCoordTPToFPA(
    483507    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    484508    const psPlane* in,                 ///< the coordinate within tangent plane
     
    487511    const psFPA* fpa                   ///< the FPA of interest
    488512);
     513*/
    489514
    490515/** Translate a FPA coordinate into a chip coordinate
     
    492517 *  @return psPlane*    the resulting chip coordinate
    493518 */
    494 psPlane* psCoordFPAToChip(
     519/*psPlane* psCoordFPAToChip(
    495520    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    496521    const psPlane* in,                 ///< the FPA coordinate
    497522    const psChip* chip                 ///< the chip of interest
    498523);
     524*/
    499525
    500526/** Translate a chip coordinate into a cell coordinate
     
    502528 *  @return psPlane*    the resulting cell coordinate
    503529 */
    504 psPlane* psCoordChipToCell(
     530/*psPlane* psCoordChipToCell(
    505531    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    506532    const psPlane* in,                 ///< the Chip coordinate
    507533    const psCell* cell                 ///< the cell of interest
    508534);
     535*/
    509536
    510537/** Translate a sky coordinate into a cell coordinate
     
    512539 *  @return psPlane*    the resulting cell coordinate
    513540 */
    514 psPlane* psCoordSkyToCell(
     541/*psPlane* psCoordSkyToCell(
    515542    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    516543    const psSphere* in,                ///< the Sky coordinate
     
    519546    const psCell* cell                 ///< the cell of interest
    520547);
     548*/
    521549
    522550/** Translate a sky coordinate into a cell coordinate using a 'quick and
     
    525553 *  @return psPlane*    the resulting cell coordinate
    526554 */
    527 psPlane* psCoordSkyToCellQuick(
     555/*psPlane* psCoordSkyToCellQuick(
    528556    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    529557    const psSphere* in,                ///< the Sky coordinate
    530558    const psCell* cell                 ///< the cell of interest
    531559);
    532 
     560*/
    533561
    534562#endif // #ifndef PS_ASTROMETRY_H
  • trunk/psModules/test/tst_pmImageCombine.c

    r4291 r4579  
    99 *  XXX: Must verify the results internally.  Don't use stdout file.
    1010 *
    11  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-16 23:13:43 $
     11 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-19 01:44:48 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    266266
    267267    if (questionablePixels->n != numImages) {
    268         printf("TEST ERROR: pmCombineImages(): questionablePixels->n was %d, should have been %d\n",
     268        printf("TEST ERROR: pmCombineImages(): questionablePixels->n was %ld, should have been %d\n",
    269269               questionablePixels->n, numImages);
    270270        testStatus = true;
     
    313313        for (psS32 i = 0 ; i < pixelRejects->n ; i++) {
    314314            psPixels *myPixels = (psPixels *) pixelRejects->data[i];
    315             printf("tst_pmImageCombine.c: Image %d had %d rejects.\n", i, myPixels->n);
     315            printf("tst_pmImageCombine.c: Image %d had %ld rejects.\n", i, myPixels->n);
    316316
    317317            for (psS32 p = 0 ; p < myPixels->n ; p++) {
  • trunk/psModules/test/tst_pmImageSubtract.c

    r4418 r4579  
    1010 *  data.  More work need to be done to verify the results.
    1111 *
    12  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-28 23:28:18 $
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-07-19 01:44:48 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    337337    // Create a test image and set a single pixel in the center of each stamp.
    338338    psImage *tstImg = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    339     psS32 numStamps = 0;
     339    int numStamps = 0;
    340340    PS_IMAGE_SET_F32(tstImg, 0.0);
    341341    for (psS32 j = 0; j < yNum; j++) {
     
    407407    } else {
    408408        if (stamps->n != numStamps) {
    409             printf("TEST ERROR: %d stamps were found, %d were expected.\n",
     409            printf("TEST ERROR: %ld stamps were found, %d were expected.\n",
    410410                   stamps->n, numStamps);
    411411            testStatus = true;
     
    443443    } else {
    444444        if (stamps->n != numStamps) {
    445             printf("TEST ERROR: %d stamps were found, %d were expected.\n",
     445            printf("TEST ERROR: %ld stamps were found, %d were expected.\n",
    446446                   stamps->n, numStamps);
    447447            testStatus = true;
  • trunk/psModules/test/tst_pmObjects01.c

    r4221 r4579  
    1919 * abd never deallocate, no error is generated.
    2020 *
    21  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2005-06-13 19:59:21 $
     21 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-07-19 01:44:48 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    128128    } else {
    129129        if ((tmpModel->params->n != 7) || (tmpModel->dparams->n != 7)) {
    130             printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) allocated an incorrect number of params (%d, %d)\n",
     130            printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) allocated an incorrect number of params (%ld, %ld)\n",
    131131                   tmpModel->params->n, tmpModel->dparams->n);
    132132            testStatus = false;
     
    150150    } else {
    151151        if ((tmpModel->params->n != 7) || (tmpModel->dparams->n != 7)) {
    152             printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) allocated an incorrect number of params (%d, %d)\n",
     152            printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) allocated an incorrect number of params (%ld, %ld)\n",
    153153                   tmpModel->params->n, tmpModel->dparams->n);
    154154            testStatus = false;
     
    172172    } else {
    173173        if ((tmpModel->params->n != 11) || (tmpModel->dparams->n != 11)) {
    174             printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) allocated an incorrect number of params (%d, %d)\n",
     174            printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) allocated an incorrect number of params (%ld, %ld)\n",
    175175                   tmpModel->params->n, tmpModel->dparams->n);
    176176            testStatus = false;
     
    194194    } else {
    195195        if ((tmpModel->params->n != 9) || (tmpModel->dparams->n != 9)) {
    196             printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) allocated an incorrect number of params (%d, %d)\n",
     196            printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) allocated an incorrect number of params (%ld, %ld)\n",
    197197                   tmpModel->params->n, tmpModel->dparams->n);
    198198            testStatus = false;
     
    216216    } else {
    217217        if ((tmpModel->params->n != 8) || (tmpModel->dparams->n != 8)) {
    218             printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) allocated an incorrect number of params (%d, %d)\n",
     218            printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) allocated an incorrect number of params (%ld, %ld)\n",
    219219                   tmpModel->params->n, tmpModel->dparams->n);
    220220            testStatus = false;
     
    238238    } else {
    239239        if ((tmpModel->params->n != 12) || (tmpModel->dparams->n != 12)) {
    240             printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) allocated an incorrect number of params (%d, %d)\n",
     240            printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) allocated an incorrect number of params (%ld, %ld)\n",
    241241                   tmpModel->params->n, tmpModel->dparams->n);
    242242            testStatus = false;
     
    290290    } else {
    291291        if (outData->n != 1) {
    292             printf("TEST ERROR: outData->n is %d\n", outData->n);
     292            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    293293            testStatus = false;
    294294        }
     
    316316
    317317        if (outData->n != 0) {
    318             printf("TEST ERROR: outData->n is %d\n", outData->n);
     318            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    319319            testStatus = false;
    320320        }
     
    344344
    345345        if (outData->n != 1) {
    346             printf("TEST ERROR: outData->n is %d\n", outData->n);
     346            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    347347            testStatus = false;
    348348        }
     
    370370
    371371        if (outData->n != 0) {
    372             printf("TEST ERROR: outData->n is %d\n", outData->n);
     372            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    373373            testStatus = false;
    374374        }
     
    398398
    399399        if (outData->n != n/2) {
    400             printf("TEST ERROR: outData->n is %d\n", outData->n);
     400            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    401401            testStatus = false;
    402402        }
     
    423423
    424424        if (outData->n != 0) {
    425             printf("TEST ERROR: outData->n is %d\n", outData->n);
     425            printf("TEST ERROR: outData->n is %ld\n", outData->n);
    426426            testStatus = false;
    427427        }
     
    477477
    478478/******************************************************************************
    479 test02(): 
     479test02():
    480480// XXX: Must test flat peaks.
    481481// XXX: test 1-by-n and n-by-1 images.
     
    539539        }
    540540        if (outData->n != expectedNumPeaks) {
    541             printf("TEST ERROR: pmFindImagePeaks found %d peaks (should be %d)\n", outData->n, expectedNumPeaks);
     541            printf("TEST ERROR: pmFindImagePeaks found %ld peaks (should be %d)\n", outData->n, expectedNumPeaks);
    542542            testStatus = false;
    543543        }
     
    681681    /* XXX: Modify for new pmCullPeaks
    682682        outData = pmCullPeaks(outData, PS_MAX_F32, NULL);
    683      
     683
    684684        if (outData == NULL) {
    685685            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
     
    702702    printf("Calling pmCullPeaks with tiny maxValue and NULL psRegion.\n");
    703703    outData = pmFindImagePeaks(imgData, 0.0);
    704     printf("pmFindImagePeaks found %d peaks\n", outData->n);
     704    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
    705705    /* XXX: Modify for new pmCullPeaks
    706706        outData = pmCullPeaks(outData, 0.0, NULL);
    707      
     707
    708708        if (outData == NULL) {
    709709            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
     
    726726    printf("Calling pmCullPeaks with large maxValue and disjoint psRegion.\n");
    727727    outData = pmFindImagePeaks(imgData, 0.0);
    728     printf("pmFindImagePeaks found %d peaks\n", outData->n);
     728    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
    729729    psRegion tmpRegion = psRegionSet(10000.0, 20000.0, 10000.0, 20000.0);
    730730
    731731    /* XXX: Modify for new pmCullPeaks
    732732        outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion);
    733      
     733
    734734        if (outData == NULL) {
    735735            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
     
    752752    printf("Calling pmCullPeaks with large maxValue and non-disjoint psRegion.\n");
    753753    outData = pmFindImagePeaks(imgData, 0.0);
    754     printf("pmFindImagePeaks found %d peaks\n", outData->n);
     754    printf("pmFindImagePeaks found %ld peaks\n", outData->n);
    755755    tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
    756756    /* XXX: Modify for new pmCullPeaks
    757757        outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion);
    758      
     758
    759759        if (outData == NULL) {
    760760            printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n");
     
    11451145            testStatus = false;
    11461146        }
    1147      
     1147
    11481148        printf("----------------------------------------------------------------------------------\n");
    11491149        printf("Calling pmSourceSetPixelsCircle with subImage endCol > numCols.  Should generate error and return NULL.\n");
     
    11561156            testStatus = false;
    11571157        }
    1158      
     1158
    11591159        printf("----------------------------------------------------------------------------------\n");
    11601160        printf("Calling pmSourceSetPixelsCircle with subImage startRow < 0.  Should generate error and return NULL.\n");
     
    11671167            testStatus = false;
    11681168        }
    1169      
     1169
    11701170        printf("----------------------------------------------------------------------------------\n");
    11711171        printf("Calling pmSourceSetPixelsCircle with subImage endRow > numRows.  Should generate error and return NULL.\n");
  • trunk/psModules/test/verified/tst_pmImageCombine.stderr

    r4219 r4579  
    2424---> TESTPOINT PASSED (Test Point Driver{pmCombineImages()} | tst_pmImageCombine.c)
    2525
    26 /***************************** TESTPOINT ******************************************\
    27 *             TestFile: tst_pmImageCombine.c                                       *
    28 *            TestPoint: Test Point Driver{pmRejectPixels()}                        *
    29 *             TestType: Positive                                                   *
    30 \**********************************************************************************/
    31 
    32 
    33 ---> TESTPOINT PASSED (Test Point Driver{pmRejectPixels()} | tst_pmImageCombine.c)
    34 
  • trunk/psModules/test/verified/tst_pmImageCombine.stdout

    r4219 r4579  
    11Testing pmCombineImages(10, 10, 5)
     2Generating a bad pixel in image (1) at (0, 8)
     3Generating a bad pixel in image (3) at (7, 5)
     4Generating a bad pixel in image (1) at (1, 2)
     5Generating a bad pixel in image (2) at (9, 9)
     6Generating a bad pixel in image (1) at (3, 9)
     7Generating a bad pixel in image (2) at (0, 5)
     8Generating a bad pixel in image (1) at (4, 5)
     9Generating a bad pixel in image (1) at (3, 8)
     10Generating a bad pixel in image (2) at (6, 2)
     11Generating a bad pixel in image (2) at (3, 7)
    212Calling with a NULL images.  Should generate error, return NULL.
    313Calling with a long images.  Should generate error, return NULL.
     
    1929Image 2, questionable pixel 3 is (3 7)
    2030Image 3, questionable pixel 0 is (7 5)
    21 Testing pmRejectPixels(10, 10, 5, 1.000000, 1.000000)
     31
     32
     33
     34Calling pmRejectPixels() with acceptable data.  Should generate a psArray.
     35tst_pmImageCombine.c: Image 0 had 0 rejects.
     36tst_pmImageCombine.c: Image 1 had 4 rejects.
     37Image 1, rejected pixel 0 is (0 8)
     38Image 1, rejected pixel 1 is (1 2)
     39Image 1, rejected pixel 2 is (4 5)
     40Image 1, rejected pixel 3 is (3 8)
     41tst_pmImageCombine.c: Image 2 had 3 rejects.
     42Image 2, rejected pixel 0 is (0 5)
     43Image 2, rejected pixel 1 is (6 2)
     44Image 2, rejected pixel 2 is (3 7)
     45tst_pmImageCombine.c: Image 3 had 1 rejects.
     46Image 3, rejected pixel 0 is (7 5)
     47tst_pmImageCombine.c: Image 4 had 0 rejects.
  • trunk/psModules/test/verified/tst_pmImageSubtract.stderr

    r4200 r4579  
    2323\**********************************************************************************/
    2424
    25 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     25<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    2626    Unallowable operation: psImage image or its data is NULL.
    27 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     27<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    2828    Error: xNum is 0 or less.
    29 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     29<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    3030    Error: yNum is 0 or less.
    31 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     31<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    3232    Error: border is 0 or less.
    33 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     33<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    3434    Unallowable operation: psImage image or its data is NULL.
    35 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     35<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    3636    Error: xNum is 0 or less.
    37 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     37<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    3838    Error: yNum is 0 or less.
    39 <DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
     39<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)
    4040    Error: border is 0 or less.
    4141
     
    4848\**********************************************************************************/
    4949
    50 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     50<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    5151    Unallowable operation: stamps is NULL.
    52 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     52<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    5353    Unallowable operation: psImage reference or its data is NULL.
    54 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     54<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    5555    Unallowable operation: psImage input or its data is NULL.
    56 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     56<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    5757    Unallowable operation: kernels is NULL.
    58 <DATE><TIME>|<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
     58<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
    5959    Unallowable operation: stamps is NULL.
    60 <DATE><TIME>|<HOST>|W|psVectorStats
    61     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    62 <DATE><TIME>|<HOST>|W|psVectorStats
    63     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    64 <DATE><TIME>|<HOST>|W|psVectorStats
    65     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    66 <DATE><TIME>|<HOST>|W|psVectorStats
    67     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    68 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     60<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    6961    Unallowable operation: psVector solution or its data is NULL.
    70 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     62<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    7163    Unallowable operation: kernels is NULL.
    72 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     64<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    7365    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    74 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     66<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    7567    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    76 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     68<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    7769    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    78 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     70<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    7971    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    80 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     72<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    8173    Unallowable operation: stamps is NULL.
    82 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     74<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    8375    Unallowable operation: psImage reference or its data is NULL.
    84 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     76<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    8577    Unallowable operation: psImage input or its data is NULL.
    86 <DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
     78<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)
    8779    Unallowable operation: kernels is NULL.
    88 <DATE><TIME>|<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
     80<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)
    8981    Unallowable operation: stamps is NULL.
    90 <DATE><TIME>|<HOST>|W|psVectorStats
    91     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    92 <DATE><TIME>|<HOST>|W|psVectorStats
    93     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    94 <DATE><TIME>|<HOST>|W|psVectorStats
    95     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    96 <DATE><TIME>|<HOST>|W|psVectorStats
    97     WARNING: psVectorStats(): p_psVectorSampleMean() returned an error.
    98 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     82<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    9983    Unallowable operation: psVector solution or its data is NULL.
    100 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     84<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    10185    Unallowable operation: kernels is NULL.
    102 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     86<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    10387    Error: x, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    104 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     88<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    10589    Error: x, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    106 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     90<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    10791    Error: y, -2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    108 <DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
     92<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)
    10993    Error: y, 2.000000, is out of range.  Must be between -1.000000 and 1.000000.
    11094
  • trunk/psModules/test/verified/tst_pmImageSubtract.stdout

    r4200 r4579  
    22Testing pmSubtractionKernelsAllocPOIS(2, 3)
    33Testing pmSubtractionKernelsAllocPOIS(3, 4)
    4 Testing pmSubtractionKernelsAllocISIS(1, 1, 1, 1)
    5 Testing pmSubtractionKernelsAllocISIS(2, 2, 2, 2)
    6 Testing pmSubtractionKernelsAllocISIS(2, 3, 4, 5)
    7 Testing pmSubtractionKernelsAllocISIS(3, 4, 5, 6)
    84Testing pmSubtractionFindStamps(100, 100, 2, 2, 2)
    95Calling with a NULL psImage.  Should generate error, return NULL.
     
    2117Calling with acceptable input parameters, NULL mask.
    2218Testing pmSubtractionCalculateEquation():
    23     image size is (100, 100)
    24     num stamps is (2, 2).  Border is 3
     19    image size is (25, 25)
     20    num stamps is (2, 2).  Border is 2
    2521   kernel type is PM_SUBTRACTION_KERNEL_POIS.
    2622Generating stamps...
     
    3228Calling with acceptable input parameters.  Should return TRUE.
    3329Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
    34 Calling with pmSubtractionSolveEquation() acceptable input parameters.  Should return non-NULL.
    35 Calling with pmSubtractionRejectStamps() acceptable input parameters.  Should return TRUE.
     30Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
     31The solution vector is:
     32(1.37) (-0.00) (0.10) (0.08) (0.14) (0.10) (0.01) (0.02) (0.00) (-0.02) (-0.01) (-0.00) (0.00) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.00) (0.00) (-0.02) (0.01) (0.00) (-0.01) (0.00) (-0.00) (0.01) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.01) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.00) (0.00) (0.01) (-0.00) (-0.00) (-0.01) (0.02) (-0.00) (0.00) (-0.00) (-0.00) (-0.01) (-0.01) (0.02) (0.01) (-0.01) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (-0.03) (-0.00) (0.04) (0.01) (-0.00) (-0.03) (0.02) (0.02) (0.01) (-0.03) (-0.03) (-0.02) (0.01) (-0.01) (-0.01) (0.00) (0.00) (0.01) (0.02) (-0.02) (-0.02) (0.02) (0.02) (0.02) (0.03) (-0.03) (-0.03) (0.02) (0.02) (0.02) (0.00) (0.01) (-0.02) (-0.01) (-0.01) (0.02) (-0.03) (0.02) (0.03) (-0.02) (-0.03) (-0.02) (-0.01) (-0.01) (0.00) (0.01) (-0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.01) (-0.01) (-0.02) (0.02) (0.01) (-0.02) (-0.02) (-0.00) (0.02) (-0.01) (-0.02) (0.01) (0.00) (0.01) (-0.02) (0.01) (0.00) (-0.00) (-0.01) (0.00) (0.00) (-0.01) (-0.01) (0.01) (0.01) (0.01) (0.51)
     33Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
    3634Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
    3735Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
     
    4038Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
    4139Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
    42 Calling with pmSubtractionKernelImage() acceptable input parameters.  Should return a psImage.
     40Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
     41-0.000774 -0.013938 0.010689 -0.013394 -0.015507
     42-0.009241 -0.020300 -0.002732 0.016843 0.010743
     430.008820 0.015628 1.495404 -0.021095 -0.009788
     440.003371 -0.001256 0.017835 0.003308 0.008175
     450.009877 -0.010686 0.014775 0.003368 0.006204
    4346Testing pmSubtractionCalculateEquation():
    44     image size is (100, 100)
    45     num stamps is (2, 2).  Border is 3
     47    image size is (25, 25)
     48    num stamps is (2, 2).  Border is 2
    4649   kernel type is PM_SUBTRACTION_KERNEL_ISIS.
    4750Generating stamps...
     
    5356Calling with acceptable input parameters.  Should return TRUE.
    5457Calling pmSubtractionSolveEquation() with a NULL stamp argument.  Should generate error, return FALSE.
    55 Calling with pmSubtractionSolveEquation() acceptable input parameters.  Should return non-NULL.
    56 Calling with pmSubtractionRejectStamps() acceptable input parameters.  Should return TRUE.
     58Calling pmSubtractionSolveEquation() with acceptable input parameters.  Should return non-NULL.
     59The solution vector is:
     60(0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.55)
     61Calling pmSubtractionRejectStamps() with acceptable input parameters.  Should return TRUE.
    5762Calling pmSubtractionKernelImage() with NULL solution.  Should generate error, return NULL.
    5863Calling pmSubtractionKernelImage() with NULL kernels.  Should generate error, return NULL.
     
    6166Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
    6267Calling pmSubtractionKernelImage() unallowable y value.  Should generate error, return NULL.
    63 Calling with pmSubtractionKernelImage() acceptable input parameters.  Should return a psImage.
     68Calling pmSubtractionKernelImage() with acceptable input parameters.  Should return a psImage.
     690.031614 0.045997 0.052122 0.045997 0.031614
     700.045997 0.066926 0.075837 0.066926 0.045997
     710.052122 0.075837 0.085934 0.075837 0.052122
     720.045997 0.066926 0.075837 0.066926 0.045997
     730.031614 0.045997 0.052122 0.045997 0.031614
Note: See TracChangeset for help on using the changeset viewer.