Changeset 30006
- Timestamp:
- Dec 9, 2010, 3:08:33 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101205/psphot
- Files:
-
- 6 edited
-
doc/stack.txt (modified) (1 diff)
-
src/psphotChoosePSF.c (modified) (4 diffs)
-
src/psphotOutput.c (modified) (1 diff)
-
src/psphotStackArguments.c (modified) (1 diff)
-
src/psphotStackImageLoop.c (modified) (5 diffs)
-
src/psphotStackMatchPSFs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/psphot/doc/stack.txt
r28013 r30006 1 2 20101207 3 4 header fields for PSPS: 5 6 * stack needs to count # of inputs 7 * propagate the input header to the output image (DONE) 8 * save PSF parameters in header 9 * stack type is only known to the launcher 10 11 * what are we doing for the stack calibrations?? 12 13 skycellID : code 14 surveyID : code 15 filterID : code 16 stackMetaID : stack_id 17 photoCalID : photcode -> number 18 magSat : FSATUR saturation magnitude level ** not correctly set 19 completMag : FLIMIT 95% completion level in mag ** not correctly set 20 stackTypeID : stack type identifier ** deep stack, nightly stack, best IQ stack? 21 refImageID : identifier of image used as reference for analysis 22 subtrImageID : N/A (stack) identifier of image subtracted to generate difference image 23 analVer : analysis version index ** index for tess_id + skycell_id + filter? 24 nP2Images : number of P2 images contributing to this cell ** missing from input stack 25 astroScat : astrometric scatter for chip ** measure scatter on stack creation? 26 photoScat : photometric scatter for chip ** internal scatter? 27 nAstroRef : number of astrometric reference sources ** (connected to above) 28 nPhoRef : number of photometric reference sources ** same 29 psfFwhm : PSF full width at half maximum ** 0.5(FWHM_MAJ + FWHM_MIN) 30 psfmodelID : * PSFMODEL PSF model identifier ** save the PSF model name in the header 31 psfWidMajor : * FWHM_MAJ PSF parameters 32 psfWidMinor : * FWHM_MIN PSF parameters 33 psfTheta : * ANGLE PSF parameters 34 psfExtra1 : * PSF_EXT1 PSF parameters ** (at field center?) 35 psfExtra2 : * PSF_EXT2 PSF parameters ** (not set for all models) 36 photoZero : local derived photometric zero point 37 photoColor : local derived photometric color term 38 ctype1 : * CTYPE1 name of astrometric projection in RA ** propagate from input stacks 39 ctype2 : * CTYPE2 name of astrometric projection in DEC 40 crval1 : * CRVAL1 RA corresponding to reference pixel 41 crval2 : * CRVAL2 DEC corresponding to reference pixel 42 crpix1 : * CRPIX1 reference pixel value for RA 43 crpix2 : * CRPIX2 reference pixel value for DEC 44 cdelt1 : * CDELT1 scale factor for RA 45 cdelt2 : * CDELT2 scale factor for DEC 46 pc001001 : * PC001001 elements of rotation/Dcale matrix 47 pc001002 : * PC001002 elements of rotation/Dcale matrix 48 pc002001 : * PC002001 elements of rotation/Dcale matrix 49 pc002002 : * PC002002 elements of rotation/Dcale matrix 50 polyOrder : * NPLYTERM polynomial order of astrometry fit ** default to 1 51 pca1x3y0 : * PCA1X3Y0 polynomial coefficients for the astrometric fit 52 pca1x2y1 : * PCA1X2Y1 polynomial coefficients for the astrometric fit 53 pca1x1y2 : * PCA1X1Y2 polynomial coefficients for the astrometric fit 54 pca1x0y3 : * PCA1X0Y3 polynomial coefficients for the astrometric fit 55 pca1x2y0 : * PCA1X2Y0 polynomial coefficients for the astrometric fit 56 pca1x1y1 : * PCA1X1Y1 polynomial coefficients for the astrometric fit 57 pca1x0y2 : * PCA1X0Y2 polynomial coefficients for the astrometric fit 58 pca2x3y0 : * PCA2X3Y0 polynomial coefficients for the astrometric fit 59 pca2x2y1 : * PCA2X2Y1 polynomial coefficients for the astrometric fit 60 pca2x1y2 : * PCA2X1Y2 polynomial coefficients for the astrometric fit 61 pca2x0y3 : * PCA2X0Y3 polynomial coefficients for the astrometric fit 62 pca2x2y0 : * PCA2X2Y0 polynomial coefficients for the astrometric fit 63 pca2x1y1 : * PCA2X1Y1 polynomial coefficients for the astrometric fit 64 pca2x0y2 : * PCA2X0Y2 polynomial coefficients for the astrometric fit 65 calibModNum : calibration modification number 66 dataRelease : Data release 1 67 2 68 20100506: -
branches/eam_branches/ipp-20101205/psphot/src/psphotChoosePSF.c
r29936 r30006 434 434 psVector *fwhmMajor = psVectorAllocEmpty (100, PS_DATA_F32); 435 435 psVector *fwhmMinor = psVectorAllocEmpty (100, PS_DATA_F32); 436 psVector *psfExtra1 = psVectorAllocEmpty (100, PS_DATA_F32); 437 psVector *psfExtra2 = psVectorAllocEmpty (100, PS_DATA_F32); 436 438 437 439 for (float ix = -0.4; ix <= +0.4; ix += 0.1) { … … 466 468 psVectorAppend (fwhmMajor, FWHM_MAJOR); 467 469 psVectorAppend (fwhmMinor, FWHM_MINOR); 470 471 if (modelPSF->params->n >= 7) { 472 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]); 473 } 474 if (modelPSF->params->n >= 8) { 475 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]); 476 } 468 477 } 469 478 } … … 499 508 } 500 509 510 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 511 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 512 return false; 513 } 514 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 515 516 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) { 517 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2"); 518 return false; 519 } 520 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean); 521 501 522 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", axes.theta); 502 523 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars); 503 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "Valid PSF Model?", true); 524 525 char *psfModelName = pmModelClassGetName(psf->type); 526 psMetadataAddStr(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "PSF Model Name", psfModelName); 527 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSF_OK", PS_META_REPLACE, "Valid PSF Model?", true); 504 528 505 529 psFree (fwhmMajor); … … 566 590 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_LQ", PS_META_REPLACE, "PSF FWHM Minor axis (lower quartile)", 0); 567 591 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_UQ", PS_META_REPLACE, "PSF FWHM Minor axis (upper quartile)", 0); 568 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", FWHM_T); 569 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", 0); 570 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "Valid PSF Model?", false); 592 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", FWHM_T); 593 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", 0); 594 psMetadataAddStr(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "PSF Model Name", "NONE"); 595 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSF_OK", PS_META_REPLACE, "Valid PSF Model?", false); 571 596 572 597 return true; -
branches/eam_branches/ipp-20101205/psphot/src/psphotOutput.c
r29936 r30006 261 261 psMetadataItemSupplement (&status, header, analysis, "ANGLE"); 262 262 263 psMetadataItemSupplement (&status, header, analysis, "PSFMODEL"); 264 psMetadataItemSupplement (&status, header, analysis, "PSF_OK"); 265 263 266 // Image Quality measurements 264 267 psMetadataItemSupplement (&status, header, analysis, "IQ_NSTAR"); -
branches/eam_branches/ipp-20101205/psphot/src/psphotStackArguments.c
r28013 r30006 41 41 if ((N = psArgumentGet (argc, argv, "-break"))) { 42 42 if (argc <= N+1) { 43 psErrorStackPrint(stderr, "Expected to see 1 more argument; saw %d", argc - 1);43 psErrorStackPrint(stderr, "Expected to see an argument for -break"); 44 44 exit(PS_EXIT_CONFIG_ERROR); 45 45 } -
branches/eam_branches/ipp-20101205/psphot/src/psphotStackImageLoop.c
r29936 r30006 101 101 */ 102 102 103 # define UPDATE_HEADER 0103 # define UPDATE_HEADER 1 104 104 105 105 bool GetAstrometryFPA (pmConfig *config, pmFPAview *view) { … … 174 174 pmChip *outChip = pmFPAviewThisChip(view, output->fpa); ///< Chip in the output 175 175 176 # if (UPDATE_HEADER)177 176 pmHDU *outHDU = pmFPAviewThisHDU (view, output->fpa); 178 177 if (!outHDU) { 179 pmFPAAddSourceFromView(output->fpa, "name",view, output->format);178 pmFPAAddSourceFromView(output->fpa, view, output->format); 180 179 outHDU = pmFPAviewThisHDU (view, output->fpa); 181 180 psAssert (outHDU, "failed to make HDU"); 182 181 } 183 # endif 182 if (!outHDU->header) { 183 outHDU->header = psMetadataAlloc(); 184 } 184 185 185 186 if (bilevelAstrometry) { … … 188 189 continue; 189 190 } 190 # if (UPDATE_HEADER)191 191 if (!pmAstromWriteBilevelChip(outHDU->header, outChip, WCS_NONLIN_TOL)) { 192 192 psWarning("Unable to generate WCS header."); 193 193 continue; 194 194 } 195 # endif196 195 } else { 197 196 // we use a default FPA pixel scale of 1.0 … … 200 199 continue; 201 200 } 202 # if (UPDATE_HEADER) 203 if (UPDATE_HEADER && !pmAstromWriteWCS(outHDU->header, output->fpa, outChip, WCS_NONLIN_TOL)) { 201 if (!pmAstromWriteWCS(outHDU->header, output->fpa, outChip, WCS_NONLIN_TOL)) { 204 202 psWarning("Unable to generate WCS header."); 205 203 continue; 206 204 } 207 # endif208 205 } 209 206 } … … 225 222 psAssert (output, "missing file?"); 226 223 227 # if (UPDATE_HEADER)228 224 pmHDU *PHU = pmFPAviewThisPHU(view, output->fpa); 229 225 if (!PHU) { 230 pmFPAAddSourceFromView(output->fpa, "name",view, output->format);226 pmFPAAddSourceFromView(output->fpa, view, output->format); 231 227 PHU = pmFPAviewThisPHU (view, output->fpa); 232 228 psAssert (PHU, "failed to make PHU"); 233 229 } 230 if (!PHU->header) { 231 PHU->header = psMetadataAlloc(); 232 } 234 233 235 234 if (!pmAstromWriteBilevelMosaic(PHU->header, output->fpa, WCS_NONLIN_TOL)) { 236 235 psWarning("Unable to generate WCS header."); 237 236 } 238 # endif239 237 } 240 238 -
branches/eam_branches/ipp-20101205/psphot/src/psphotStackMatchPSFs.c
r29936 r30006 65 65 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) { 66 66 67 psImageMaskType maskValue; 68 psImageMaskType markValue; 69 70 // get the PSPHOT.MASK value from the config 71 if (!pmConfigMaskSetBits (&maskValue, &markValue, config)) { 72 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); 73 return false; 74 } 75 67 76 pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index); 68 77 if (!fileSrc) { … … 84 93 85 94 // set NAN pixels to 'SAT' 86 // XXX replace this is pmReadoutMaskInvalid? 87 psImageMaskType maskVal = pmConfigMaskGet("SAT", config); 88 if (!pmReadoutMaskNonfinite(readoutSrc, maskVal)) { 95 psImageMaskType maskSat = pmConfigMaskGet("SAT", config); 96 if (!pmReadoutMaskInvalid(readoutSrc, maskValue, maskSat)) { 89 97 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout."); 90 98 return false; … … 95 103 matchKernel(config, readoutOut, readoutSrc, options, index); 96 104 saveMatchData(readoutOut, options, index); 97 // renormKernel(readoutCnv, options, index);98 } else {99 // only match the flux (NO! not for multi-filter, at least!)100 // XXX do not generate readoutCnv in this case?101 // float norm = powf(10.0, -0.4 * options->norm->data.F32[index]); // Normalisation102 // psBinaryOp(readoutRaw->image, readoutRaw->image, "*", psScalarAlloc(norm, PS_TYPE_F32));103 // psBinaryOp(readoutRaw->variance, readoutRaw->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32));104 105 } 105 106 106 rescaleData(readoutOut, config, options, index); 107 107 … … 110 110 return true; 111 111 } 112 113 114 # if (0)115 // Read previously produced kernel116 if (psMetadataLookupBool(NULL, config->arguments, "PPSTACK.DEBUG.STACK")) {117 loadKernel(config, readoutCnv, options, index);118 } else {119 matchKernel(config, readoutCnv, readoutRaw, options, index);120 }121 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
