Changeset 6899
- Timestamp:
- Apr 18, 2006, 8:31:55 PM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src
- Files:
-
- 11 edited
-
astrom/Makefile.am (modified) (4 diffs)
-
astrom/pmReadout.c (modified) (1 diff)
-
detrend/pmMaskBadPixels.c (modified) (2 diffs)
-
detrend/pmMaskBadPixels.h (modified) (2 diffs)
-
objects/models/pmModel_QGAUSS.c (modified) (3 diffs)
-
objects/pmModelGroup.c (modified) (1 diff)
-
objects/pmPSFtry.c (modified) (5 diffs)
-
objects/pmSource.c (modified) (6 diffs)
-
objects/pmSource.h (modified) (3 diffs)
-
objects/pmSourcePhotometry.c (modified) (4 diffs)
-
objects/pmSourceSky.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/Makefile.am
r6859 r6899 7 7 pmFPAConstruct.c \ 8 8 pmFPACopy.c \ 9 pmFPAMaskWeight.c \10 9 pmFPARead.c \ 11 10 pmFPAUtils.c \ … … 22 21 pmFPAfile.c 23 22 23 # pmFPAMaskWeight.c \ 24 24 # pmFPAAstrometry.c 25 25 # pmAstrometryObjects.c … … 31 31 pmFPAConstruct.h \ 32 32 pmFPACopy.h \ 33 pmFPAMaskWeight.h \34 33 pmFPARead.h \ 35 34 pmFPAUtils.h \ … … 46 45 pmFPAfile.h 47 46 47 # pmFPAMaskWeight.h \ 48 48 # pmFPAAstrometry.h 49 49 # pmAstrometryObjects.h -
branches/rel10_ifa/psModules/src/astrom/pmReadout.c
r6726 r6899 2 2 #include "pslib.h" 3 3 #include "pmFPA.h" 4 #include "pmMaskBadPixels.h" 4 5 #include "pmHDUUtils.h" 5 #include "pmFPAMaskWeight.h"6 6 7 7 // Get the bias images for a readout, using the CELL.BIASSEC -
branches/rel10_ifa/psModules/src/detrend/pmMaskBadPixels.c
r6554 r6899 24 24 * @author Ross Harman, MHPCC 25 25 * 26 * @version $Revision: 1.3.12. 2$ $Name: not supported by cvs2svn $27 * @date $Date: 2006-0 3-09 03:10:27$26 * @version $Revision: 1.3.12.3 $ $Name: not supported by cvs2svn $ 27 * @date $Date: 2006-04-19 06:31:55 $ 28 28 * 29 29 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 148 148 /* Pixels which satisfy growVal and within the grow radius shall be masked */ \ 149 149 if(mask->data.PS_TYPE_MASK_DATA[j][i] & growVal) { \ 150 rowMin = MAX(j-grow, 0); \151 rowMax = MIN(j+grow+1, inImage->numRows); \152 colMin = MAX(i-grow, 0); \153 colMax = MIN(i+grow+1, inImage->numCols); \150 rowMin = PS_MAX(j-grow, 0); \ 151 rowMax = PS_MIN(j+grow+1, inImage->numRows); \ 152 colMin = PS_MAX(i-grow, 0); \ 153 colMax = PS_MIN(i+grow+1, inImage->numCols); \ 154 154 for(jj=rowMin; jj<rowMax; jj++) { \ 155 155 for(ii=colMin; ii<colMax; ii++) { \ -
branches/rel10_ifa/psModules/src/detrend/pmMaskBadPixels.h
r6448 r6899 24 24 * @author Ross Harman, MHPCC 25 25 * 26 * @version $Revision: 1.2.12. 1$ $Name: not supported by cvs2svn $27 * @date $Date: 2006-0 2-17 17:13:41$26 * @version $Revision: 1.2.12.2 $ $Name: not supported by cvs2svn $ 27 * @date $Date: 2006-04-19 06:31:55 $ 28 28 * 29 29 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 #include "pmFPA.h" 34 34 35 // these defines are necessary to yield 8-bit results (use instead of ~) 36 # define NOT_U8(A)(UCHAR_MAX-(A)) 37 # define NOT_U16(A)(USHORT_MAX-(A)) 38 35 39 /** Mask values */ 36 40 typedef enum { 37 PM_MASK_TRAP = 0x0001, ///< The pixel is a charge trap. 38 PM_MASK_BADCOL = 0x0002, ///< The pixel is a bad column. 39 PM_MASK_SAT = 0x0004, ///< The pixel is saturated. 40 PM_MASK_BAD = 0x0008, ///< The pixel is low 41 PM_MASK_FLAT = 0x0010 ///< The pixel is non-positive in the flat-field. 41 PM_MASK_CLEAR = 0x00, ///< The pixel is a charge trap. 42 PM_MASK_TRAP = 0x01, ///< The pixel is a charge trap. 43 PM_MASK_BADCOL = 0x02, ///< The pixel is a bad column. 44 PM_MASK_SAT = 0x04, ///< The pixel is saturated. 45 PM_MASK_BAD = 0x08, ///< The pixel is low 46 PM_MASK_FLAT = 0x10, ///< The pixel is non-positive in the flat-field. 47 PM_MASK_MARK = 0x20, ///< The pixel is marked as temporarily ignored 48 PM_MASK_EXT1 = 0x40, ///< This mask value is not used 49 PM_MASK_EXT2 = 0x80, ///< This mask value is not used 42 50 } pmMaskValue; 43 51 44 /** Macro to find maximum of two numbers */ 45 #define MAX(A,B)((A)>=(B)?(A):(B)) 46 47 /** Macro to find minimum of two numbers */ 48 #define MIN(A,B)((A)<=(B)?(A):(B)) 49 52 bool pmReadoutSetMask(pmReadout *readout // Readout for which to set mask 53 ); 54 bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight 55 ); 56 bool pmCellSetMaskWeight(pmCell *cell // Cell for which to set weights 57 ); 50 58 51 59 /** Execute bad pixels module. -
branches/rel10_ifa/psModules/src/objects/models/pmModel_QGAUSS.c
r6864 r6899 26 26 psF32 py = PAR[5]*Y; 27 27 psF32 z = 0.5*PS_SQR(px) + 0.5*PS_SQR(py) + PAR[6]*X*Y; 28 if (z <= 0) { 29 if (deriv) { 30 psF32 *dPAR = deriv->data.F32; 31 dPAR[0] = 0.0; 32 dPAR[1] = 0.0; 33 dPAR[2] = 0.0; 34 dPAR[3] = 0.0; 35 dPAR[4] = 0.0; 36 dPAR[5] = 0.0; 37 dPAR[6] = 0.0; 38 dPAR[7] = 0.0; 39 } 40 return(0.0); 41 } 42 28 43 psF32 zp = pow(z,1.25); 44 if (isnan(zp)) 45 psAbort ("psMinLMM", "nan in zp"); 29 46 30 47 psF32 r = 1.0 / (1 + PAR[7]*z + z*zp); 48 if (isnan(r)) 49 psAbort ("psMinLMM", "nan in r"); 50 31 51 // test: psF32 r = 1.0 / (1 + PAR[7]*z + PS_SQR(z)); 32 52 psF32 r1 = PAR[1]*r; … … 111 131 psF64 pmModelFlux_QGAUSS(const psVector *params) 112 132 { 113 float f, norm, z; 133 float z; 134 float norm; 114 135 115 136 psF32 *PAR = params->data.F32; … … 122 143 123 144 // the area needs to be multiplied by the integral of f(z) 145 // XXX this integral can be done faster and more accurately 124 146 norm = 0.0; 125 for (z = 0.05; z < 50; z += 0.1) { 147 148 # define DZ 0.1 149 150 # if 0 151 152 float f; 153 for (z = 0.5*DZ; z < 50; z += DZ) { 126 154 f = 1.0 / (1 + PAR[7]*z + pow(z, 2.25)); 127 155 // test: f = 1.0 / (1 + PAR[7]*z + PS_SQR(z)); 128 156 norm += f; 129 157 } 130 norm *= 0.1; 158 norm *= DZ; 159 # else 160 161 float f0 = 1.0; 162 float f1, f2; 163 for (z = DZ; z < 50; z += DZ) { 164 f1 = 1.0 / (1 + PAR[7]*z + pow(z, 2.25)); 165 z += DZ; 166 f2 = 1.0 / (1 + PAR[7]*z + pow(z, 2.25)); 167 norm += f0 + 4*f1 + f2; 168 f0 = f2; 169 } 170 norm *= DZ / 3.0; 171 # endif 131 172 132 173 psF64 Flux = PAR[1] * Area * norm; -
branches/rel10_ifa/psModules/src/objects/pmModelGroup.c
r6556 r6899 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.2.4. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.2.4.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-19 06:31:55 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
branches/rel10_ifa/psModules/src/objects/pmPSFtry.c
r6848 r6899 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.4.4. 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-04-1 3 06:18:46$7 * @version $Revision: 1.4.4.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-04-19 06:31:55 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 15 15 #include "pmHDU.h" 16 16 #include "pmFPA.h" 17 #include "pmMaskBadPixels.h" 17 18 #include "pmPeaks.h" 18 19 #include "pmMoments.h" … … 112 113 // fit model as EXT, not PSF 113 114 114 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_ SOURCE_MASK_MARKED);115 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_MASK_MARK); 115 116 status = pmSourceFitModel (source, model, PM_SOURCE_FIT_EXT); 116 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", ~PM_SOURCE_MASK_MARKED);117 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK)); 117 118 118 119 // exclude the poor fits … … 146 147 y = source->peak->y; 147 148 148 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_ SOURCE_MASK_MARKED);149 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_MASK_MARK); 149 150 status = pmSourceFitModel (source, modelPSF, PM_SOURCE_FIT_PSF); 150 151 … … 176 177 177 178 next_source: 178 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", ~PM_SOURCE_MASK_MARKED);179 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK)); 179 180 180 181 } -
branches/rel10_ifa/psModules/src/objects/pmSource.c
r6859 r6899 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1.2. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-04-1 4 21:43:59$8 * @version $Revision: 1.1.2.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-19 06:31:55 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 19 19 #include "pmHDU.h" 20 20 #include "pmFPA.h" 21 #include "pmMaskBadPixels.h" 21 22 #include "pmPeaks.h" 22 23 #include "pmMoments.h" … … 141 142 psTrace(__func__, 3, "---- %s() begin ----\n", __func__); 142 143 143 # define NPIX 10144 // XXX SCALE is the bin size in pixels for the PSF clump search 144 145 # define SCALE 0.1 145 146 … … 164 165 if (!status) 165 166 SY_MAX = 10.0; 167 psF32 AR_MAX = psMetadataLookupF32 (&status, metadata, "MOMENTS_AR_MAX"); 168 if (!status) 169 AR_MAX = 10.0; 170 psF32 AR_MIN = 1.0 / AR_MAX; 166 171 167 172 // construct a sigma-plane image … … 185 190 186 191 // Sx,Sy are limited at 0. a peak at 0,0 is artificial 187 if ((fabs(tmpSrc->moments->Sx) < FLT_EPSILON) && (fabs(tmpSrc->moments->Sy) < FLT_EPSILON)) { 192 if (fabs(tmpSrc->moments->Sx) < 0.05) { 193 continue; 194 } 195 if (fabs(tmpSrc->moments->Sy) < 0.05) { 196 continue; 197 } 198 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) > AR_MAX) { 199 continue; 200 } 201 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) < AR_MIN) { 188 202 continue; 189 203 } … … 341 355 // inner = psRegionForSquare (tmpSrc->peak->x - tmpSrc->mask->col0, tmpSrc->peak->y - tmpSrc->mask->row0, 2); 342 356 inner = psRegionForSquare (tmpSrc->peak->x, tmpSrc->peak->y, 2); 343 int Nsatpix = psImageCountPixelMask (tmpSrc->mask, inner, PM_ SOURCE_MASK_SATURATED);357 int Nsatpix = psImageCountPixelMask (tmpSrc->mask, inner, PM_MASK_SAT); 344 358 345 359 // saturated star (size consistent with PSF or larger) -
branches/rel10_ifa/psModules/src/objects/pmSource.h
r6859 r6899 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.4 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-19 06:31:55 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 * values with specific meanings that other functions can add to or define? 22 22 */ 23 24 /* 23 25 typedef enum { 24 26 PM_SOURCE_MASK_CLEAR = 0x00, … … 27 29 PM_SOURCE_MASK_MARKED = 0x08, 28 30 } psphotMaskValues; 31 */ 29 32 30 33 /** pmSourceType enumeration -
branches/rel10_ifa/psModules/src/objects/pmSourcePhotometry.c
r6864 r6899 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 5$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 7 17:10:08$5 * @version $Revision: 1.1.2.6 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-19 06:31:55 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 #include "pmHDU.h" 17 17 #include "pmFPA.h" 18 #include "pmMaskBadPixels.h" 18 19 #include "pmPeaks.h" 19 20 #include "pmMoments.h" … … 117 118 118 119 // set aperture mask circle to model radius 119 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "OR", PM_ SOURCE_MASK_MARKED);120 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "OR", PM_MASK_MARK); 120 121 121 122 // measure the weight of included pixels … … 139 140 140 141 // unmask aperture 141 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", ~PM_SOURCE_MASK_MARKED);142 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", NOT_U8(PM_MASK_MARK)); 142 143 143 144 // subtract object, leave local sky -
branches/rel10_ifa/psModules/src/objects/pmSourceSky.c
r6556 r6899 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-19 06:31:55 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 19 19 #include "pmHDU.h" 20 20 #include "pmFPA.h" 21 #include "pmMaskBadPixels.h" 21 22 #include "pmPeaks.h" 22 23 #include "pmMoments.h" … … 56 57 srcRegion = psRegionForImage(mask, srcRegion); 57 58 58 psImageMaskRegion(mask, srcRegion, "OR", PM_ SOURCE_MASK_MARKED);59 psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK); 59 60 psStats *myStats = psStatsAlloc(statsOptions); 60 61 myStats = psImageStats(myStats, image, mask, 0xff); 61 psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED); 62 psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_EXT2)); 63 62 64 63 65 psF64 tmpF64; … … 99 101 srcRegion = psRegionForImage(mask, srcRegion); 100 102 101 psImageMaskRegion(mask, srcRegion, "OR", PM_ SOURCE_MASK_MARKED);103 psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK); 102 104 psStats *myStats = psStatsAlloc(statsOptions); 103 105 myStats = psImageStats(myStats, image, mask, 0xff); 104 psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED);106 psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_MARK)); 105 107 106 108 psF64 tmpF64;
Note:
See TracChangeset
for help on using the changeset viewer.
