Changeset 38705
- Timestamp:
- Sep 3, 2015, 6:23:17 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150625/Ohana/src/relastro
- Files:
-
- 3 edited
-
include/relastro.h (modified) (2 diffs)
-
src/UpdateObjects.c (modified) (9 diffs)
-
src/bcatalog.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/relastro/include/relastro.h
r38697 r38705 223 223 } ICRFobj; 224 224 225 # define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM 226 225 227 /* global variables set in parameter file */ 226 228 # define DVO_MAX_PATH 1024 … … 265 267 266 268 int PARALLEL_OUTPUT; 269 270 int VERBOSE_IMAGE; 267 271 268 272 int VERBOSE; -
branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/UpdateObjects.c
r38697 r38705 1 1 # include "relastro.h" 2 2 # define PAR_TOOFEW 5 3 4 int DumpObjectsWith2MASS (Catalog *catalog, int Ncatalog); 3 5 4 6 // This function operates on both Measure and MeasureTiny. In the big stages, this should … … 40 42 SecFilt *secfilt = &catalog[i].secfilt[j*Nsecfilt]; 41 43 42 int XVERB = FALSE;43 XVERB |= (average[0].objID == OBJ_ID_SRC) && (average[0].catID == CAT_ID_SRC);44 XVERB |= (average[0].objID == OBJ_ID_DST) && (average[0].catID == CAT_ID_DST);45 if ((OBJ_ID_SRC || OBJ_ID_DST) && !XVERB) continue;46 47 44 UpdateObjects_Stack(average, secfilt, measure, measureBig, Nsecfilt, fitStatsStack); 48 45 UpdateObjects_Chips(average, secfilt, measure, measureBig, Nsecfilt, fitStatsChips, i, m); … … 54 51 } 55 52 53 // DumpObjectsWith2MASS (catalog, Ncatalog); 54 56 55 FitStatsFree (fitStatsChips); 57 56 FitStatsFree (fitStatsStack); … … 63 62 FitStatsFree (sumStatsStack); 64 63 64 return (TRUE); 65 } 66 67 // This function operates on both Measure and MeasureTiny. In the big stages, this should 68 // be called with just MeasureTiny set and Measure == NULL 69 int DumpObjectsWith2MASS (Catalog *catalog, int Ncatalog) { 70 71 int i; 72 for (i = 0; i < Ncatalog; i++) { 73 off_t j; 74 for (j = 0; j < catalog[i].Naverage; j++) { 75 /* calculate the average value of R,D for a single star */ 76 off_t m = catalog[i].average[j].measureOffset; 77 78 off_t k; 79 for (k = 0; k < catalog[i].average[j].Nmeasure; k++) { 80 MeasureTiny *measure = &catalog[i].measureT[m+k]; 81 if (measure->dbFlags & ID_MEAS_OBJECT_HAS_2MASS) { 82 fprintf (stderr, "0x%08x 0x%08x : %12.8f %12.8f %5d\n", catalog[i].average[j].objID, catalog[i].average[j].catID, measure->R, measure->D, measure->photcode); 83 } 84 } 85 } 86 } 65 87 return (TRUE); 66 88 } … … 471 493 FitAstromPoint *points = fit->points; 472 494 495 int TESTPT2 = FALSE; 496 TESTPT2 |= CAT_ID_SRC && OBJ_ID_SRC && (average[0].catID == CAT_ID_SRC) && (average[0].objID == OBJ_ID_SRC); 497 TESTPT2 |= CAT_ID_DST && OBJ_ID_DST && (average[0].catID == CAT_ID_DST) && (average[0].objID == OBJ_ID_DST); 498 if (TESTPT2) { 499 fprintf (stderr, "got test det\n"); 500 } 501 473 502 // find the basic properties of the detections for this object (Tmin, Tmax, Tmean) 474 503 off_t k; … … 559 588 Npoints++; 560 589 561 if ((measure[ 0].photcode >= 2011) && (measure[0].photcode <= 2013)) {590 if ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)) { 562 591 has2MASS = TRUE; 563 592 } … … 566 595 } // loop over measurements : average[0].Nmeasure 567 596 597 int TESTPT = FALSE; 598 TESTPT |= CAT_ID_SRC && OBJ_ID_SRC && (average[0].catID == CAT_ID_SRC) && (average[0].objID == OBJ_ID_SRC); 599 TESTPT |= CAT_ID_DST && OBJ_ID_DST && (average[0].catID == CAT_ID_DST) && (average[0].objID == OBJ_ID_DST); 600 if (TESTPT) { 601 fprintf (stderr, "got test det\n"); 602 } 603 568 604 // XXX flag measurements from stars with 2MASS 569 605 for (k = 0; k < average[0].Nmeasure; k++) { 570 606 // reset the bit to note that a detection was used (or not) 571 607 if (has2MASS) { 572 measure[k].dbFlags &= ~ID_MEAS_POOR_PHOTOM;608 measure[k].dbFlags |= ID_MEAS_OBJECT_HAS_2MASS; 573 609 } else { 574 measure[k].dbFlags |= ID_MEAS_POOR_PHOTOM;610 measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_2MASS; 575 611 } 576 612 } … … 596 632 597 633 *Tmean = 0.0; 634 635 double Tsum = 0.0; 636 double Wsum = 0.0; 598 637 for (k = 0; k < Npoints; k++) { 599 638 Tmin = MIN(Tmin, points[k].T); 600 639 Tmax = MAX(Tmax, points[k].T); 601 *Tmean += points[k].T; 640 641 float wx = 1.0 / SQ(points[k].dX); 642 643 Tsum += points[k].T * wx; 644 Wsum += wx; 602 645 603 646 // at this point, T is in years since J2000 … … 611 654 612 655 // mean epoch 613 *Tmean /= (float) Npoints;656 *Tmean = Tsum / Wsum; 614 657 615 658 // for HIGH_SPEED, just use the center of the range -
branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/bcatalog.c
r38665 r38705 119 119 } 120 120 121 int TESTPT = FALSE; 122 TESTPT |= CAT_ID_SRC && OBJ_ID_SRC && (catalog[0].average[i].catID == CAT_ID_SRC) && (catalog[0].average[i].objID == OBJ_ID_SRC); 123 TESTPT |= CAT_ID_DST && OBJ_ID_DST && (catalog[0].average[i].catID == CAT_ID_DST) && (catalog[0].average[i].objID == OBJ_ID_DST); 124 if (TESTPT) { 125 fprintf (stderr, "got test det\n"); 126 } 127 121 128 Nm = 0; 122 129 for (j = 0; j < catalog[0].average[i].Nmeasure; j++) {
Note:
See TracChangeset
for help on using the changeset viewer.
