Changeset 34772 for branches/czw_branch/20120906/psModules
- Timestamp:
- Dec 6, 2012, 6:32:19 PM (14 years ago)
- Location:
- branches/czw_branch/20120906/psModules
- Files:
-
- 8 edited
- 1 copied
-
. (modified) (1 prop)
-
src/objects (modified) (1 prop)
-
src/objects/pmModel.c (modified) (1 diff)
-
src/objects/pmMoments.c (modified) (1 diff)
-
src/objects/pmSourceIO.c (modified) (7 diffs)
-
src/objects/pmSourceIO_CMF.c.in (modified) (12 diffs)
-
src/objects/pmSourceIO_CMF.txt (copied) (copied from trunk/psModules/src/objects/pmSourceIO_CMF.txt )
-
src/objects/pmSourceOutputs.c (modified) (1 diff)
-
src/objects/pmSourcePhotometry.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120905/psModules (added) merged: 34428,34451,34467,34568,34575,34730,34735,34747
- Property svn:mergeinfo changed
-
branches/czw_branch/20120906/psModules/src/objects
- Property svn:ignore
-
old new 7 7 pmSourceIO_CMF_PS1_V1.c 8 8 pmSourceIO_CMF_PS1_V2.c 9 pmSourceIO_CMF_PS1_V2.v1.c 9 10 pmSourceIO_CMF_PS1_V3.c 11 pmSourceIO_CMF_PS1_V3.v1.c 12 pmSourceIO_CMF_PS1_V1.v1.c 10 13 pmSourceIO_CMF_PS1_V4.c 11 14 pmSourceIO_CMF_PS1_SV1.c 15 pmSourceIO_CMF_PS1_SV2.c 12 16 pmSourceIO_CMF_PS1_DV1.c 13 17 pmSourceIO_CMF_PS1_DV2.c 18 pmSourceIO_CMF_PS1_DV3.c 19
-
- Property svn:ignore
-
branches/czw_branch/20120906/psModules/src/objects/pmModel.c
r31153 r34772 64 64 tmp->type = type; 65 65 tmp->mag = NAN; 66 tmp->magErr = NAN; 66 67 tmp->chisq = NAN; 67 68 tmp->chisqNorm = NAN; -
branches/czw_branch/20120906/psModules/src/objects/pmMoments.c
r32347 r34772 30 30 pmMoments *tmp = (pmMoments *) psAlloc(sizeof(pmMoments)); 31 31 32 tmp->Mrf = 0.0;33 tmp->Mrh = 0.0;32 tmp->Mrf = NAN; 33 tmp->Mrh = NAN; 34 34 35 tmp->KronCore = 0.0;36 tmp->KronCoreErr = 0.0;35 tmp->KronCore = NAN; 36 tmp->KronCoreErr = NAN; 37 37 38 tmp->KronFlux = 0.0;39 tmp->KronFluxErr = 0.0;38 tmp->KronFlux = NAN; 39 tmp->KronFluxErr = NAN; 40 40 41 tmp->KronFinner = 0.0;42 tmp->KronFouter = 0.0;41 tmp->KronFinner = NAN; 42 tmp->KronFouter = NAN; 43 43 44 tmp->KronFluxPSF = 0.0;45 tmp->KronFluxPSFErr = 0.0;46 tmp->KronRadiusPSF = 0.0;44 tmp->KronFluxPSF = NAN; 45 tmp->KronFluxPSFErr = NAN; 46 tmp->KronRadiusPSF = NAN; 47 47 48 tmp->Mx = 0.0;49 tmp->My = 0.0;48 tmp->Mx = NAN; 49 tmp->My = NAN; 50 50 51 tmp->Mxx = 0.0;52 tmp->Mxy = 0.0;53 tmp->Myy = 0.0;51 tmp->Mxx = NAN; 52 tmp->Mxy = NAN; 53 tmp->Myy = NAN; 54 54 55 tmp->Mxxx = 0.0;56 tmp->Mxxy = 0.0;57 tmp->Mxyy = 0.0;58 tmp->Myyy = 0.0;55 tmp->Mxxx = NAN; 56 tmp->Mxxy = NAN; 57 tmp->Mxyy = NAN; 58 tmp->Myyy = NAN; 59 59 60 tmp->Mxxxx = 0.0;61 tmp->Mxxxy = 0.0;62 tmp->Mxxyy = 0.0;63 tmp->Mxyyy = 0.0;64 tmp->Myyyy = 0.0;60 tmp->Mxxxx = NAN; 61 tmp->Mxxxy = NAN; 62 tmp->Mxxyy = NAN; 63 tmp->Mxyyy = NAN; 64 tmp->Myyyy = NAN; 65 65 66 tmp->Sum = 0.0;67 tmp->Peak = 0.0;68 tmp->Sky = 0.0;66 tmp->Sum = NAN; 67 tmp->Peak = NAN; 68 tmp->Sky = NAN; 69 69 tmp->nPixels = 0; 70 70 tmp->SN = 0; -
branches/czw_branch/20120906/psModules/src/objects/pmSourceIO.c
r34403 r34772 1028 1028 if (strcmp (xtension, "BINTABLE")) { 1029 1029 psWarning ("no binary table in extension %s, skipping\n", dataname); 1030 psFree(tableHeader); 1030 1031 return false; 1031 1032 } … … 1232 1233 { 1233 1234 if (!psFitsMoveExtNameClean (file->fits, xsrcname)) { 1234 ps Warning ("cannot find xsrc extension %s in %s, skipping", xsrcname, file->filename);1235 psTrace ("pmFPAfile", 1, "cannot find xsrc extension %s in %s, skipping", xsrcname, file->filename); 1235 1236 return false; 1236 1237 } … … 1242 1243 if (!xtension) psAbort("cannot read table type"); 1243 1244 if (strcmp (xtension, "BINTABLE")) { 1245 psFree(tableHeader); 1244 1246 psWarning ("no binary table in extension %s, skipping\n", xsrcname); 1245 1247 return false; … … 1270 1272 { 1271 1273 if (!psFitsMoveExtNameClean (file->fits, extname)) { 1272 ps Warning ("cannot find xfit extension %s in %s, skipping", extname, file->filename);1274 psTrace ("pmFPAfile", 1, "cannot find xfit extension %s in %s, skipping", extname, file->filename); 1273 1275 return false; 1274 1276 } … … 1281 1283 if (strcmp (xtension, "BINTABLE")) { 1282 1284 psWarning ("no binary table in extension %s, skipping\n", extname); 1285 psFree(tableHeader); 1283 1286 return false; 1284 1287 } … … 1307 1310 { 1308 1311 if (!psFitsMoveExtNameClean (file->fits, extname)) { 1309 ps Warning ("cannot find xrad extension %s in %s, skipping", extname, file->filename);1312 psTrace ("pmFPAfile", 1, "cannot find xrad extension %s in %s, skipping", extname, file->filename); 1310 1313 return false; 1311 1314 } … … 1318 1321 if (strcmp (xtension, "BINTABLE")) { 1319 1322 psWarning ("no binary table in extension %s, skipping\n", extname); 1323 psFree(tableHeader); 1320 1324 return false; 1321 1325 } -
branches/czw_branch/20120906/psModules/src/objects/pmSourceIO_CMF.c.in
r34403 r34772 118 118 119 119 row = psMetadataAlloc (); 120 121 // the psMetadataAdd entry and the double quotes are used by grep to select the output fields for automatic documentation 122 // This set of psMetadataAdd Entries marks the "----" "Start of the PSF segment" 120 123 @ALL@ psMetadataAdd (row, PS_LIST_TAIL, "IPP_IDET", PS_DATA_U32, "IPP detection identifier index", source->seq); 121 124 @ALL@ psMetadataAdd (row, PS_LIST_TAIL, "X_PSF", PS_DATA_F32, "PSF x coordinate", outputs.xPos); … … 193 196 @PS1_DV?@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_NRATIO_ALL", PS_DATA_F32, "nPos / (nGood + nMask + nBad)", diffStats.nRatioAll); 194 197 195 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_P", PS_DATA_F32, "distance to positive match source", diffStats.Rp);196 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_P", PS_DATA_F32, "signal-to-noise of pos match src", diffStats.SNp);197 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_M", PS_DATA_F32, "distance to negative match source", diffStats.Rm);198 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_M", PS_DATA_F32, "signal-to-noise of neg match src", diffStats.SNm);198 @>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_P", PS_DATA_F32, "distance to positive match source", diffStats.Rp); 199 @>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_P", PS_DATA_F32, "signal-to-noise of pos match src", diffStats.SNp); 200 @>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_M", PS_DATA_F32, "distance to negative match source", diffStats.Rm); 201 @>PS1_DV1@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_M", PS_DATA_F32, "signal-to-noise of neg match src", diffStats.SNm); 199 202 200 203 @ALL@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS", PS_DATA_U32, "psphot analysis flags", source->mode); … … 306 309 @ALL@ axes.minor = psMetadataLookupF32 (&status, row, "PSF_MINOR"); 307 310 @ALL@ axes.theta = psMetadataLookupF32 (&status, row, "PSF_THETA"); 311 @ALL@ axes.theta = axes.theta * PS_RAD_DEG; 308 312 309 313 @ALL@ PAR[PM_PAR_SKY] = psMetadataLookupF32 (&status, row, "SKY"); … … 462 466 sprintf (keyword2, "RMAX_%02d", i); 463 467 psMetadataAddF32 (outhead, PS_LIST_TAIL, keyword1, PS_META_REPLACE, "min radius for SB profile", radMin->data.F32[i]); 464 psMetadataAddF32 (outhead, PS_LIST_TAIL, keyword2, PS_META_REPLACE, "m inradius for SB profile", radMax->data.F32[i]);468 psMetadataAddF32 (outhead, PS_LIST_TAIL, keyword2, PS_META_REPLACE, "max radius for SB profile", radMax->data.F32[i]); 465 469 } 466 470 … … 491 495 492 496 // XXX we are not writing out the mode (flags) or the type (psf, ext, etc) 497 // the psMetadataAdd entry and the double quotes are used by grep to select the output fields for automatic documentation 498 // This set of psMetadataAdd Entries marks the "----" "Start of the XSRC segment" 493 499 psMetadataAdd (row, PS_LIST_TAIL, "IPP_IDET", PS_DATA_U32, "IPP detection identifier index", source->seq); 494 500 psMetadataAdd (row, PS_LIST_TAIL, "X_EXT", PS_DATA_F32, "EXT model x coordinate", xPos); … … 718 724 sources = psArraySort (sources, pmSourceSortByFlux); 719 725 726 @>PS1_DV2@ float magOffset; 727 @>PS1_DV2@ float zeroptErr; 728 @>PS1_DV2@ float fwhmMajor; 729 @>PS1_DV2@ float fwhmMinor; 730 @>PS1_DV2@ pmSourceOutputsCommonValues (&magOffset, &zeroptErr, &fwhmMajor, &fwhmMinor, readout, imageHeader); 731 720 732 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams 721 733 int nParamMax = 0; … … 776 788 @>PS1_DV2@ double raPos = ptSky.r*PS_DEG_RAD; 777 789 @>PS1_DV2@ double decPos = ptSky.d*PS_DEG_RAD; 790 @>PS1_DV2@ posAngle *= PS_DEG_RAD; 791 @>PS1_DV2@ pltScale *= PS_DEG_RAD*3600.0; 778 792 779 793 float kronFlux = source->moments ? source->moments->KronFlux : NAN; … … 783 797 784 798 // XXX we are not writing out the mode (flags) or the type (psf, ext, etc) 799 // the psMetadataAdd entry and the double quotes are used by grep to select the output fields for automatic documentation 800 // This set of psMetadataAdd Entries marks the "----" "Start of the XFIT segment" 785 801 psMetadataAddU32 (row, PS_LIST_TAIL, "IPP_IDET", 0, "IPP detection identifier index", source->seq); 786 802 psMetadataAddF32 (row, PS_LIST_TAIL, "X_EXT", 0, "EXT model x coordinate", xPos); … … 790 806 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT", 0, "EXT model ra coordinate", raPos); 791 807 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "DEC_EXT", 0, "EXT model dec coordinate", decPos); 808 @>PS1_DV2@ float instFlux = isfinite(model->mag) ? pow(10.0, -0.4*model->mag) : NAN; 809 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_FLUX", 0, "EXT fit instrumental counts", instFlux); 810 792 811 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG", 0, "EXT fit instrumental magnitude", model->mag); 793 812 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG_SIG", 0, "Sigma of PSF instrumental magnitude", model->magErr); 813 814 @>PS1_DV2@ float calMag = isfinite(magOffset) ? model->mag + magOffset : NAN; 815 @>PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "EXT_CAL_MAG", PS_DATA_F32, "EXT Magnitude using supplied calibration", calMag); 816 @>PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "EXT_CHISQ", PS_DATA_F32, "EXT Magnitude using supplied calibration", model->chisq); 817 @>PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "EXT_NDOF", PS_DATA_S32, "EXT Magnitude using supplied calibration", model->nDOF); 794 818 795 819 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "POSANGLE", 0, "position angle at source (degrees)", posAngle); … … 806 830 psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG", 0, "Kron Mag", kronMag); 807 831 808 @ ALL, <PS1_DV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n);809 @ >PS1_DV2@psMetadataAddS32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n);832 @PS1_DV1,PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n); 833 @ALL,!PS1_DV0,!PS1_DV1@ psMetadataAddS32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n); 810 834 psMetadataAddStr (row, PS_LIST_TAIL, "MODEL_TYPE", 0, "name of model", pmModelClassGetName (model->type)); 811 835 … … 813 837 if (model->type == pmModelClassGetType("PS_MODEL_TRAIL")) { 814 838 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MAJ", 0, "EXT width (major axis), length for trail", PAR[PM_PAR_LENGTH]); 815 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MIN", 0, "EXT width (minor axis), sigma for trail", PAR[PM_PAR_SIGMA]); 839 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MIN", 0, "EXT width (minor axis), sigma for trail", PAR[PM_PAR_SIGMA]); // this is not fitted 816 840 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_THETA", 0, "EXT orientation angle", PAR[PM_PAR_THETA]); 817 841 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MAJ_ERR",0, "EXT width error (major axis)", dPAR[PM_PAR_LENGTH]); 818 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MIN_ERR",0, "EXT width error (minor axis)", dPAR[PM_PAR_SIGMA]);842 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MIN_ERR",0, "EXT width error (minor axis)", NAN); // this is not fitted, so error is NAN 819 843 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_THETA_ERR", 0, "EXT orientation angle (error)", dPAR[PM_PAR_THETA]); 820 844 } else { … … 1072 1096 1073 1097 // XXX we are not writing out the mode (flags) or the type (psf, ext, etc) 1098 // the psMetadataAdd entry and the double quotes are used by grep to select the output fields for automatic documentation 1099 // This set of psMetadataAdd Entries marks the "----" "Start of the XRAD segment" 1074 1100 psMetadataAddU32 (row, PS_LIST_TAIL, "IPP_IDET", 0, "IPP detection identifier index", source->seq); 1075 1101 psMetadataAddF32 (row, PS_LIST_TAIL, "X_APER", 0, "Center of aperture measurements", xPos); -
branches/czw_branch/20120906/psModules/src/objects/pmSourceOutputs.c
r34403 r34772 227 227 *pltScale = 0.5*(pltScale_x + pltScale_y); 228 228 229 float posAngle_x, posAngle_y; 229 230 float crossProduct = dTPx_dCHx * dTPy_dCHy - dTPx_dCHy * dTPy_dCHx; 230 231 if (crossProduct > 0.) { 231 232 *pltScale *= -1.0; 232 } 233 234 float posAngle_x = atan2 (+dTPy_dCHx, +dTPx_dCHx); 235 float posAngle_y = atan2 (-dTPy_dCHy, +dTPx_dCHy); 233 posAngle_x = atan2 (dTPy_dCHx, dTPx_dCHx); 234 posAngle_y = atan2 (dTPy_dCHy, dTPx_dCHy) - M_PI_2; 235 } else { 236 posAngle_x = atan2 (dTPy_dCHx, -dTPx_dCHx); 237 posAngle_y = atan2 (dTPy_dCHy, dTPx_dCHy) - M_PI_2; 238 } 239 240 // with errors, these may end up on opposite sides of the M_PI boundary. 241 if (posAngle_x - posAngle_y > M_PI) { 242 posAngle_y += 2.0 * M_PI; 243 } 244 if (posAngle_y - posAngle_x > M_PI) { 245 posAngle_x += 2.0 * M_PI; 246 } 236 247 *posAngle = 0.5*(posAngle_x + posAngle_y); 237 248 -
branches/czw_branch/20120906/psModules/src/objects/pmSourcePhotometry.c
r34403 r34772 165 165 status = pmSourcePhotometryModel (&model->mag, NULL, model); 166 166 if (model == source->modelEXT) foundEXT = true; 167 float SN = fabs(model->params->data.F32[PM_PAR_I0] / model->dparams->data.F32[PM_PAR_I0]); 168 model->magErr = 1.0 / SN; 167 169 } 168 170 if (foundEXT) {
Note:
See TracChangeset
for help on using the changeset viewer.
