Changeset 4579
- Timestamp:
- Jul 18, 2005, 3:44:48 PM (21 years ago)
- Location:
- trunk/psModules
- Files:
-
- 21 edited
-
psmodule.kdevses (modified) (2 diffs)
-
src/Makefile.am (modified) (2 diffs)
-
src/pmFlatField.h (modified) (1 diff)
-
src/pmImageSubtract.c (modified) (3 diffs)
-
src/pmMaskBadPixels.h (modified) (2 diffs)
-
src/pmNonLinear.h (modified) (2 diffs)
-
src/pmObjects.c (modified) (9 diffs)
-
src/pmObjects.h (modified) (2 diffs)
-
src/pmReadoutCombine.h (modified) (2 diffs)
-
src/pmSubtractBias.c (modified) (2 diffs)
-
src/pmSubtractBias.h (modified) (2 diffs)
-
src/pmSubtractSky.h (modified) (2 diffs)
-
src/psAstrometry.c (modified) (47 diffs)
-
src/psAstrometry.h (modified) (45 diffs)
-
test/tst_pmImageCombine.c (modified) (3 diffs)
-
test/tst_pmImageSubtract.c (modified) (4 diffs)
-
test/tst_pmObjects01.c (modified) (22 diffs)
-
test/verified/tst_pmImageCombine.stderr (modified) (1 diff)
-
test/verified/tst_pmImageCombine.stdout (modified) (2 diffs)
-
test/verified/tst_pmImageSubtract.stderr (modified) (2 diffs)
-
test/verified/tst_pmImageSubtract.stdout (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/psmodule.kdevses
r3696 r4579 2 2 <!DOCTYPE KDevPrjSession> 3 3 <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" > 6 6 <View0 line="24" Type="Source" /> 7 7 </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" /> 10 10 </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> 11 29 </DocsAndViews> 12 30 <pluginList> 13 <kdevdebugger>14 <breakpointList/>15 </kdevdebugger>16 31 <kdevbookmarks> 17 32 <bookmarks/> 18 33 </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> 19 37 <kdevvalgrind> 20 38 <executable path="" params="" /> … … 23 41 <kcachegrind path="" /> 24 42 </kdevvalgrind> 43 <kdevdebugger> 44 <breakpointList/> 45 </kdevdebugger> 25 46 </pluginList> 26 47 </KDevPrjSession> -
trunk/psModules/src/Makefile.am
r3877 r4579 9 9 pmReadoutCombine.c \ 10 10 pmSubtractBias.c \ 11 pmSubtractSky.c 11 pmSubtractSky.c \ 12 psAstrometry.c 12 13 13 14 libpsmodule_a_HEADERS = pmFlatFieldErrors.h \ … … 21 22 pmReadoutCombine.h \ 22 23 pmSubtractBias.h \ 23 pmSubtractSky.h 24 pmSubtractSky.h \ 25 psAstrometry.h 24 26 25 27 EXTRA_DIST = psErrorCodes.dat -
trunk/psModules/src/pmFlatField.h
r1849 r4579 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $21 * @date $Date: 200 4-09-22 19:58:57$20 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-07-19 01:44:48 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 24 24 */ 25 26 #include "pslib.h" 27 #include "psAstrometry.h" 28 25 29 26 30 /** Execute flat field module. -
trunk/psModules/src/pmImageSubtract.c
r4424 r4579 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-29 01:17:23$9 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-07-19 01:44:48 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 65 65 stamp->status = status; 66 66 67 psMemSetDeallocator(stamp, (psFreeF cn)p_pmStampFree);67 psMemSetDeallocator(stamp, (psFreeFunc)p_pmStampFree); 68 68 69 69 return(stamp); … … 88 88 89 89 tmp->type = type; 90 psMemSetDeallocator(tmp, (psFreeF cn) p_pmSubtractionKernelsFree);90 psMemSetDeallocator(tmp, (psFreeFunc) p_pmSubtractionKernelsFree); 91 91 return(tmp); 92 92 } -
trunk/psModules/src/pmMaskBadPixels.h
r1822 r4579 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $22 * @date $Date: 200 4-09-17 00:49:04$21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-07-19 01:44:48 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 27 27 #include "pslib.h" 28 #include "psAstrometry.h" 28 29 29 30 /** Mask values */ -
trunk/psModules/src/pmNonLinear.h
r3024 r4579 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 1-17 19:58:18 $7 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-19 01:44:48 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 17 17 #include "pslib.h" 18 #include "psAstrometry.h" 18 19 19 20 psReadout *pmNonLinearityPolynomial(psReadout *in, -
trunk/psModules/src/pmObjects.c
r4222 r4579 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-13 20:00:49$8 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-19 01:44:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 108 108 } 109 109 110 psMemSetDeallocator(tmp, (psFreeF cn) modelFree);110 psMemSetDeallocator(tmp, (psFreeFunc) modelFree); 111 111 return(tmp); 112 112 } … … 138 138 tmp->models = NULL; 139 139 tmp->type = 0; 140 psMemSetDeallocator(tmp, (psFreeF cn) sourceFree);140 psMemSetDeallocator(tmp, (psFreeFunc) sourceFree); 141 141 142 142 return(tmp); … … 1895 1895 params->data.F32[6] = Sxy; 1896 1896 *****************************************************************************/ 1897 psF64 pmMinLM_Gauss2D(psVector *deriv, 1898 psVector *params, 1899 psVector *x) 1897 float pmMinLM_Gauss2D( 1898 psVector *deriv, 1899 const psVector *params, 1900 const psVector *x) 1900 1901 { 1901 1902 PS_ASSERT_VECTOR_NON_NULL(params, NAN); … … 1931 1932 params->data.F32[6] = Sxy; 1932 1933 *****************************************************************************/ 1933 psF64 pmMinLM_PsuedoGauss2D(psVector *deriv, 1934 psVector *params, 1935 psVector *x) 1934 float pmMinLM_PsuedoGauss2D( 1935 psVector *deriv, 1936 const psVector *params, 1937 const psVector *x) 1936 1938 { 1937 1939 PS_ASSERT_VECTOR_NON_NULL(params, NAN); … … 1971 1973 params->data.F32[8] = B3; 1972 1974 *****************************************************************************/ 1973 psF64 pmMinLM_Wauss2D(psVector *deriv, 1974 psVector *params, 1975 psVector *x) 1975 float pmMinLM_Wauss2D( 1976 psVector *deriv, 1977 const psVector *params, 1978 const psVector *x) 1976 1979 { 1977 1980 PS_ASSERT_VECTOR_NON_NULL(params, NAN); … … 2019 2022 params->data.F32[10] = N; 2020 2023 *****************************************************************************/ 2021 psF64 pmMinLM_TwistGauss2D(psVector *deriv, 2022 psVector *params, 2023 psVector *x) 2024 float pmMinLM_TwistGauss2D( 2025 psVector *deriv, 2026 const psVector *params, 2027 const psVector *x) 2024 2028 { 2025 2029 PS_ASSERT_VECTOR_NON_NULL(params, NAN); … … 2077 2081 params->data.F32[7] = Nexp; 2078 2082 *****************************************************************************/ 2079 psF64 pmMinLM_Sersic(psVector *deriv, 2080 psVector *params, 2081 psVector *x) 2083 float pmMinLM_Sersic( 2084 psVector *deriv, 2085 const psVector *params, 2086 const psVector *x) 2082 2087 { 2083 2088 PS_ASSERT_VECTOR_NON_NULL(params, NAN); … … 2102 2107 params->data.F32[11] = Nexp; 2103 2108 *****************************************************************************/ 2104 psF64 pmMinLM_SersicCore(psVector *deriv, 2105 psVector *params, 2106 psVector *x) 2109 float pmMinLM_SersicCore( 2110 psVector *deriv, 2111 const psVector *params, 2112 const psVector *x) 2107 2113 { 2108 2114 PS_ASSERT_VECTOR_NON_NULL(params, NAN); -
trunk/psModules/src/pmObjects.h
r4187 r4579 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 6-09 06:19:27$7 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-19 01:44:48 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 209 209 XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32 210 210 *****************************************************************************/ 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 ); 211 float 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 *****************************************************************************/ 219 float 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 *****************************************************************************/ 227 float 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 *****************************************************************************/ 235 float 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 *****************************************************************************/ 243 float 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 *****************************************************************************/ 251 float 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 *****************************************************************************/ 259 float 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 ); 257 264 258 265 -
trunk/psModules/src/pmReadoutCombine.h
r3668 r4579 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 4-05 22:55:05$7 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-07-19 01:44:48 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "pslib.h" 24 24 #include "psConstants.h" 25 #include "psAstrometry.h" 25 26 26 27 typedef struct -
trunk/psModules/src/pmSubtractBias.c
r4131 r4579 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-07 22:13:42$8 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-19 01:44:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 352 352 353 353 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); 355 355 if (rc == NULL) { 356 356 psError(PS_ERR_UNKNOWN, false, "psImageStats(): could not perform requested statistical operation. Returning in image.\n"); -
trunk/psModules/src/pmSubtractBias.h
r4132 r4579 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-07 22:20:55$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-19 01:44:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include<math.h> 24 24 #include "pslib.h" 25 #include "psAstrometry.h" 25 26 26 27 typedef enum { -
trunk/psModules/src/pmSubtractSky.h
r3668 r4579 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-05 22:55:05$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-19 01:44:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include<math.h> 24 24 #include "pslib.h" 25 #include "psAstrometry.h" 25 26 26 27 // XXX: this is pmFit in pmSubtractBias.c, named psFit here. -
trunk/psModules/src/psAstrometry.c
r4577 r4579 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-07-1 8 18:48:29$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-19 01:44:48 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psError.h" 26 26 #include "psConstants.h" 27 #include "psAstronomyErrors.h"27 //#include "psAstronomyErrors.h" 28 28 #include "psMatrix.h" 29 29 #include "psTrace.h" 30 30 #include "psLogMsg.h" 31 31 32 32 33 /***************************************************************************** … … 35 36 psImage. 36 37 *****************************************************************************/ 38 /* 37 39 static psS32 checkValidImageCoords(double x, 38 40 double y, … … 40 42 { 41 43 PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0); 42 44 43 45 if ((x < 0.0) || (x > (double)tmpImage->numCols) || 44 46 (y < 0.0) || (y > (double)tmpImage->numRows)) { 45 47 return (0); 46 48 } 47 49 48 50 return (1); 49 51 } 50 51 52 */ 53 /* 52 54 static void FPAFree(psFPA* fpa) 53 55 { … … 65 67 } 66 68 } 67 69 */ 70 71 /* 68 72 static void chipFree(psChip* chip) 69 73 { … … 75 79 } 76 80 } 77 81 */ 82 83 /* 78 84 static void cellFree(psCell* cell) 79 85 { … … 88 94 } 89 95 } 96 */ 90 97 91 98 static void readoutFree(psReadout* readout) … … 99 106 } 100 107 108 /* 101 109 static void observatoryFree(psObservatory* obs) 102 110 { … … 105 113 } 106 114 } 107 115 */ 116 /* 108 117 static void exposureFree(psExposure* exp) 109 118 { … … 115 124 } 116 125 } 117 126 */ 127 /* 118 128 static void fixedPatternFree(psFixedPattern* fp) 119 129 { … … 122 132 psFree(fp->x[i]); 123 133 } 124 134 125 135 for (psS32 j = 0; j < fp->p_ps_yRows; j++) { 126 136 psFree(fp->y[j]); 127 137 } 128 138 129 139 psFree(fp->x); 130 140 psFree(fp->y); 131 141 } 132 142 } 133 143 */ 134 144 /*****************************************************************************/ 135 145 /* FUNCTION IMPLEMENTATION - PUBLIC */ … … 141 151 * XXX: This assumes that x,y must be of type F64 142 152 */ 153 /* 143 154 psFixedPattern* 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 /* 197 208 psExposure* psExposureAlloc(double ra, 198 209 double dec, … … 210 221 { 211 222 PS_ASSERT_PTR_NON_NULL(observatory, NULL); 212 223 213 224 psExposure* exp = psAlloc(sizeof(psExposure)); 214 225 *(double *)&exp->ra = ra; … … 223 234 *(float *)&exp->exposureTime = exposureTime; 224 235 *(float *)&exp->wavelength = wavelength; 225 236 226 237 exp->time = psMemIncrRefCounter((psPtr)time); 227 238 exp->observatory = psMemIncrRefCounter((psPtr)observatory); 228 239 229 240 // XXX: how is this value derived? 230 241 *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude); … … 235 246 exp->cameraName = NULL; 236 247 exp->telescopeName = NULL; 237 248 238 249 psMemSetDeallocator(exp,(psFreeFunc)exposureFree); 239 250 240 251 return exp; 241 252 } 242 253 */ 254 /* 243 255 psObservatory* psObservatoryAlloc(const char* name, 244 256 double latitude, … … 248 260 { 249 261 psObservatory* obs = psAlloc(sizeof(psObservatory)); 250 262 251 263 if (name == NULL) { 252 264 obs->name = NULL; … … 255 267 strcpy((char*)obs->name, name); 256 268 } 257 269 258 270 *(double *)&obs->latitude = latitude; 259 271 *(double *)&obs->longitude = longitude; 260 272 *(double *)&obs->height = height; 261 273 *(double *)&obs->tlr = tlr; 262 274 263 275 psMemSetDeallocator(obs,(psFreeFunc)observatoryFree); 264 276 265 277 return obs; 266 278 } 267 279 */ 280 /* 268 281 psFPA* psFPAAlloc(psS32 nChips, 269 282 const psExposure* exp) 270 283 { 271 284 PS_ASSERT_INT_NONNEGATIVE(nChips, NULL); 272 285 273 286 psFPA* newFPA = psAlloc(sizeof(psFPA)); 274 287 275 288 // create array of NULL chips of the size nChips 276 289 newFPA->chips = psArrayAlloc(nChips); … … 280 293 } 281 294 newFPA->chips->n = 0; // per requirement 282 295 283 296 newFPA->metadata = NULL; 284 297 newFPA->fromTangentPlane = NULL; 285 298 newFPA->toTangentPlane = NULL; 286 299 newFPA->pattern = NULL; 287 300 288 301 if (exp != NULL) { 289 302 newFPA->exposure = psMemIncrRefCounter((psExposure*)exp); … … 293 306 newFPA->grommit = NULL; 294 307 } 295 308 296 309 newFPA->colorPlus = NULL; 297 310 newFPA->colorMinus = NULL; 298 311 newFPA->projection = NULL; 299 312 300 313 newFPA->rmsX = 0.0f; 301 314 newFPA->rmsY = 0.0f; 302 315 newFPA->chi2 = 0.0f; 303 316 304 317 psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree); 305 318 306 319 return newFPA; 307 320 } 308 321 */ 309 322 /* 310 323 * psChip constructor 311 324 */ 325 /* 312 326 psChip* psChipAlloc(psS32 nCells, 313 327 psFPA *parentFPA) 314 328 { 315 329 PS_ASSERT_INT_NONNEGATIVE(nCells, NULL); 316 330 317 331 psChip* chip = psAlloc(sizeof(psChip)); 318 332 319 333 // create array of NULL psCells 320 334 int n = (nCells > 0) ? nCells : 1; … … 325 339 } 326 340 chip->cells->n = 0; // per requirement 327 341 328 342 *(int*)&chip->row0 = 0; 329 343 *(int*)&chip->col0 = 0; 330 344 331 345 chip->metadata = NULL; 332 346 333 347 chip->toFPA = NULL; 334 348 chip->fromFPA = NULL; 335 349 336 350 chip->parent = parentFPA; 337 351 338 352 psMemSetDeallocator(chip,(psFreeFunc)chipFree); 339 353 340 354 return chip; 341 342 } 343 355 356 } 357 */ 344 358 /* 345 359 * psCell constructor 346 360 */ 361 /* 347 362 psCell* psCellAlloc(psS32 nReadouts, 348 363 psChip* parentChip) 349 364 { 350 365 PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL); 351 366 352 367 psCell* cell = psAlloc(sizeof(psCell)); 353 368 354 369 // create array of NULL psReadouts 355 370 int n = (nReadouts > 0) ? nReadouts : 1; … … 360 375 } 361 376 cell->readouts->n = 0; // per requirement 362 377 363 378 *(int*)&cell->row0 = 0; 364 379 *(int*)&cell->col0 = 0; 365 380 366 381 cell->metadata = NULL; 367 382 368 383 cell->toChip = NULL; 369 384 cell->fromChip = NULL; … … 371 386 cell->toTP = NULL; 372 387 cell->toSky = NULL; 373 388 374 389 cell->parent = parentChip; 375 390 376 391 psMemSetDeallocator(cell,(psFreeFunc)cellFree); 377 392 378 393 return cell; 379 380 381 } 382 394 395 396 } 397 */ 383 398 psReadout* psReadoutAlloc() 384 399 { … … 402 417 } 403 418 419 /* 404 420 psGrommit* psGrommitAlloc(const psExposure* exp) 405 421 { 406 422 PS_ASSERT_PTR_NON_NULL(exp, NULL); 407 423 408 424 psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time); 409 425 410 426 psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit)); 411 427 412 428 *(double*)&grommit->latitude = exp->observatory->latitude; 413 429 *(double*)&grommit->longitude = exp->observatory->longitude; … … 422 438 *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too. 423 439 *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct 424 440 425 441 psFree(polarMotion); 426 442 427 443 return (grommit); 428 444 } 429 445 */ 446 /* 430 447 psCell* psCellInFPA(const psPlane* fpaCoord, 431 448 const psFPA* FPA) … … 433 450 PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL); 434 451 PS_ASSERT_PTR_NON_NULL(FPA, NULL); 435 452 436 453 psChip* tmpChip = NULL; 437 454 psPlane chipCoord; 438 455 psCell* outCell = NULL; 439 456 440 457 // Determine which chip contains the fpaCoords. 441 458 tmpChip = psChipInFPA(fpaCoord, FPA); … … 443 460 return(NULL); 444 461 } 445 462 446 463 // Convert to those chip coordinates. 447 464 psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip); 448 465 449 466 // Determine which cell contains those chip coordinates. 450 467 outCell = psCellInChip(&chipCoord, tmpChip); 451 468 452 469 return (outCell); 453 470 } 454 471 */ 472 /* 455 473 psChip* psChipInFPA(const psPlane* fpaCoord, 456 474 const psFPA* FPA) … … 459 477 PS_ASSERT_PTR_NON_NULL(FPA, NULL); 460 478 PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL); 461 479 462 480 psArray* chips = FPA->chips; 463 481 psS32 nChips = chips->n; 464 482 psPlane chipCoord; 465 483 psCell *tmpCell = NULL; 466 484 467 485 // Loop through every chip in this FPA. Convert the original FPA 468 486 // coordinates to chip coordinates for that chip. Then, determine if any 469 487 // cells in that chip contain those chip coordinates. 470 488 471 489 for (psS32 i = 0; i < nChips; i++) { 472 490 psChip* tmpChip = chips->data[i]; 473 491 PS_ASSERT_PTR_NON_NULL(tmpChip, NULL); 474 492 PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL); 475 493 476 494 psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord); 477 495 478 496 tmpCell = psCellInChip(&chipCoord, tmpChip); 479 497 if (tmpCell != NULL) { … … 481 499 } 482 500 } 483 501 484 502 // XXX: Print warning here? 485 503 return (NULL); 486 504 } 487 505 */ 506 /* 488 507 psCell* psCellInChip(const psPlane* chipCoord, 489 508 const psChip* chip) … … 491 510 PS_ASSERT_PTR_NON_NULL(chipCoord, NULL); 492 511 PS_ASSERT_PTR_NON_NULL(chip, NULL); 493 512 494 513 psPlane cellCoord; 495 514 psArray* cells; 496 515 497 516 cells = chip->cells; 498 517 if (cells == NULL) { 499 518 return NULL; 500 519 } 501 520 502 521 // We loop over each cell in the chip. We transform the chipCoord into 503 522 // a cellCoord for that cell and determine if that cellCoord is valid. 504 523 // If so, then we return that cell. 505 524 506 525 for (psS32 i = 0; i < cells->n; i++) { 507 526 psCell* tmpCell = (psCell* ) cells->data[i]; … … 509 528 PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL); 510 529 psArray* readouts = tmpCell->readouts; 511 530 512 531 if (readouts != NULL) { 513 532 for (psS32 j = 0; j < readouts->n; j++) { 514 533 psReadout* tmpReadout = readouts->data[j]; 515 534 PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL); 516 535 517 536 psPlaneTransformApply(&cellCoord, 518 537 tmpCell->fromChip, 519 538 chipCoord); 520 539 521 540 if (checkValidImageCoords(cellCoord.x, 522 541 cellCoord.y, … … 527 546 } 528 547 } 529 548 530 549 return (NULL); 531 550 } 532 551 */ 552 /* 533 553 psPlane* psCoordCellToChip(psPlane* outCoord, 534 554 const psPlane* inCoord, … … 537 557 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 538 558 PS_ASSERT_PTR_NON_NULL(cell, NULL); 539 559 540 560 return (psPlaneTransformApply(outCoord, cell->toChip, inCoord)); 541 561 } 542 562 */ 563 /* 543 564 psPlane* psCoordChipToFPA(psPlane* outCoord, 544 565 const psPlane* inCoord, … … 547 568 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 548 569 PS_ASSERT_PTR_NON_NULL(chip, NULL); 549 570 550 571 return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord)); 551 572 } 552 573 */ 574 /* 553 575 psPlane* psCoordFPAToTP(psPlane* outCoord, 554 576 const psPlane* inCoord, … … 559 581 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 560 582 PS_ASSERT_PTR_NON_NULL(fpa, NULL); 561 583 562 584 return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord, 563 585 color, magnitude)); 564 586 } 565 587 */ 566 588 /***************************************************************************** 567 589 XXX: What about units for the (x,y) coords? 568 590 *****************************************************************************/ 591 /* 569 592 psSphere* psCoordTPToSky(psSphere* outSphere, 570 593 const psPlane* tpCoord, … … 573 596 PS_ASSERT_PTR_NON_NULL(tpCoord, NULL); 574 597 PS_ASSERT_PTR_NON_NULL(grommit, NULL); 575 598 576 599 if (outSphere == NULL) { 577 600 outSphere = (psSphere* ) psAlloc(sizeof(psSphere)); 578 601 } 579 602 580 603 // XXX: this was done by a SLALIB call -- needs to be reimplemented 581 604 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 585 608 return (outSphere); 586 609 } 587 610 */ 611 /* 588 612 psPlane* psCoordCellToFPA(psPlane* fpaCoord, 589 613 const psPlane* cellCoord, … … 592 616 PS_ASSERT_PTR_NON_NULL(cellCoord, NULL); 593 617 PS_ASSERT_PTR_NON_NULL(cell, NULL); 594 618 595 619 return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord)); 596 620 } 597 621 */ 622 /* 598 623 psSphere* psCoordCellToSky(psSphere* skyCoord, 599 624 const psPlane* cellCoord, … … 609 634 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL); 610 635 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL); 611 636 612 637 psPlane* fpaCoord = NULL; 613 638 psPlane* tpCoord = NULL; 614 639 psFPA* parFPA = (cell->parent)->parent; 615 640 psGrommit* tmpGrommit = NULL; 616 641 617 642 // Convert the input cell coordinates to FPA coordinates. 618 643 fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord); 619 644 620 645 // Convert the FPA coordinates to tangent plane Coordinates. 621 646 tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane, 622 647 fpaCoord, color, magnitude); 623 648 624 649 // Generate a grommit for this FPA. 625 650 tmpGrommit = psGrommitAlloc(parFPA->exposure); 626 651 627 652 // Convert the tangent plane Coordinates to sky coordinates. 628 653 skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit); 629 654 630 655 psFree(fpaCoord); 631 656 psFree(tpCoord); 632 657 psFree(tmpGrommit); 633 658 634 659 return(skyCoord); 635 660 } 636 661 662 */ 663 /* 637 664 psSphere* psCoordCellToSkyQuick(psSphere* outSphere, 638 665 const psPlane* cellCoord, … … 650 677 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored. The cell->toTP transform is being used."); 651 678 } 652 679 653 680 psPlane *tpCoord = NULL; 654 681 psChip *chip = cell->parent; 655 682 psFPA *FPA = chip->parent; 656 683 psProjectionType oldProjectionType; 657 684 658 685 if (outSphere == NULL) { 659 686 outSphere = (psSphere* ) psAlloc(sizeof(psSphere)); 660 687 } 661 688 662 689 // Determine the tangent plane coordinates. 663 690 tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord); 664 691 665 692 // Save the old projection type and set the new projection type to TAN. 666 693 oldProjectionType = FPA->projection->type; 667 694 FPA->projection->type = PS_PROJ_TAN; 668 695 669 696 // Deproject the tangent plane coordinates a sphere. 670 697 outSphere = psDeproject(tpCoord, FPA->projection); 671 698 672 699 // Restore old projection type. Free memory. 673 700 FPA->projection->type = oldProjectionType; 674 701 psFree(tpCoord); 675 702 676 703 return (outSphere); 677 704 } 705 */ 678 706 679 707 /***************************************************************************** 680 708 XXX: What about units for the (x,y) coords? 681 709 *****************************************************************************/ 710 /* 682 711 psPlane* psCoordSkyToTP(psPlane* tpCoord, 683 712 const psSphere* in, … … 686 715 PS_ASSERT_PTR_NON_NULL(in, NULL); 687 716 PS_ASSERT_PTR_NON_NULL(grommit, NULL); 688 717 689 718 // char* type = "RA"; 690 719 691 720 if (tpCoord == NULL) { 692 721 tpCoord = (psPlane* ) psAlloc(sizeof(psPlane)); 693 722 } 694 723 695 724 // XXX: this was done by a SLALIB call -- needs to be reimplemented 696 725 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 699 728 return(tpCoord); 700 729 } 701 702 730 */ 731 /* 703 732 psPlane* psCoordTPToFPA(psPlane* fpaCoord, 704 733 const psPlane* tpCoord, … … 710 739 PS_ASSERT_PTR_NON_NULL(fpa, NULL); 711 740 PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL); 712 741 713 742 return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane, 714 743 tpCoord, color, magnitude)); 715 744 } 716 745 */ 746 /* 717 747 psPlane* psCoordFPAToChip(psPlane* chipCoord, 718 748 const psPlane* fpaCoord, … … 722 752 PS_ASSERT_PTR_NON_NULL(chip, NULL); 723 753 PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL); 724 754 725 755 chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord); 726 756 return(chipCoord); 727 757 } 728 758 */ 759 /* 729 760 psPlane* psCoordChipToCell(psPlane* cellCoord, 730 761 const psPlane* chipCoord, … … 734 765 PS_ASSERT_PTR_NON_NULL(cell, NULL); 735 766 PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL); 736 767 737 768 cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord); 738 769 return(cellCoord); 739 770 } 740 771 */ 772 /* 741 773 psPlane* psCoordSkyToCell(psPlane* cellCoord, 742 774 const psSphere* skyCoord, … … 750 782 PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL); 751 783 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL); 752 784 753 785 psChip *parChip = cell->parent; 754 786 psFPA *parFPA = parChip->parent; 755 787 psGrommit* grommit = parFPA->grommit; 756 788 757 789 // Convert the skyCoords to tangent plane coords. 758 790 psPlane *tpCoord = psCoordSkyToTP(tpCoord, skyCoord, grommit); 759 791 760 792 // Convert the tangent plane coords to FPA coords. 761 793 psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color, 762 794 magnitude, parFPA); 763 795 764 796 // Convert the FPA coords to chip coords. 765 797 psPlane *chipCoord = psCoordFPAToChip(chipCoord, fpaCoord, parChip); 766 798 767 799 // Convert the chip coords to cell coords. 768 800 cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell); 769 801 770 802 psFree(tpCoord); 771 803 psFree(fpaCoord); 772 804 psFree(chipCoord); 773 805 774 806 return (cellCoord); 775 807 } 776 808 */ 809 /* 777 810 psPlane* psCoordSkyToCellQuick(psPlane* cellCoord, 778 811 const psSphere* skyCoord, … … 790 823 "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored. The cell->toTP transform is being used."); 791 824 } 792 825 793 826 psPlane *tpCoord = NULL; 794 827 psChip *whichChip = cell->parent; … … 796 829 psProjectionType oldProjectionType; 797 830 psPlaneTransform *TPtoCell = NULL; 798 831 799 832 // Save the old projection type and set the new projection type to TAN. 800 833 oldProjectionType = whichFPA->projection->type; 801 834 whichFPA->projection->type = PS_PROJ_TAN; 802 835 803 836 if (cellCoord == NULL) { 804 837 cellCoord = (psPlane* ) psAlloc(sizeof(psPlane)); 805 838 } 806 839 807 840 tpCoord = psProject(skyCoord, whichFPA->projection); 808 841 809 842 // generate an error if cell->toTP is not linear. 810 843 if (0 == p_psIsProjectionLinear(cell->toTP)) { … … 813 846 "cell to tangent plane"); 814 847 } 815 848 816 849 TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP); 817 850 cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord); 818 851 819 852 // Restore old projection type. Free memory. 820 853 whichFPA->projection->type = oldProjectionType; … … 822 855 return (cellCoord); 823 856 } 824 825 826 857 */ 858 859 -
trunk/psModules/src/psAstrometry.h
r4577 r4579 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-07-1 8 18:48:29$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-19 01:44:48 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 17 17 #define PS_ASTROMETRY_H 18 18 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 /* 28 22 struct psCell; 29 23 struct psChip; 30 24 struct psFPA; 31 25 struct psExposure; 32 26 */ 33 27 /// @addtogroup AstroImage 34 28 /// @{ … … 42 36 * 43 37 */ 38 39 /* 44 40 typedef struct 45 41 { 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 vector50 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) 57 53 } 58 54 psGrommit; 55 */ 56 59 57 60 58 /** Fixed Pattern Corrections … … 67 65 * of the grid in x and y as well as the origin of the grid. 68 66 */ 67 /* 69 68 typedef struct 70 69 { … … 84 83 } 85 84 psFixedPattern; 85 */ 86 86 87 87 /** Readout data structure. 88 88 89 * 89 90 * A readout is the result of a single read of a cell (or a portion thereof). … … 121 122 * 122 123 */ 124 /* 123 125 typedef struct 124 126 { 125 127 const psS32 col0; ///< Offset from the left of chip 126 128 const psS32 row0; ///< Offset from the bottom of chip 127 129 128 130 psArray* readouts; ///< readouts from the cell 129 131 130 132 psMetadata* metadata; ///< cell-level metadata 131 133 132 134 psPlaneTransform* toChip; ///< transformations from cell to chip coordinates 133 135 psPlaneTransform* fromChip; ///< transformations from cell to chip coordinates … … 135 137 psPlaneTransform* toTP; ///< transformations from cell to FPA coordinates 136 138 psPlaneTransform* toSky; ///< transformations from cell to tangent plane coordinates 137 139 138 140 struct psChip* parent; ///< chip in which contains this cell 139 141 } 140 142 psCell; 143 */ 141 144 142 145 /** Chip data structure … … 148 151 * 149 152 */ 150 typedef struct psChip153 /*typedef struct psChip 151 154 { 152 155 const psS32 col0; ///< Offset from the left of FPA 153 156 const psS32 row0; ///< Offset from the bottom of FPA 154 157 155 158 psArray* cells; ///< cells in the chip 156 159 157 160 psMetadata* metadata; ///< chip-level metadata 158 161 159 162 psPlaneTransform* toFPA; ///< transformation from chip to FPA coordinates 160 163 psPlaneTransform* fromFPA; ///< transformation from FPA to chip coordinates 161 164 162 165 struct psFPA* parent; ///< FPA which contains this chip 163 166 } 164 167 psChip; 168 */ 165 169 166 170 /** A Focal-Plane … … 177 181 * 178 182 */ 179 typedef struct psFPA183 /*typedef struct psFPA 180 184 { 181 185 psArray* chips; ///< chips in the focal plane array 182 186 psMetadata* metadata; ///< focal-plane's metadata 183 187 184 188 psPlaneDistort* fromTangentPlane; ///< transformation from tangent plane to focal plane 185 189 psPlaneDistort* toTangentPlane; ///< transformation from focal plane to tangent plane 186 190 psFixedPattern* pattern; ///< fixed pattern residual offsets 187 191 188 192 const struct psExposure* exposure; ///< information about this exposure 189 193 psGrommit *grommit; ///< Wallace's grommit 190 194 191 195 psPhotSystem* colorPlus; ///< Color reference 192 196 psPhotSystem* colorMinus; ///< Color reference 193 197 psProjection *projection; ///< projection 194 198 195 199 float rmsX; ///< RMS for x transformation fits 196 200 float rmsY; ///< RMS for y transformation fits … … 198 202 } 199 203 psFPA; 204 */ 200 205 201 206 /** Observatory Information … … 204 209 * 205 210 */ 206 typedef struct211 /*typedef struct 207 212 { 208 213 const char* name; ///< Name of observatory … … 213 218 } 214 219 psObservatory; 220 */ 215 221 216 222 /** Exposure Information … … 221 227 * 222 228 */ 223 typedef struct psExposure229 /*typedef struct psExposure 224 230 { 225 231 const double ra; ///< Telescope boresight, right ascention … … 236 242 const float wavelength; ///< Wavelength in microns 237 243 const psObservatory* observatory; ///< Observatory data 238 239 / * Derived quantities */244 245 // Derived quantities 240 246 const double lst; ///< Local Sidereal Time 241 247 const float positionAngle; ///< Position angle … … 247 253 } 248 254 psExposure; 255 */ 249 256 250 257 /** Allocator for psFixedPattern struct … … 255 262 * @return psFixedPattern* New psFixedPattern struct. 256 263 */ 257 psFixedPattern* psFixedPatternAlloc(264 /*psFixedPattern* psFixedPatternAlloc( 258 265 double x0, ///< X Position of 0,0 corner on focal plane 259 266 double y0, ///< Y Position of 0,0 corner on focal plane … … 263 270 const psImage *y ///< The grid of offsets in y 264 271 ); 265 272 */ 266 273 267 274 /** Allocator for psExposure … … 273 280 * @return psExposure* New psExposure struct 274 281 */ 275 psExposure* psExposureAlloc(282 /*psExposure* psExposureAlloc( 276 283 double ra, ///< Telescope boresight, right ascention 277 284 double dec, ///< Telescope boresight, declination … … 288 295 const psObservatory* observatory ///< Observatory data 289 296 ); 297 */ 290 298 291 299 /** Allocator for psObservatory … … 296 304 * @return psObservatory* new psObservatory struct 297 305 */ 298 psObservatory* psObservatoryAlloc(306 /*psObservatory* psObservatoryAlloc( 299 307 const char* name, ///< Name of observatory 300 308 double latitude, ///< Latitude of observatory, east positive … … 303 311 double tlr ///< Tropospheric Lapse Rate 304 312 ); 313 */ 305 314 306 315 /** Allocator for psFPA … … 313 322 * @return psFPA* a newly allocated psFPA 314 323 */ 315 psFPA* psFPAAlloc(324 /*psFPA* psFPAAlloc( 316 325 psS32 nChips, ///< number of chips in the FPA 317 326 const psExposure* exp ///< the exposure information 318 327 ); 328 */ 319 329 320 330 /** Allocates a psChip … … 326 336 * @return psChip* newly allocated psChip 327 337 */ 328 psChip* psChipAlloc(338 /*psChip* psChipAlloc( 329 339 psS32 nCells, ///< number of cells in Chip 330 340 psFPA* parentFPA ///< parent FPA 331 341 ); 342 */ 332 343 333 344 /** Allocates a psCell … … 339 350 * @return psCell* newly allocated psCell 340 351 */ 341 psCell* psCellAlloc(352 /*psCell* psCellAlloc( 342 353 psS32 nReadouts, ///< number of readouts in cell 343 354 psChip* parentChip ///< parent Chip 344 355 ); 356 */ 345 357 346 358 /** Allocates a psReadout … … 360 372 * @return psGrommit* New grommit structure. 361 373 */ 362 psGrommit* psGrommitAlloc(374 /*psGrommit* psGrommitAlloc( 363 375 const psExposure* exp ///< the cooresponding exposure structure. 364 376 ); 377 */ 365 378 366 379 /** Find cooresponding cell for given FPA coordinate … … 368 381 * @return psCell* the cell cooresponding to the coord in FPA 369 382 */ 370 psCell* psCellInFPA(383 /*psCell* psCellInFPA( 371 384 const psPlane* coord, ///< the coordinate in FPA plane 372 385 const psFPA* FPA ///< the FPA to search for the cell 373 386 ); 387 */ 374 388 375 389 /** Find cooresponding chip for given FPA coordinate … … 377 391 * @return psChip* the chip cooresponding to coord 378 392 */ 379 psChip* psChipInFPA(393 /*psChip* psChipInFPA( 380 394 const psPlane* coord, ///< the coordinate in FPA plane 381 395 const psFPA* FPA ///< the FPA to search for the cell 382 396 ); 397 */ 383 398 384 399 /** Find cooresponding cell for given Chip coordinate … … 386 401 * @return psCell* the cell cooresponding to coord 387 402 */ 388 psCell* psCellInChip(403 /*psCell* psCellInChip( 389 404 const psPlane* coord, ///< the coordinate in Chip plane 390 405 const psChip* chip ///< the chip to search for the cell 391 406 ); 407 */ 392 408 393 409 /** Translate a cell coordinate into a chip coordinate … … 395 411 * @return psPlane* the resulting chip coordinate 396 412 */ 397 psPlane* psCoordCellToChip(413 /*psPlane* psCoordCellToChip( 398 414 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 399 415 const psPlane* in, ///< the coordinate within Cell 400 416 const psCell* cell ///< the Cell in interest 401 417 ); 418 */ 402 419 403 420 /** Translate a chip coordinate into a FPA coordinate … … 405 422 * @return psPlane* the resulting FPA coordinate 406 423 */ 407 psPlane* psCoordChipToFPA(424 /*psPlane* psCoordChipToFPA( 408 425 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 409 426 const psPlane* in, ///< the coordinate within Chip 410 427 const psChip* chip ///< the chip in interest 411 428 ); 429 */ 412 430 413 431 /** Translate a FPA coordinate into a Tangent Plane coordinate … … 415 433 * @return psPlane* the resulting Tangent Plane coordinate 416 434 */ 417 psPlane* psCoordFPAToTP(435 /*psPlane* psCoordFPAToTP( 418 436 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 419 437 const psPlane* in, ///< the coordinate within FPA … … 422 440 const psFPA* fpa ///< the FPA in interest 423 441 ); 442 */ 424 443 425 444 /** Translate a Tangent Plane coordinate into a Sky coordinate … … 427 446 * @return psSphere* the resulting Sky coordinate 428 447 */ 429 psSphere* psCoordTPToSky(448 /*psSphere* psCoordTPToSky( 430 449 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 431 450 const psPlane* in, ///< the coordinate within Tangent Plane 432 451 const psGrommit* grommit ///< the grommit of the tangent plane 433 452 ); 453 */ 434 454 435 455 /** Translate a cell coordinate into a FPA coordinate … … 437 457 * @return psPlane* the resulting FPA coordinate 438 458 */ 439 psPlane* psCoordCellToFPA(459 /*psPlane* psCoordCellToFPA( 440 460 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 441 461 const psPlane* in, ///< the coordinate within cell 442 462 const psCell* cell ///< the cell in interest 443 463 ); 464 */ 444 465 445 466 /** Translate a cell coordinate into a Sky coordinate … … 447 468 * @return psSphere* the resulting Sky coordinate 448 469 */ 449 psSphere* psCoordCellToSky(470 /*psSphere* psCoordCellToSky( 450 471 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 451 472 const psPlane* in, ///< the coordinate within cell … … 454 475 const psCell* cell ///< the cell in interest 455 476 ); 477 */ 456 478 457 479 /** Translate a cell coordinate into a Sky coordinate using a 'quick and … … 460 482 * @return psSphere* the resulting Sky coordinate 461 483 */ 462 psSphere* psCoordCellToSkyQuick(484 /*psSphere* psCoordCellToSkyQuick( 463 485 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 464 486 const psPlane* in, ///< the coordinate within cell 465 487 const psCell* cell ///< the cell in interest 466 488 ); 489 */ 467 490 468 491 /** Translate a Sky coordinate into a Tangent Plane coordinate … … 470 493 * @return psPlane* the resulting Tangent Plane coordinate 471 494 */ 472 psPlane* psCoordSkyToTP(495 /*psPlane* psCoordSkyToTP( 473 496 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 474 497 const psSphere* in, ///< the sky coordinate 475 498 const psGrommit* grommit ///< the grommit 476 499 ); 500 */ 477 501 478 502 /** Translate a Tangent Plane coordinate into a FPA coordinate … … 480 504 * @return psPlane* the resulting FPA coordinate 481 505 */ 482 psPlane* psCoordTPToFPA(506 /*psPlane* psCoordTPToFPA( 483 507 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 484 508 const psPlane* in, ///< the coordinate within tangent plane … … 487 511 const psFPA* fpa ///< the FPA of interest 488 512 ); 513 */ 489 514 490 515 /** Translate a FPA coordinate into a chip coordinate … … 492 517 * @return psPlane* the resulting chip coordinate 493 518 */ 494 psPlane* psCoordFPAToChip(519 /*psPlane* psCoordFPAToChip( 495 520 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 496 521 const psPlane* in, ///< the FPA coordinate 497 522 const psChip* chip ///< the chip of interest 498 523 ); 524 */ 499 525 500 526 /** Translate a chip coordinate into a cell coordinate … … 502 528 * @return psPlane* the resulting cell coordinate 503 529 */ 504 psPlane* psCoordChipToCell(530 /*psPlane* psCoordChipToCell( 505 531 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 506 532 const psPlane* in, ///< the Chip coordinate 507 533 const psCell* cell ///< the cell of interest 508 534 ); 535 */ 509 536 510 537 /** Translate a sky coordinate into a cell coordinate … … 512 539 * @return psPlane* the resulting cell coordinate 513 540 */ 514 psPlane* psCoordSkyToCell(541 /*psPlane* psCoordSkyToCell( 515 542 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 516 543 const psSphere* in, ///< the Sky coordinate … … 519 546 const psCell* cell ///< the cell of interest 520 547 ); 548 */ 521 549 522 550 /** Translate a sky coordinate into a cell coordinate using a 'quick and … … 525 553 * @return psPlane* the resulting cell coordinate 526 554 */ 527 psPlane* psCoordSkyToCellQuick(555 /*psPlane* psCoordSkyToCellQuick( 528 556 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 529 557 const psSphere* in, ///< the Sky coordinate 530 558 const psCell* cell ///< the cell of interest 531 559 ); 532 560 */ 533 561 534 562 #endif // #ifndef PS_ASTROMETRY_H -
trunk/psModules/test/tst_pmImageCombine.c
r4291 r4579 9 9 * XXX: Must verify the results internally. Don't use stdout file. 10 10 * 11 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-16 23:13:43$11 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-19 01:44:48 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 266 266 267 267 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", 269 269 questionablePixels->n, numImages); 270 270 testStatus = true; … … 313 313 for (psS32 i = 0 ; i < pixelRejects->n ; i++) { 314 314 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); 316 316 317 317 for (psS32 p = 0 ; p < myPixels->n ; p++) { -
trunk/psModules/test/tst_pmImageSubtract.c
r4418 r4579 10 10 * data. More work need to be done to verify the results. 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-28 23:28:18 $12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-19 01:44:48 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 337 337 // Create a test image and set a single pixel in the center of each stamp. 338 338 psImage *tstImg = psImageAlloc(numCols, numRows, PS_TYPE_F32); 339 psS32numStamps = 0;339 int numStamps = 0; 340 340 PS_IMAGE_SET_F32(tstImg, 0.0); 341 341 for (psS32 j = 0; j < yNum; j++) { … … 407 407 } else { 408 408 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", 410 410 stamps->n, numStamps); 411 411 testStatus = true; … … 443 443 } else { 444 444 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", 446 446 stamps->n, numStamps); 447 447 testStatus = true; -
trunk/psModules/test/tst_pmObjects01.c
r4221 r4579 19 19 * abd never deallocate, no error is generated. 20 20 * 21 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $22 * @date $Date: 2005-0 6-13 19:59:21$21 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-07-19 01:44:48 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 128 128 } else { 129 129 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", 131 131 tmpModel->params->n, tmpModel->dparams->n); 132 132 testStatus = false; … … 150 150 } else { 151 151 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", 153 153 tmpModel->params->n, tmpModel->dparams->n); 154 154 testStatus = false; … … 172 172 } else { 173 173 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", 175 175 tmpModel->params->n, tmpModel->dparams->n); 176 176 testStatus = false; … … 194 194 } else { 195 195 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", 197 197 tmpModel->params->n, tmpModel->dparams->n); 198 198 testStatus = false; … … 216 216 } else { 217 217 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", 219 219 tmpModel->params->n, tmpModel->dparams->n); 220 220 testStatus = false; … … 238 238 } else { 239 239 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", 241 241 tmpModel->params->n, tmpModel->dparams->n); 242 242 testStatus = false; … … 290 290 } else { 291 291 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); 293 293 testStatus = false; 294 294 } … … 316 316 317 317 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); 319 319 testStatus = false; 320 320 } … … 344 344 345 345 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); 347 347 testStatus = false; 348 348 } … … 370 370 371 371 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); 373 373 testStatus = false; 374 374 } … … 398 398 399 399 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); 401 401 testStatus = false; 402 402 } … … 423 423 424 424 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); 426 426 testStatus = false; 427 427 } … … 477 477 478 478 /****************************************************************************** 479 test02(): 479 test02(): 480 480 // XXX: Must test flat peaks. 481 481 // XXX: test 1-by-n and n-by-1 images. … … 539 539 } 540 540 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); 542 542 testStatus = false; 543 543 } … … 681 681 /* XXX: Modify for new pmCullPeaks 682 682 outData = pmCullPeaks(outData, PS_MAX_F32, NULL); 683 683 684 684 if (outData == NULL) { 685 685 printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n"); … … 702 702 printf("Calling pmCullPeaks with tiny maxValue and NULL psRegion.\n"); 703 703 outData = pmFindImagePeaks(imgData, 0.0); 704 printf("pmFindImagePeaks found % d peaks\n", outData->n);704 printf("pmFindImagePeaks found %ld peaks\n", outData->n); 705 705 /* XXX: Modify for new pmCullPeaks 706 706 outData = pmCullPeaks(outData, 0.0, NULL); 707 707 708 708 if (outData == NULL) { 709 709 printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n"); … … 726 726 printf("Calling pmCullPeaks with large maxValue and disjoint psRegion.\n"); 727 727 outData = pmFindImagePeaks(imgData, 0.0); 728 printf("pmFindImagePeaks found % d peaks\n", outData->n);728 printf("pmFindImagePeaks found %ld peaks\n", outData->n); 729 729 psRegion tmpRegion = psRegionSet(10000.0, 20000.0, 10000.0, 20000.0); 730 730 731 731 /* XXX: Modify for new pmCullPeaks 732 732 outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion); 733 733 734 734 if (outData == NULL) { 735 735 printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n"); … … 752 752 printf("Calling pmCullPeaks with large maxValue and non-disjoint psRegion.\n"); 753 753 outData = pmFindImagePeaks(imgData, 0.0); 754 printf("pmFindImagePeaks found % d peaks\n", outData->n);754 printf("pmFindImagePeaks found %ld peaks\n", outData->n); 755 755 tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32); 756 756 /* XXX: Modify for new pmCullPeaks 757 757 outData = pmCullPeaks(outData, PS_MAX_F32, tmpRegion); 758 758 759 759 if (outData == NULL) { 760 760 printf("TEST ERROR: pmCullPeaks() returned a non-NULL psList.\n"); … … 1145 1145 testStatus = false; 1146 1146 } 1147 1147 1148 1148 printf("----------------------------------------------------------------------------------\n"); 1149 1149 printf("Calling pmSourceSetPixelsCircle with subImage endCol > numCols. Should generate error and return NULL.\n"); … … 1156 1156 testStatus = false; 1157 1157 } 1158 1158 1159 1159 printf("----------------------------------------------------------------------------------\n"); 1160 1160 printf("Calling pmSourceSetPixelsCircle with subImage startRow < 0. Should generate error and return NULL.\n"); … … 1167 1167 testStatus = false; 1168 1168 } 1169 1169 1170 1170 printf("----------------------------------------------------------------------------------\n"); 1171 1171 printf("Calling pmSourceSetPixelsCircle with subImage endRow > numRows. Should generate error and return NULL.\n"); -
trunk/psModules/test/verified/tst_pmImageCombine.stderr
r4219 r4579 24 24 ---> TESTPOINT PASSED (Test Point Driver{pmCombineImages()} | tst_pmImageCombine.c) 25 25 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 1 1 Testing pmCombineImages(10, 10, 5) 2 Generating a bad pixel in image (1) at (0, 8) 3 Generating a bad pixel in image (3) at (7, 5) 4 Generating a bad pixel in image (1) at (1, 2) 5 Generating a bad pixel in image (2) at (9, 9) 6 Generating a bad pixel in image (1) at (3, 9) 7 Generating a bad pixel in image (2) at (0, 5) 8 Generating a bad pixel in image (1) at (4, 5) 9 Generating a bad pixel in image (1) at (3, 8) 10 Generating a bad pixel in image (2) at (6, 2) 11 Generating a bad pixel in image (2) at (3, 7) 2 12 Calling with a NULL images. Should generate error, return NULL. 3 13 Calling with a long images. Should generate error, return NULL. … … 19 29 Image 2, questionable pixel 3 is (3 7) 20 30 Image 3, questionable pixel 0 is (7 5) 21 Testing pmRejectPixels(10, 10, 5, 1.000000, 1.000000) 31 32 33 34 Calling pmRejectPixels() with acceptable data. Should generate a psArray. 35 tst_pmImageCombine.c: Image 0 had 0 rejects. 36 tst_pmImageCombine.c: Image 1 had 4 rejects. 37 Image 1, rejected pixel 0 is (0 8) 38 Image 1, rejected pixel 1 is (1 2) 39 Image 1, rejected pixel 2 is (4 5) 40 Image 1, rejected pixel 3 is (3 8) 41 tst_pmImageCombine.c: Image 2 had 3 rejects. 42 Image 2, rejected pixel 0 is (0 5) 43 Image 2, rejected pixel 1 is (6 2) 44 Image 2, rejected pixel 2 is (3 7) 45 tst_pmImageCombine.c: Image 3 had 1 rejects. 46 Image 3, rejected pixel 0 is (7 5) 47 tst_pmImageCombine.c: Image 4 had 0 rejects. -
trunk/psModules/test/verified/tst_pmImageSubtract.stderr
r4200 r4579 23 23 \**********************************************************************************/ 24 24 25 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)25 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 26 26 Unallowable operation: psImage image or its data is NULL. 27 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)27 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 28 28 Error: xNum is 0 or less. 29 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)29 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 30 30 Error: yNum is 0 or less. 31 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)31 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 32 32 Error: border is 0 or less. 33 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)33 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 34 34 Unallowable operation: psImage image or its data is NULL. 35 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)35 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 36 36 Error: xNum is 0 or less. 37 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)37 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 38 38 Error: yNum is 0 or less. 39 < DATE><TIME>|<HOST>|E|pmSubtractionFindStamps (FILE:LINENO)39 <HOST>|E|pmSubtractionFindStamps (FILE:LINENO) 40 40 Error: border is 0 or less. 41 41 … … 48 48 \**********************************************************************************/ 49 49 50 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)50 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 51 51 Unallowable operation: stamps is NULL. 52 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)52 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 53 53 Unallowable operation: psImage reference or its data is NULL. 54 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)54 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 55 55 Unallowable operation: psImage input or its data is NULL. 56 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)56 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 57 57 Unallowable operation: kernels is NULL. 58 < DATE><TIME>|<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)58 <HOST>|E|pmSubtractionSolveEquation (FILE:LINENO) 59 59 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) 69 61 Unallowable operation: psVector solution or its data is NULL. 70 < DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)62 <HOST>|E|pmSubtractionKernelImage (FILE:LINENO) 71 63 Unallowable operation: kernels is NULL. 72 < DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)64 <HOST>|E|pmSubtractionKernelImage (FILE:LINENO) 73 65 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) 75 67 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) 77 69 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) 79 71 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) 81 73 Unallowable operation: stamps is NULL. 82 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)74 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 83 75 Unallowable operation: psImage reference or its data is NULL. 84 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)76 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 85 77 Unallowable operation: psImage input or its data is NULL. 86 < DATE><TIME>|<HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO)78 <HOST>|E|pmSubtractionCalculateEquation (FILE:LINENO) 87 79 Unallowable operation: kernels is NULL. 88 < DATE><TIME>|<HOST>|E|pmSubtractionSolveEquation (FILE:LINENO)80 <HOST>|E|pmSubtractionSolveEquation (FILE:LINENO) 89 81 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) 99 83 Unallowable operation: psVector solution or its data is NULL. 100 < DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)84 <HOST>|E|pmSubtractionKernelImage (FILE:LINENO) 101 85 Unallowable operation: kernels is NULL. 102 < DATE><TIME>|<HOST>|E|pmSubtractionKernelImage (FILE:LINENO)86 <HOST>|E|pmSubtractionKernelImage (FILE:LINENO) 103 87 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) 105 89 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) 107 91 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) 109 93 Error: y, 2.000000, is out of range. Must be between -1.000000 and 1.000000. 110 94 -
trunk/psModules/test/verified/tst_pmImageSubtract.stdout
r4200 r4579 2 2 Testing pmSubtractionKernelsAllocPOIS(2, 3) 3 3 Testing 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)8 4 Testing pmSubtractionFindStamps(100, 100, 2, 2, 2) 9 5 Calling with a NULL psImage. Should generate error, return NULL. … … 21 17 Calling with acceptable input parameters, NULL mask. 22 18 Testing pmSubtractionCalculateEquation(): 23 image size is ( 100, 100)24 num stamps is (2, 2). Border is 319 image size is (25, 25) 20 num stamps is (2, 2). Border is 2 25 21 kernel type is PM_SUBTRACTION_KERNEL_POIS. 26 22 Generating stamps... … … 32 28 Calling with acceptable input parameters. Should return TRUE. 33 29 Calling 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. 30 Calling pmSubtractionSolveEquation() with acceptable input parameters. Should return non-NULL. 31 The 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) 33 Calling pmSubtractionRejectStamps() with acceptable input parameters. Should return TRUE. 36 34 Calling pmSubtractionKernelImage() with NULL solution. Should generate error, return NULL. 37 35 Calling pmSubtractionKernelImage() with NULL kernels. Should generate error, return NULL. … … 40 38 Calling pmSubtractionKernelImage() unallowable y value. Should generate error, return NULL. 41 39 Calling pmSubtractionKernelImage() unallowable y value. Should generate error, return NULL. 42 Calling with pmSubtractionKernelImage() acceptable input parameters. Should return a psImage. 40 Calling 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 43 0.008820 0.015628 1.495404 -0.021095 -0.009788 44 0.003371 -0.001256 0.017835 0.003308 0.008175 45 0.009877 -0.010686 0.014775 0.003368 0.006204 43 46 Testing pmSubtractionCalculateEquation(): 44 image size is ( 100, 100)45 num stamps is (2, 2). Border is 347 image size is (25, 25) 48 num stamps is (2, 2). Border is 2 46 49 kernel type is PM_SUBTRACTION_KERNEL_ISIS. 47 50 Generating stamps... … … 53 56 Calling with acceptable input parameters. Should return TRUE. 54 57 Calling 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. 58 Calling pmSubtractionSolveEquation() with acceptable input parameters. Should return non-NULL. 59 The 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) 61 Calling pmSubtractionRejectStamps() with acceptable input parameters. Should return TRUE. 57 62 Calling pmSubtractionKernelImage() with NULL solution. Should generate error, return NULL. 58 63 Calling pmSubtractionKernelImage() with NULL kernels. Should generate error, return NULL. … … 61 66 Calling pmSubtractionKernelImage() unallowable y value. Should generate error, return NULL. 62 67 Calling pmSubtractionKernelImage() unallowable y value. Should generate error, return NULL. 63 Calling with pmSubtractionKernelImage() acceptable input parameters. Should return a psImage. 68 Calling pmSubtractionKernelImage() with acceptable input parameters. Should return a psImage. 69 0.031614 0.045997 0.052122 0.045997 0.031614 70 0.045997 0.066926 0.075837 0.066926 0.045997 71 0.052122 0.075837 0.085934 0.075837 0.052122 72 0.045997 0.066926 0.075837 0.066926 0.045997 73 0.031614 0.045997 0.052122 0.045997 0.031614
Note:
See TracChangeset
for help on using the changeset viewer.
