Changeset 37552
- Timestamp:
- Nov 3, 2014, 10:48:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
ippconfig/gpc1/psastro.config (modified) (5 diffs)
-
ippconfig/recipes/psastro.config (modified) (3 diffs)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 diff)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroChooseRefstars.c (modified) (2 diffs)
-
psastro/src/psastroZeroPoint.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/gpc1/psastro.config
r37470 r37552 398 398 END 399 399 400 CNP_ASTRO_PV3 METADATA 401 ZERO.POINT.USE.MEAN BOOL TRUE 402 PSASTRO.MAX.ALLOWED.FWHM F32 25 403 PSASTRO.CATDIR STR PS1.REF.20140713 404 ZERO.POINT.USE.MEAN BOOL TRUE 405 PSASTRO.GRID.MIN.ANGLE F32 -20 406 PSASTRO.GRID.MAX.ANGLE F32 +20 407 PSASTRO.GRID.DEL.ANGLE F32 0.5 408 PSASTRO.FIELD.PADDING F32 0.5 409 ## -- cannot clamp mag max as may be need for astrom 410 #REFSTAR_CLAMP_MAG_MAX F32 20.0 411 END 412 413 MD_ASTRO_PV3 METADATA 414 ZERO.POINT.BY.EXPOSURE BOOL TRUE 415 ZERO.POINT.USE.MEAN BOOL TRUE 416 DVO.GETSTAR.MAX.RHO F32 3000.0 # was globally changed to 10k, way to much and problem for fainter refcat in MD 417 PSASTRO.GRID.NREF.MAX S32 800 # max stars accepted for grid search from ref catalog (3-500 typically matched, lose some bright end) 418 PSASTRO.GRID.NRAW.MAX S32 1200 # max stars accepted for grid search from raw image to account for junk also 419 DVO.GETSTAR.MIN.MAG F32 12.0 # leave similar to default as MD done in marginal weather and can lose 1-3 mags at times 420 DVO.GETSTAR.MIN.MAG.INST F32 -25.0 421 PSASTRO.CATDIR STR PS1.REF.20140713 422 ## refcat may be okay astrom but not phot -- so need to be able to further limit by ZP 423 ## -- concern w/ new refcat >20 extra sources w/ larger merr over-dominating scatter in ZP 424 REFSTAR_CLAMP_MAG_MAX F32 20.0 425 REFSTAR.ZP.MIN.MAG F32 12.0 426 REFSTAR.ZP.MAX.MAG F32 21.0 427 ## for ZP need extra clamp by filter to avoid poorer photometry scatter on faint end 428 ## -- cannot restrict on bright end due to possible marginal nights 429 # PHOTCODE.DATA MULTI UPDATE 430 PHOTCODE.DATA MULTI 431 PHOTCODE.DATA METADATA 432 FILTER STR g 433 PHOTCODE STR g 434 REFSTAR.ZP.MAX.MAG F32 20.0 435 END 436 PHOTCODE.DATA METADATA 437 FILTER STR r 438 PHOTCODE STR r 439 REFSTAR.ZP.MAX.MAG F32 20.0 440 END 441 PHOTCODE.DATA METADATA 442 FILTER STR i 443 PHOTCODE STR i 444 REFSTAR.ZP.MAX.MAG F32 20.0 445 END 446 PHOTCODE.DATA METADATA 447 FILTER STR z 448 PHOTCODE STR z 449 REFSTAR.ZP.MAX.MAG F32 19.5 450 END 451 PHOTCODE.DATA METADATA 452 FILTER STR y 453 PHOTCODE STR y 454 REFSTAR.ZP.MAX.MAG F32 18.0 455 END 456 END 457 400 458 TEST_REFCAT METADATA 401 459 PSASTRO.CATDIR STR /data/ipp064.0/ipp/ippRefs/catdir.refcat.20120524.v0 … … 527 585 528 586 ## if defined for MD, needs to have MD name in group so shouldn't be modified except for MD work 529 ## -- ad hoc limit for NREFdue to issues fainter than 19 mag in all filters and brighter than 17.0 mag (except y ~16.5) in MD530 ## -- better solution and other issues need to really be dealt with for PV3531 STATICSKY_MD_DEEPCAL METADATA587 ## -- was ad hoc limit for NREF~150, rho~6000 due to issues fainter than 19 mag in all filters and brighter than 17.0 mag (except y ~16.5) in MD 588 ## -- for PV3 add refcat min/max mag REFSTAR.ZP.MIN.MAG for ZP range only 589 STATICSKY_MD_DEEPCAL_PV3 METADATA 532 590 PSASTRO.CATDIR STR PS1.REF.20140713 533 591 REFSTAR_MASK BOOL FALSE … … 539 597 PSASTRO.FIELD.PADDING F32 0.01 # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels 540 598 PSASTRO.MAX.NRAW S32 1500 # include more than MAX.NREF to account for extras like false-positives 541 PSASTRO.MAX.NREF S32 150 # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets599 PSASTRO.MAX.NREF S32 500 # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets 542 600 PSASTRO.MIN.INST.MAG.RAW F32 -25.0 # 543 601 PSASTRO.MAX.INST.MAG.RAW F32 -5.0 … … 546 604 DVO.GETSTAR.MAX.RHO F32 6000.0 # N/sqdeg, slightly larger than MAX.NREF 547 605 DVO.GETSTAR.MIN.MAG.INST F32 -25.0 # set absurd range to cover large range of exptime, then clamp... 548 DVO.GETSTAR.MIN.MAG F32 1 7.0 # only used if keyword problem so also using CLAMP_MAG_MIN549 REFSTAR_CLAMP_MAG_MIN F32 1 7.0 # saturation in MD ~14 even in y-band, so toss out brighter in the list. seeingoffset in brighter stars606 DVO.GETSTAR.MIN.MAG F32 15.0 # only used if keyword problem so also using CLAMP_MAG_MIN 607 REFSTAR_CLAMP_MAG_MIN F32 15.0 # saturation in MD ~14 even in y-band, so toss out brighter in the list. offset in brighter stars 550 608 DVO.GETSTAR.FIXED.ZEROPT F32 0.0 # not really needed, exptime overly dominates 551 609 … … 559 617 PSASTRO.MIN.NSTAR S32 10 # edges may not have many and require special treatment 560 618 561 KH.CORRECT.APPLY BOOL FALSE 562 END 619 KH.CORRECT.APPLY BOOL FALSE 620 621 REFSTAR.ZP.MIN.MAG F32 15.0 # general refcat zp min/max setting -- need to use photcode below 622 REFSTAR.ZP.MAX.MAG F32 19.0 623 624 # PHOTCODE.DATA MULTI UPDATE 625 PHOTCODE.DATA MULTI 626 PHOTCODE.DATA METADATA 627 FILTER STR g 628 PHOTCODE STR g 629 REFSTAR.ZP.MIN.MAG F32 17.0 # 630 REFSTAR.ZP.MAX.MAG F32 20.0 # 631 END 632 PHOTCODE.DATA METADATA 633 FILTER STR r 634 PHOTCODE STR r 635 REFSTAR.ZP.MIN.MAG F32 17.0 # 636 REFSTAR.ZP.MAX.MAG F32 19.0 # 637 END 638 PHOTCODE.DATA METADATA 639 FILTER STR i 640 PHOTCODE STR i 641 REFSTAR.ZP.MIN.MAG F32 17.0 # 642 REFSTAR.ZP.MAX.MAG F32 19.0 # 643 END 644 PHOTCODE.DATA METADATA 645 FILTER STR z 646 PHOTCODE STR z 647 REFSTAR.ZP.MIN.MAG F32 16.0 # 648 REFSTAR.ZP.MAX.MAG F32 18.0 # 649 END 650 PHOTCODE.DATA METADATA 651 FILTER STR y 652 PHOTCODE STR y 653 REFSTAR.ZP.MIN.MAG F32 15.0 # 654 REFSTAR.ZP.MAX.MAG F32 17.0 # 655 END 656 END -
trunk/ippconfig/recipes/psastro.config
r37420 r37552 174 174 REFSTAR_CLAMP_MAG_MAX F32 30.0 175 175 176 # restrict ref catalog for zero point determination 177 # -- can be put into photcode groups as well 178 REFSTAR.ZP.MAX.MAG F32 30.0 179 REFSTAR.ZP.MIN.MAG F32 -3.0 180 176 181 EXTRACT_MAX_MAG F32 -15.0 177 182 … … 276 281 END 277 282 283 CNP_ASTRO_PV3 METADATA 284 END 285 286 MD_ASTRO_PV3 METADATA 287 END 288 278 289 SYNTH_CAT METADATA 279 290 END … … 301 312 END 302 313 314 STATICSKY_MD_DEEPCAL_PV3 METADATA 315 END -
trunk/ippconfig/recipes/reductionClasses.mdc
r37415 r37552 1311 1311 STATICSKY_CALIBRATION STR STATICSKY_CAL 1312 1312 END 1313 1314 CNP_PV3 METADATA 1315 CHIP_PPIMAGE STR CHIP 1316 CHIP_PSPHOT STR CHIP 1317 WARP_PSWARP STR WARP 1318 STACK_PPSTACK STR STACK 1319 STACK_PPSUB STR STACK 1320 STACK_PSPHOT STR STACK 1321 DIFF_PPSUB STR DIFF 1322 DIFF_PSPHOT STR DIFF 1323 JPEG_BIN1 STR PPIMAGE_J1 1324 JPEG_BIN2 STR PPIMAGE_J2 1325 FAKEPHOT STR FAKEPHOT 1326 ADDSTAR STR ADDSTAR 1327 PSASTRO STR CNP_ASTRO_PV3 1328 STACKPHOT_PSPHOT STR STACKPHOT 1329 STACKPHOT_PPSUB STR STACKPHOT 1330 STACKPHOT_PPSTACK STR STACKPHOT 1331 STACKPHOT_SINGLE_PSPHOT STR STACKPHOT_SINGLE 1332 BACKGROUND_PPBACKGROUND STR BACKGROUND 1333 BACKGROUND_PSWARP STR BACKGROUND 1334 PSVIDEOPHOT STR PSVIDEOPHOT 1335 STATICSKY_CALIBRATION STR STATICSKY_CAL 1336 END 1337 1338 MD_PV3 METADATA 1339 CHIP_PPIMAGE STR CHIP 1340 CHIP_PSPHOT STR CHIP 1341 WARP_PSWARP STR WARP 1342 STACK_PPSTACK STR STACK_1DG 1343 STACK_PPSUB STR STACK 1344 STACK_PSPHOT STR STACK_!DG 1345 DIFF_PPSUB STR DIFF 1346 DIFF_PSPHOT STR DIFF 1347 JPEG_BIN1 STR PPIMAGE_J1 1348 JPEG_BIN2 STR PPIMAGE_J2 1349 FAKEPHOT STR FAKEPHOT 1350 ADDSTAR STR ADDSTAR 1351 PSASTRO STR MD_ASTRO_PV3 1352 STACKPHOT_PSPHOT STR STACKPHOT 1353 STACKPHOT_PPSUB STR STACKPHOT 1354 STACKPHOT_PPSTACK STR STACKPHOT 1355 STACKPHOT_SINGLE_PSPHOT STR STACKPHOT_SINGLE 1356 BACKGROUND_PPBACKGROUND STR BACKGROUND 1357 BACKGROUND_PSWARP STR BACKGROUND 1358 PSVIDEOPHOT STR PSVIDEOPHOT 1359 STATICSKY_CALIBRATION STR STATICSKY_MD_DEEPCAL_PV3 1360 END 1361 1313 1362 1314 1363 # random user tests (may not be stable or consistent) -
trunk/psastro/src/psastro.h
r36837 r37552 154 154 155 155 bool psastroZeroPoint (pmConfig *config); 156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime );156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag); 157 157 bool psastroZeroPointAnalysis (psMetadata *header, psVector *dMag, float zeropt, psMetadata *recipe); 158 158 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe); 159 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe); 159 160 160 161 psStats *psastroStatsPercentile (psVector *myVector, psMetadata *recipe); -
trunk/psastro/src/psastroChooseRefstars.c
r37420 r37552 66 66 psF32 clampMagMin = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MIN"); 67 67 if (!status) clampMagMin = -5.0; 68 //MEH test68 //MEH adding max option as well -- really should not be hardcoded.. 69 69 psF32 clampMagMax = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MAX"); 70 70 if (!status) clampMagMax = 30.0; … … 117 117 goto skip; 118 118 } 119 //MEH test119 //MEH option for max mag clamp also 120 120 if (ref->Mag > clampMagMax) { 121 121 psWarning("Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n", -
trunk/psastro/src/psastroZeroPoint.c
r33643 r37552 20 20 pmCell *cell = NULL; 21 21 pmReadout *readout = NULL; 22 float refminMag,refmaxMag; 22 23 23 24 // select the current recipe … … 59 60 } 60 61 62 // MEH -- RefMagLimit for ZP with photcode option (merr probably better but not an option) 63 // -- defualt is to use general config value (no hardcode..) 64 if (!psastroZeroPointRefMagLimitFromRecipe (&refminMag, &refmaxMag, fpa, recipe)) { 65 psLogMsg ("psastro", PS_LOG_INFO, "failed to load ref min,maxMag data from recipe"); 66 return false; 67 } 68 61 69 // if we measure the zero point by exposure, accumulate the dMag values here: 62 70 psVector *dMag = NULL; 71 // MEH -- also the number of refcat sources used 72 int zpt_nref = 0; 63 73 64 74 float fpaZP = 0.0; // Average zero point … … 81 91 82 92 // calculate dMag for the matched stars 83 dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime); 84 93 //dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime); 94 // MEH -- additional limits should be available for ZP if just robust mean and w/ stack skycal 95 dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime, refminMag, refmaxMag); 85 96 if (!byExposure) { 86 97 // calculate dMag for the matched stars just for this readout (well, chip) 87 98 psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER"); 88 99 psastroZeroPointAnalysis (header, dMag, zeropt, recipe); 100 // MEH -- per readout N refcat, min/max mag -- added here, not part of median/edge process 101 zpt_nref += dMag->n; 102 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", dMag->n); 103 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 104 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 89 105 psFree (dMag); 90 106 dMag = NULL; … … 95 111 numZP++; 96 112 } 113 97 114 98 115 … … 110 127 } 111 128 psastroZeroPointAnalysis (header, dMag, zeropt, recipe); 129 //MEH -- all N refcat sources here 130 zpt_nref = dMag->n; 112 131 psFree (dMag); 113 132 dMag = NULL; … … 141 160 // calculate dMag for the matched stars just for this readout (well, chip) 142 161 psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER"); 143 144 162 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OBS", PS_META_REPLACE, "measured zero point", zptObs); 145 163 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_REF", PS_META_REPLACE, "reference zero point", zptRef); 146 164 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_ERR", PS_META_REPLACE, "error on zero point", zptErr); 147 165 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OFF", PS_META_REPLACE, "zero point offset", zptOff); 166 //MEH -- per readout N refcat, MIN/MAX for consistency 167 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", zpt_nref); 168 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 169 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 148 170 } 149 171 } … … 151 173 } 152 174 175 // MEH add N refcat, min/max mag to primary header 176 psMetadata *header = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER"); 177 if (!header) { 178 header = psMetadataAlloc (); 179 psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", header); 180 psFree (header); 181 } 182 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "Total N refcat sources for zero point", zpt_nref); 183 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 184 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 153 185 154 186 psMetadataItem *item = psMetadataLookup(fpa->concepts, "FPA.ZP"); … … 162 194 * accumulate the dMag values from this readout 163 195 */ 164 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime ) {196 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag) { 165 197 166 198 bool status; … … 191 223 // XXX I should be applying the airmass term here or in psastroLoadRefstars 192 224 // (ie, ref->Mag would be a prediction for a given star. 193 float value = ref->Mag - raw->Mag - 2.5*log10(exptime); 194 psVectorAppend (dMag, value); 225 // MEH -- only append if in allowed ref mag range -- may want merr but not available.. 226 if ( ref->Mag >= refminMag && ref->Mag <= refmaxMag ){ 227 float value = ref->Mag - raw->Mag - 2.5*log10(exptime); 228 psVectorAppend (dMag, value); 229 } 195 230 } 196 231 return dMag; … … 490 525 continue; 491 526 } 492 } 527 //MEH null is a pain.. so only log if set 528 psLogMsg ("psastro", PS_LOG_INFO, "found GHOST_MAX_MAG %f",*ghostMaxMag); 529 } 530 //MEH what zpt is set to 531 psLogMsg ("psastro", PS_LOG_INFO, "found ZEROPT %f",*zeropt); 493 532 psFree (iter); 494 533 return true; … … 497 536 return false; 498 537 } 538 539 540 541 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe) { 542 543 bool status; 544 float tmpmin,tmpmax; 545 546 // MEH -- duplicate psastroZeroPointFromRecipe for ZeroPoint adding RefMag limits with photcode option for extra restrictions 547 // must have non-photcode dependent setting -- use as default rather than a hardcoded value 548 *refminMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MIN.MAG"); 549 //if (!status) *refminMag = -5.0; 550 if (!status) { 551 psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MIN.MAG"); 552 return false; 553 } 554 *refmaxMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MAX.MAG"); 555 //if (!status) *refmaxMag = 30.0; 556 if (!status) { 557 psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MAX.MAG"); 558 return false; 559 } 560 561 // select the filter; default to any photcode and mag limit otherwise 562 char *filter = psMetadataLookupStr (&status, fpa->concepts, "FPA.FILTERID"); 563 if (!status) ESCAPE ("RefMagLimit missing FPA.FILTER in concepts"); 564 565 // need to select the PHOTCODE.DATA folder that matches our filter 566 psMetadataItem *item = psMetadataLookup (recipe, "PHOTCODE.DATA"); 567 if (!item) ESCAPE ("RefMagLimit PHOTCODE.DATA folders missing"); 568 if (item->type != PS_DATA_METADATA_MULTI) ESCAPE ("RefMagLimit PHOTCODE.DATA not a multi"); 569 570 // PHOTCODE.DATA is a multi of metadata items 571 psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false); 572 573 psMetadataItem *refItem = NULL; 574 while ((refItem = psListGetAndIncrement (iter))) { 575 if (refItem->type != PS_DATA_METADATA) ESCAPE ("RefMagLimit PHOTCODE.DATA entry is not a metadata folder"); 576 577 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER"); 578 if (!status) { 579 // always seems to happen once, commented out in ZeroPoint above as well 580 //psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit PHOTCODE.DATA recipe folder is missing FILTER"); 581 continue; 582 } 583 584 // does this entry match the current filter? 585 if (strcmp (refFilter, filter)) continue; 586 587 psLogMsg ("psastro", PS_LOG_DETAIL, "RefMagLimit PHOTCODE.DATA found for filter %s", filter); 588 589 // -- may set one or other or both -- no reason to log if found or often not 590 tmpmin = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MIN.MAG"); 591 if (status) { 592 *refminMag = tmpmin; 593 } 594 tmpmax = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MAX.MAG"); 595 if (status) { 596 *refmaxMag = tmpmax; 597 } 598 // once finds filter, should free and return true but multiple groups cause issue so just go through all groups now 599 //psFree (iter); 600 //return true; 601 } 602 603 // log out set values 604 psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MIN.MAG %f",*refminMag); 605 psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MAX.MAG %f",*refmaxMag); 606 607 psFree (iter); 608 return true; 609 } 610
Note:
See TracChangeset
for help on using the changeset viewer.
