Changeset 15039
- Timestamp:
- Sep 26, 2007, 5:35:29 PM (19 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 1 added
- 7 edited
-
Makefile.am (modified) (1 diff)
-
pmPeaks.c (modified) (4 diffs)
-
pmPeaks.h (modified) (3 diffs)
-
pmSource.c (modified) (4 diffs)
-
pmSource.h (modified) (4 diffs)
-
pmSourceIO.c (modified) (3 diffs)
-
pmSourceIO.h (modified) (3 diffs)
-
pmSourceIO_PS1_DEV_1.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/Makefile.am
r14938 r15039 23 23 pmSourceIO_SMPDATA.c \ 24 24 pmSourceIO_PS1_DEV_0.c \ 25 pmSourceIO_PS1_DEV_1.c \ 25 26 pmSourcePlots.c \ 26 27 pmSourcePlotPSFModel.c \ -
trunk/psModules/src/objects/pmPeaks.c
r14652 r15039 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 8-24 00:11:02$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-09-27 03:35:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 51 51 52 52 // calculate peak position relative to ix,iy 53 // XXX these functions need to take a mask, weight, and calculate the errors 53 54 psPolynomial2D *bicube = psImageBicubeFit (image, ix + image->col0, iy + image->row0); 54 55 psPlane min = psImageBicubeMin (bicube); … … 59 60 peak->xf = min.x + ix + image->col0; 60 61 peak->yf = min.y + iy + image->row0; 62 peak->dx = 0.0; 63 peak->dy = 0.0; 61 64 } else { 62 65 peak->xf = ix; 63 66 peak->yf = iy; 67 peak->dx = 1.0; 68 peak->dy = 1.0; 64 69 } 65 70 … … 189 194 } 190 195 psTrace("psModules.objects", 3, "---- %s(0) end ----\n", __func__); 196 return (0); 197 } 198 199 // sort by SN (descending) 200 int pmPeakSortBySN (const void **a, const void **b) 201 { 202 pmPeak *A = *(pmPeak **)a; 203 pmPeak *B = *(pmPeak **)b; 204 205 psF32 fA = A->SN; 206 psF32 fB = B->SN; 207 if (isnan (fA)) fA = 0; 208 if (isnan (fB)) fB = 0; 209 210 psF32 diff = fA - fB; 211 if (diff > FLT_EPSILON) return (-1); 212 if (diff < FLT_EPSILON) return (+1); 213 return (0); 214 } 215 216 // sort by Y (ascending) 217 int pmPeakSortByY (const void **a, const void **b) 218 { 219 pmPeak *A = *(pmPeak **)a; 220 pmPeak *B = *(pmPeak **)b; 221 222 psF32 fA = A->y; 223 psF32 fB = B->y; 224 225 psF32 diff = fA - fB; 226 if (diff > FLT_EPSILON) return (+1); 227 if (diff < FLT_EPSILON) return (-1); 191 228 return (0); 192 229 } -
trunk/psModules/src/objects/pmPeaks.h
r14652 r15039 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2007-0 8-24 00:11:02$12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2007-09-27 03:35:29 $ 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 15 */ … … 53 53 float xf; ///< bicube fit to peak coord (x) 54 54 float yf; ///< bicube fit to peak coord (y) 55 float dx; ///< bicube fit error on peak coord (x) 56 float dy; ///< bicube fit error on peak coord (y) 55 57 float value; ///< level in detection image 56 58 float flux; ///< level in unsmoothed sci image … … 148 150 int pmPeaksCompareDescend (const void **a, const void **b); 149 151 152 int pmPeakSortBySN (const void **a, const void **b); 153 int pmPeakSortByY (const void **a, const void **b); 154 150 155 /// @} 151 156 # endif /* PM_PEAKS_H */ -
trunk/psModules/src/objects/pmSource.c
r14950 r15039 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-09-2 1 00:21:57$8 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-09-27 03:35:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 87 87 pmSource *source = (pmSource *) psAlloc(sizeof(pmSource)); 88 88 *(int *)&source->id = id++; 89 source->seq = -1; 89 90 source->peak = NULL; 90 91 source->pixels = NULL; … … 111 112 source->skyErr = NAN; 112 113 source->pixWeight = NAN; 114 115 source->psfProb = NAN; 116 source->crNsigma = NAN; 117 source->extNsigma = NAN; 113 118 114 119 psTrace("psModules.objects", 5, "---- end ----\n"); … … 930 935 return NULL; 931 936 } 937 938 // sort by SN (descending) 939 int pmSourceSortBySN (const void **a, const void **b) 940 { 941 pmSource *A = *(pmSource **)a; 942 pmSource *B = *(pmSource **)b; 943 944 psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN; 945 psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN; 946 if (isnan (fA)) fA = 0; 947 if (isnan (fB)) fB = 0; 948 949 psF32 diff = fA - fB; 950 if (diff > FLT_EPSILON) return (-1); 951 if (diff < FLT_EPSILON) return (+1); 952 return (0); 953 } 954 955 // sort by Y (ascending) 956 int pmSourceSortByY (const void **a, const void **b) 957 { 958 pmSource *A = *(pmSource **)a; 959 pmSource *B = *(pmSource **)b; 960 961 psF32 fA = (A->peak == NULL) ? 0 : A->peak->y; 962 psF32 fB = (B->peak == NULL) ? 0 : B->peak->y; 963 964 psF32 diff = fA - fB; 965 if (diff > FLT_EPSILON) return (+1); 966 if (diff < FLT_EPSILON) return (-1); 967 return (0); 968 } 969 -
trunk/psModules/src/objects/pmSource.h
r14652 r15039 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-0 8-24 00:11:02$5 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-09-27 03:35:29 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 59 59 struct pmSource { 60 60 const int id; ///< Unique ID for object 61 int seq; ///< ID for output (generated on write) 61 62 pmPeak *peak; ///< Description of peak pixel. 62 63 psImage *pixels; ///< Rectangular region including object pixels. … … 78 79 float apMag; ///< apMag corresponding to psfMag or extMag (depending on type) 79 80 float pixWeight; ///< model-weighted coverage of valid pixels 81 float psfProb; ///< probability of PSF 82 float crNsigma; ///< Nsigma deviation from PSF to CR 83 float extNsigma; ///< Nsigma deviation from PSF to EXT 80 84 psRegion region; ///< area on image covered by selected pixels 81 85 float sky, skyErr; ///< The sky and its error at the center of the object … … 223 227 bool pmSourceCachePSF (pmSource *source, psMaskType maskVal); 224 228 229 int pmSourceSortBySN (const void **a, const void **b); 230 int pmSourceSortByY (const void **a, const void **b); 231 225 232 /// @} 226 233 # endif /* PM_SOURCE_H */ -
trunk/psModules/src/objects/pmSourceIO.c
r14938 r15039 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-09-2 1 00:09:05$5 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-09-27 03:35:29 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 388 388 status = pmSourcesWrite_PS1_DEV_0 (file->fits, sources, file->header, outhead, dataname); 389 389 } 390 if (!strcmp (exttype, "PS1_DEV_1")) { 391 status = pmSourcesWrite_PS1_DEV_1 (file->fits, sources, file->header, outhead, dataname); 392 } 390 393 391 394 if (!status) { … … 708 711 sources = pmSourcesRead_PS1_DEV_0 (file->fits, hdu->header); 709 712 } 713 if (!strcmp (exttype, "PS1_DEV_1")) { 714 sources = pmSourcesRead_PS1_DEV_1 (file->fits, hdu->header); 715 } 710 716 711 717 psTrace("psModules.objects", 6, "read CMF table from %s : %s : %s", file->filename, headname, dataname); -
trunk/psModules/src/objects/pmSourceIO.h
r14208 r15039 4 4 * @author EAM, IfA; GLG, MHPCC 5 5 * 6 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 7-14 03:20:44$6 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-09-27 03:35:29 $ 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 9 9 * … … 26 26 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 27 27 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 28 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 28 29 29 30 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); … … 33 34 psArray *pmSourcesRead_SMPDATA (psFits *fits, psMetadata *header); 34 35 psArray *pmSourcesRead_PS1_DEV_0 (psFits *fits, psMetadata *header); 36 psArray *pmSourcesRead_PS1_DEV_1 (psFits *fits, psMetadata *header); 35 37 36 38 bool pmSourcesWritePSFs (psArray *sources, char *filename);
Note:
See TracChangeset
for help on using the changeset viewer.
