Changeset 6864
- Timestamp:
- Apr 17, 2006, 7:10:08 AM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src
- Files:
-
- 8 edited
-
astrom/pmFPAfile.c (modified) (1 diff)
-
objects/models/pmModel_QGAUSS.c (modified) (1 diff)
-
objects/pmSourceIO.c (modified) (2 diffs)
-
objects/pmSourceIO_CMF.c (modified) (2 diffs)
-
objects/pmSourceIO_CMP.c (modified) (4 diffs)
-
objects/pmSourceIO_RAW.c (modified) (2 diffs)
-
objects/pmSourcePhotometry.c (modified) (7 diffs)
-
objects/pmSourcePhotometry.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmFPAfile.c
r6859 r6864 245 245 bool status; 246 246 char *extra; 247 char *mode ;247 char *mode = NULL; 248 248 char *readMode = "r"; 249 249 char *writeMode = "w"; -
branches/rel10_ifa/psModules/src/objects/models/pmModel_QGAUSS.c
r6712 r6864 123 123 // the area needs to be multiplied by the integral of f(z) 124 124 norm = 0.0; 125 for (z = 0.0 05; z < 50; z += 0.01) {125 for (z = 0.05; z < 50; z += 0.1) { 126 126 f = 1.0 / (1 + PAR[7]*z + pow(z, 2.25)); 127 127 // test: f = 1.0 / (1 + PAR[7]*z + PS_SQR(z)); 128 128 norm += f; 129 129 } 130 norm *= 0. 01;130 norm *= 0.1; 131 131 132 132 psF64 Flux = PAR[1] * Area * norm; -
branches/rel10_ifa/psModules/src/objects/pmSourceIO.c
r6859 r6864 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 326 326 327 327 bool status; 328 psArray *sources ;328 psArray *sources = NULL; 329 329 pmHDU *hdu; 330 330 -
branches/rel10_ifa/psModules/src/objects/pmSourceIO_CMF.c
r6859 r6864 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 6$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.7 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 89 89 psMetadataAdd (header, PS_LIST_HEAD, "EXTNAME", PS_DATA_STRING | PS_META_REPLACE, "extension name", extname); 90 90 91 // XXX this is broken : does not write the existing header elements except EXTNAME 91 92 psFitsWriteTable (fits, header, table); 92 93 psTrace ("pmFPAfile", 5, "wrote ext data %s\n", extname); -
branches/rel10_ifa/psModules/src/objects/pmSourceIO_CMP.c
r6859 r6864 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 5$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.6 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 psMetadataItem *mdi; 38 38 psF32 *PAR, *dPAR; 39 float dmag, lsky;39 float lsky = 0; 40 40 bool status; 41 41 psEllipseShape shape; … … 99 99 psLineAdd (line, "%6.1f ", PAR[3]); 100 100 psLineAdd (line, "%6.3f ", PS_MIN (99.0, source->psfMag + ZERO_POINT)); 101 psLineAdd (line, "%03d ", PS_MIN (999, (int)(1000* dmag)));101 psLineAdd (line, "%03d ", PS_MIN (999, (int)(1000*source->errMag))); 102 102 psLineAdd (line, "%2d ", type); 103 103 psLineAdd (line, "%3.1f ", lsky); … … 249 249 return (sources); 250 250 } 251 252 # if (0)253 PAR = model->params->data.F32;254 dPAR = model->dparams->data.F32;255 256 dmag = dPAR[1] / PAR[1];257 type = pmSourceDophotType (source);258 lsky = (PAR[0] < 1.0) ? 0.0 : log10(PAR[0]);259 260 psLineInit (line);261 psLineAdd (line, "%6.1f ", PAR[2]);262 psLineAdd (line, "%6.1f ", PAR[3]);263 psLineAdd (line, "%6.3f ", PS_MIN (99.999, source->fitMag + ZERO_POINT));264 psLineAdd (line, "%03d ", PS_MIN (999, (int)(1000*dmag)));265 psLineAdd (line, "%2d ", type);266 psLineAdd (line, "%3.1f ", lsky);267 psLineAdd (line, "%6.3f ", 99.999); // should be 'Mgal268 psLineAdd (line, "%6.3f ", PS_MIN (99.999, source->apMag + ZERO_POINT));269 psLineAdd (line, "%6.2f ", PAR[4]); // should be 'FHWM x'270 psLineAdd (line, "%6.2f ", PAR[5]); // should be 'FHWM y'271 psLineAdd (line, "%5.1f\n", 0); // should be theta272 273 # endif -
branches/rel10_ifa/psModules/src/objects/pmSourceIO_RAW.c
r6859 r6864 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 5$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.6 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 130 130 if (source->type != PM_SOURCE_TYPE_EXTENDED) 131 131 continue; 132 model = pmSourceMagnitudes (source, NULL, false, false); 132 133 model = source->modelEXT; 133 134 if (model == NULL) 134 135 continue; -
branches/rel10_ifa/psModules/src/objects/pmSourcePhotometry.c
r6859 r6864 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 56 56 57 57 // XXX EAM : masked region should be (optionally) elliptical 58 // XXX curve of growth is corrected to 59 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, bool growthCorr, bool apTrendCorr) 60 { 61 62 int status; 58 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode) 59 { 60 61 int status = false; 63 62 bool isPSF; 64 63 float x, y; … … 67 66 pmModel *model; 68 67 68 source->psfMag = 99.0; 69 source->extMag = 99.0; 70 source->errMag = 99.0; 71 source->apMag = 99.0; 72 69 73 switch (source->type) { 70 74 case PM_SOURCE_TYPE_STAR: 71 75 model = source->modelPSF; 72 76 if (model == NULL) 73 return NULL;77 return false; 74 78 isPSF = true; 75 79 break; … … 78 82 model = source->modelEXT; 79 83 if (model == NULL) 80 return NULL;84 return false; 81 85 isPSF = false; 82 86 break; 83 87 84 88 default: 85 return NULL;89 return false; 86 90 } 87 91 … … 96 100 y = model->params->data.F32[3]; 97 101 102 // measure object model photometry 103 status = pmSourcePhotometryModel (&source->psfMag, source->modelPSF); 104 status = pmSourcePhotometryModel (&source->extMag, source->modelEXT); 105 // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS 106 if ((mode & PM_SOURCE_PHOT_APCORR) && isPSF && psf) { 107 // convert to the equivalent 2D model? 108 source->psfMag += psPolynomial4DEval (psf->ApTrend, x, y, 0.0, 0.0); 109 } 110 111 if (SN < AP_MIN_SN) 112 return false; 113 98 114 // replace source flux 99 115 // XXX test to see if source has been subtracted? … … 103 119 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "OR", PM_SOURCE_MASK_MARKED); 104 120 105 // measure object model photometry106 status = pmSourcePhotometryModel (&source->psfMag, source->modelPSF);107 status = pmSourcePhotometryModel (&source->extMag, source->modelEXT);108 109 121 // measure the weight of included pixels 110 status = pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->mask); 122 if (mode & PM_SOURCE_PHOT_WEIGHT) { 123 pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->mask); 124 } 111 125 112 126 // measure object aperture photometry 113 if (SN > AP_MIN_SN) { 114 status = pmSourcePhotometryAper (&source->apMag, model, source->pixels, source->mask); 115 } else { 116 source->apMag = 99.0; 117 } 127 status = pmSourcePhotometryAper (&source->apMag, model, source->pixels, source->mask); 118 128 119 129 // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS 120 if (isPSF && (psf != NULL)) { 121 if (SN > AP_MIN_SN) { 122 if ((psf->growth != NULL) && growthCorr) { 123 source->apMag += pmGrowthCurveCorrect (psf->growth, model->radiusTMP); 124 } 125 if (apTrendCorr) { 126 rflux = pow (10.0, 0.4*source->psfMag); 127 source->apMag -= PS_SQR(model->radiusTMP)*rflux * psf->skyBias + psf->skySat / rflux; 128 } 129 } 130 if (apTrendCorr) { 131 source->psfMag += psPolynomial4DEval (psf->ApTrend, x, y, 0.0, 0.0); 130 if (status && isPSF && psf) { 131 if (psf->growth && (mode & PM_SOURCE_PHOT_GROWTH)) { 132 source->apMag += pmGrowthCurveCorrect (psf->growth, model->radiusTMP); 133 } 134 if (mode & PM_SOURCE_PHOT_APCORR) { 135 rflux = pow (10.0, 0.4*source->psfMag); 136 source->apMag -= PS_SQR(model->radiusTMP)*rflux * psf->skyBias + psf->skySat / rflux; 132 137 } 133 138 } … … 139 144 pmModelSub (source->pixels, source->mask, model, false, false); 140 145 141 if (!status) 142 return NULL; 143 return model; 146 return status; 144 147 } 145 148 -
branches/rel10_ifa/psModules/src/objects/pmSourcePhotometry.h
r6859 r6864 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04-1 4 21:43:59$5 * @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-17 17:10:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 * 26 26 */ 27 28 typedef enum { 29 PM_SOURCE_PHOT_NONE = 0x0000, 30 PM_SOURCE_PHOT_GROWTH = 0x0001, 31 PM_SOURCE_PHOT_APCORR = 0x0002, 32 PM_SOURCE_PHOT_WEIGHT = 0x0004, 33 } pmSourcePhotometryMode; 34 27 35 bool pmSourcePhotometryModel( 28 36 float *fitMag, ///< integrated fit magnitude … … 37 45 ); 38 46 39 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, bool growthCorr, bool apTrendCorr); 47 bool pmSourceMagnitudesInit (psMetadata *config); 48 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode); 40 49 float pmSourceCrossProduct (pmSource *Mi, pmSource *Mj); 41 50 float pmSourceCrossWeight (pmSource *Mi, pmSource *Mj);
Note:
See TracChangeset
for help on using the changeset viewer.
