Changeset 34568
- Timestamp:
- Oct 24, 2012, 3:53:46 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120905/psModules
- Files:
-
- 8 edited
-
. (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) (3 diffs)
-
src/objects/pmSourceIO_CMF.c.in (modified) (8 diffs)
-
src/objects/pmSourceOutputs.c (modified) (1 diff)
-
src/objects/pmSourcePhotometry.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905/psModules
- Property svn:mergeinfo changed
/trunk/psModules merged: 34496-34499,34514-34515,34527,34530,34541,34564
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/psModules/src/objects
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-20120905/psModules/src/objects/pmModel.c
r31153 r34568 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/eam_branches/ipp-20120905/psModules/src/objects/pmMoments.c
r32347 r34568 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/eam_branches/ipp-20120905/psModules/src/objects/pmSourceIO.c
r34403 r34568 1232 1232 { 1233 1233 if (!psFitsMoveExtNameClean (file->fits, xsrcname)) { 1234 ps Warning ("cannot find xsrc extension %s in %s, skipping", xsrcname, file->filename);1234 psTrace ("pmFPAfile", 1, "cannot find xsrc extension %s in %s, skipping", xsrcname, file->filename); 1235 1235 return false; 1236 1236 } … … 1270 1270 { 1271 1271 if (!psFitsMoveExtNameClean (file->fits, extname)) { 1272 ps Warning ("cannot find xfit extension %s in %s, skipping", extname, file->filename);1272 psTrace ("pmFPAfile", 1, "cannot find xfit extension %s in %s, skipping", extname, file->filename); 1273 1273 return false; 1274 1274 } … … 1307 1307 { 1308 1308 if (!psFitsMoveExtNameClean (file->fits, extname)) { 1309 ps Warning ("cannot find xrad extension %s in %s, skipping", extname, file->filename);1309 psTrace ("pmFPAfile", 1, "cannot find xrad extension %s in %s, skipping", extname, file->filename); 1310 1310 return false; 1311 1311 } -
branches/eam_branches/ipp-20120905/psModules/src/objects/pmSourceIO_CMF.c.in
r34451 r34568 196 196 @PS1_DV?@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_NRATIO_ALL", PS_DATA_F32, "nPos / (nGood + nMask + nBad)", diffStats.nRatioAll); 197 197 198 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_P", PS_DATA_F32, "distance to positive match source", diffStats.Rp);199 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_P", PS_DATA_F32, "signal-to-noise of pos match src", diffStats.SNp);200 @ PS1_DV2@ psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_M", PS_DATA_F32, "distance to negative match source", diffStats.Rm);201 @ 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); 202 202 203 203 @ALL@ psMetadataAdd (row, PS_LIST_TAIL, "FLAGS", PS_DATA_U32, "psphot analysis flags", source->mode); … … 309 309 @ALL@ axes.minor = psMetadataLookupF32 (&status, row, "PSF_MINOR"); 310 310 @ALL@ axes.theta = psMetadataLookupF32 (&status, row, "PSF_THETA"); 311 @ALL@ axes.theta = axes.theta * PS_RAD_DEG; 311 312 312 313 @ALL@ PAR[PM_PAR_SKY] = psMetadataLookupF32 (&status, row, "SKY"); … … 465 466 sprintf (keyword2, "RMAX_%02d", i); 466 467 psMetadataAddF32 (outhead, PS_LIST_TAIL, keyword1, PS_META_REPLACE, "min radius for SB profile", radMin->data.F32[i]); 467 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]); 468 469 } 469 470 … … 723 724 sources = psArraySort (sources, pmSourceSortByFlux); 724 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 725 732 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams 726 733 int nParamMax = 0; … … 781 788 @>PS1_DV2@ double raPos = ptSky.r*PS_DEG_RAD; 782 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; 783 792 784 793 float kronFlux = source->moments ? source->moments->KronFlux : NAN; … … 797 806 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT", 0, "EXT model ra coordinate", raPos); 798 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 799 811 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG", 0, "EXT fit instrumental magnitude", model->mag); 800 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); 801 818 802 819 @>PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "POSANGLE", 0, "position angle at source (degrees)", posAngle); … … 813 830 psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG", 0, "Kron Mag", kronMag); 814 831 815 @ ALL, <PS1_DV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n);816 @ >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); 817 834 psMetadataAddStr (row, PS_LIST_TAIL, "MODEL_TYPE", 0, "name of model", pmModelClassGetName (model->type)); 818 835 … … 820 837 if (model->type == pmModelClassGetType("PS_MODEL_TRAIL")) { 821 838 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MAJ", 0, "EXT width (major axis), length for trail", PAR[PM_PAR_LENGTH]); 822 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 823 840 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_THETA", 0, "EXT orientation angle", PAR[PM_PAR_THETA]); 824 841 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_WIDTH_MAJ_ERR",0, "EXT width error (major axis)", dPAR[PM_PAR_LENGTH]); 825 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 826 843 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_THETA_ERR", 0, "EXT orientation angle (error)", dPAR[PM_PAR_THETA]); 827 844 } else { -
branches/eam_branches/ipp-20120905/psModules/src/objects/pmSourceOutputs.c
r34403 r34568 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/eam_branches/ipp-20120905/psModules/src/objects/pmSourcePhotometry.c
r34403 r34568 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.
