Changeset 24243 for branches/cnb_branches/cnb_branch_20090301
- Timestamp:
- May 26, 2009, 1:47:40 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 25 edited
-
. (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/libdvo/include/dvo.h (modified) (1 diff)
-
Ohana/src/opihi/dimm/camera_cmds.c (modified) (1 prop)
-
Ohana/src/opihi/dimm/telescope_cmds.c (modified) (1 prop)
-
Ohana/src/relastro/include/relastro.h (modified) (2 diffs)
-
Ohana/src/relastro/src/FitChip.c (modified) (1 diff)
-
Ohana/src/relastro/src/GetAstromError.c (modified) (1 diff)
-
Ohana/src/relastro/src/ImageOps.c (modified) (8 diffs)
-
Ohana/src/relastro/src/UpdateObjects.c (modified) (4 diffs)
-
Ohana/src/relastro/src/args.c (modified) (1 diff)
-
Ohana/src/relastro/src/bcatalog.c (modified) (2 diffs)
-
Ohana/src/relastro/src/load_catalogs.c (modified) (1 diff)
-
Ohana/src/relastro/src/relastroVisual.c (modified) (3 diffs)
-
Ohana/src/relastro/src/relastroVisual.h (modified) (1 diff)
-
Ohana/src/relastro/src/relastro_objects.c (modified) (4 diffs)
-
ppImage (modified) (1 prop)
-
ppStack (modified) (1 prop)
-
ppSub (modified) (1 prop)
-
psModules (modified) (1 prop)
-
psModules/src/astrom/pmAstrometryModel.c (modified) (1 diff)
-
psastro (modified) (1 prop)
-
psastro/src/psastroModel.c (modified) (2 diffs)
-
psphot (modified) (1 prop)
-
pswarp/src/pswarpVersion.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/Ohana
- Property svn:mergeinfo changed
/trunk/Ohana merged: 23595
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/Ohana/src/libdvo/include/dvo.h
r21508 r24243 108 108 # define ID_MEAS_POOR_ASTROM 0x0010 /* detection is astrometry outlier */ 109 109 # define ID_MEAS_SKIP_ASTROM 0x0020 /* detection was ignored for astrometry measurement */ 110 # define ID_MEAS_U NDEF_1 0x0040 /* unused*/111 # define ID_MEAS_U NDEF_2 0x0080 /* unused*/110 # define ID_MEAS_USED_OBJ 0x0040 /* detection was used during opdate objects */ 111 # define ID_MEAS_USED_CHIP 0x0080 /* detection was used during update chips */ 112 112 # define ID_MEAS_BLEND_MEAS 0x0100 /* detection is within radius of multiple objects */ 113 113 # define ID_MEAS_BLEND_OBJ 0x0200 /* multiple detections within radius of object */ -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/camera_cmds.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/telescope_cmds.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/include/relastro.h
r23649 r24243 122 122 123 123 int FlagOutlier; 124 int CLIP_THRESH; 124 125 125 126 FitMode FIT_MODE; … … 268 269 int UpdateMeasures (Catalog *catalog, int Ncatalog); 269 270 void fixImageRaw (Catalog *catalog, int Ncatalog, int im); 270 void FlagOutliers(Catalog *catalog , int Ncatalog);271 void FlagOutliers(Catalog *catalog); 271 272 int MeasFilterTest(Measure *measure); 272 273 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/FitChip.c
r23344 r24243 53 53 // generate the fit matches 54 54 for (i = 0; i < Nmatch; i++) { 55 if (raw[i].mask) continue; 56 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) continue; 55 if (raw[i].mask) { 56 continue; 57 } 58 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) { 59 continue; 60 } 57 61 58 62 // only keep objects within dRmax -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/GetAstromError.c
r16810 r24243 30 30 31 31 dPtotal = sqrt(SQ(dPsys) + AS*SQ(dPobs) + MS*SQ(dM)); 32 33 //XXX dXccd, dYccd are now working correctly 34 //dPtotal = AS * dPobs; 35 32 36 dPtotal = MAX (dPtotal, MIN_ERROR); 33 37 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/ImageOps.c
r23649 r24243 1 1 # include "relastro.h" 2 #define TESTING 2 3 3 4 static unsigned int *start; … … 163 164 plot_list (&graphdata, Mlist, dlist, Nimage, "Mcal vs dMcal", NULL); 164 165 165 # define NBIN 20 0166 # define NBIN 20 166 167 REALLOCATE (xlist, double, NBIN); 167 168 REALLOCATE (Mlist, double, NBIN); … … 292 293 293 294 // an object with only one detection provides no information about the image calibration 295 //XXX this is already taken care of in bcatalog 294 296 raw[i].mask = FALSE; 295 297 int mask = FALSE; … … 297 299 mask = TRUE; 298 300 } 299 if (~finite(catalog[c].measure[m].dR) || ~finite(catalog[c].measure[m].dD)) mask = TRUE; 301 if (!finite(catalog[c].measure[m].dR) || !finite(catalog[c].measure[m].dD)) { 302 mask = TRUE; 303 } 300 304 301 305 raw[i].mask = mask; … … 388 392 389 393 /** lifted from relphot/StarOps.clean_measures */ 390 void FlagOutliers (Catalog *catalog, int Ncatalog) { 394 void FlagOutliers2D(Catalog *catalog); 395 396 void FlagOutliers (Catalog *catalog) { 397 // XXX FlagOutliers is just using FlagOutliers2D 398 FlagOutliers2D(catalog); 399 return; 391 400 392 401 int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt; 393 double Ns ;402 double Ns, theta, x, y; 394 403 double *R, *D, *dR, *dD; 395 404 StatType statsR, statsD; … … 399 408 400 409 if (VERBOSE) fprintf (stderr, "marking poor measures\n"); 401 /* Nmeasure is now different, need to reallocate */402 410 Nmax = 0; 403 for (i = 0; i < Ncatalog; i++) { 404 for (j = 0; j < catalog[i].Naverage; j++) { 405 Nmax = MAX (Nmax, catalog[i].average[j].Nmeasure); 406 } 407 } 411 for (i = 0; i < catalog[0].Naverage; i++) { 412 Nmax = MAX (Nmax, catalog[0].average[i].Nmeasure); 413 } 414 408 415 ALLOCATE (R, double, Nmax); 409 416 ALLOCATE (D, double, Nmax); … … 414 421 TOOFEW = MAX (5, SRC_MEAS_TOOFEW); 415 422 416 Ns = 3;423 Ns = CLIP_THRESH; 417 424 Ndel = Nave = 0; 418 for (i = 0; i < Ncatalog; i++) {419 for (j = 0; j < catalog[i].Naverage; j++) {420 425 421 /* accumulate list of valid measurements */ 422 m = catalog[i].average[j].measureOffset; 423 N = 0; 424 for (k = 0; k < catalog[i].average[j].Nmeasure; k++, m++) { 425 426 // skip measurements based on user selected criteria 427 if (!MeasFilterTest(&catalog[i].measure[m])) continue; 428 429 R[N] = getMeanR(&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); 430 D[N] = getMeanD(&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); 431 dR[N] = GetAstromError( &catalog[i].measure[m], ERROR_MODE_RA); 432 dD[N] = GetAstromError( &catalog[i].measure[m], ERROR_MODE_DEC); 433 if (isnan(R[N]) || isnan(D[N])) continue; 434 N++; 426 /* loop over each object in the catalog */ 427 for (j = 0; j < catalog[0].Naverage; j++) { 428 429 /* accumulate list of valid measurements */ 430 m = catalog[0].average[j].measureOffset; 431 N = 0; 432 for (k = 0; k < catalog[0].average[j].Nmeasure; k++, m++) { 433 434 // skip measurements based on user selected criteria 435 if (!MeasFilterTest(&catalog[0].measure[m])) continue; 436 R[N] = catalog[0].measure[m].dR; 437 D[N] = catalog[0].measure[m].dD; 438 dR[N] = GetAstromError( &catalog[0].measure[m], ERROR_MODE_RA); 439 dD[N] = GetAstromError( &catalog[0].measure[m], ERROR_MODE_DEC); 440 if (isnan(R[N]) || isnan(D[N])) continue; 441 N++; 442 } 443 if (N <= TOOFEW) continue; 444 445 /* 3-sigma clip based on stats of inner 50% */ 446 initstats ("MEAN"); 447 liststats (R, dR, N, &statsR); 448 liststats (D, dD, N, &statsD); 449 450 statsR.sigma = MAX (MIN_ERROR, statsR.sigma); 451 statsD.sigma = MAX (MIN_ERROR, statsD.sigma); 452 453 /* compare per-object distance to this standard deviation, and flag outliers*/ 454 m = catalog[0].average[j].measureOffset; 455 N = 0; 456 for (k = 0; k < catalog[0].average[j].Nmeasure; k++, m++) { 457 //reset flag on each invocation 458 catalog[0].measure[m].dbFlags &= ~ID_MEAS_POOR_ASTROM; 459 460 // skip measurements based on user selected criteria 461 if (!MeasFilterTest(&catalog[0].measure[m])) continue; 462 463 x = catalog[0].measure[m].dR - statsR.median; 464 y = catalog[0].measure[m].dD - statsD.median; 465 theta = atan2(y,x); 466 if ((x*x + y*y) > (SQR(statsR.sigma * Ns * cos(theta)) + 467 SQR(statsD.sigma * Ns * sin(theta)))) { 468 catalog[0].measure[m].dbFlags |= ID_MEAS_POOR_ASTROM; 469 Ndel++; 435 470 } 436 if (N <= TOOFEW) continue; 437 438 /* 3-sigma clip based on stats of inner 50% */ 439 initstats ("INNER_MEAN"); 440 liststats (R, dR, N, &statsR); 441 liststats (R, dR, N, &statsD); 442 443 statsR.sigma = MAX (MIN_ERROR, statsR.sigma); 444 statsD.sigma = MAX (MIN_ERROR, statsD.sigma); 445 446 for (k = m = 0; k < N; k++) { 447 if ((fabs (R[k] - statsR.median) < Ns*statsR.sigma) && 448 (fabs (D[k] - statsD.median) < Ns*statsD.sigma)) { 449 R[m] = R[k]; 450 dR[m] = dR[k]; 451 D[m] = D[k]; 452 dD[m] = dD[k]; 453 m++; 454 } 471 N++; 472 Nave ++; 473 } 474 475 //examine results 476 relastroVisualPlotOutliers(catalog, catalog[0].average[j].measureOffset, 477 catalog[0].average[j].Nmeasure, 478 statsR, statsD, Ns); 479 } 480 481 if (VERBOSE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave); 482 free (R); 483 free(dR); 484 free(D); 485 free(dD); 486 } 487 488 489 /** an alternative outlier rejection scheme */ 490 void FlagOutliers2D (Catalog *catalog) { 491 492 int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt; 493 double *index; 494 double Ns, theta, x, y; 495 double *R, *D, *dR, *dD, *d2; 496 StatType statsR, statsD; 497 498 Nsecfilt = GetPhotcodeNsecfilt(); 499 assert(catalog[0].Nsecfilt == Nsecfilt); 500 501 if (VERBOSE) fprintf (stderr, "marking poor measures\n"); 502 Nmax = 0; 503 for (i = 0; i < catalog[0].Naverage; i++) { 504 Nmax = MAX (Nmax, catalog[0].average[i].Nmeasure); 505 } 506 507 ALLOCATE (R, double, Nmax); 508 ALLOCATE (D, double, Nmax); 509 ALLOCATE (dR, double, Nmax); 510 ALLOCATE (dD, double, Nmax); 511 ALLOCATE (d2, double, Nmax); 512 ALLOCATE (index, double, Nmax); 513 514 /* it makes no sense to mark 3-sigma outliers with <5 measurements */ 515 TOOFEW = MAX (5, SRC_MEAS_TOOFEW); 516 517 Ns = CLIP_THRESH; 518 Ndel = Nave = 0; 519 520 /* loop over each object in the catalog */ 521 for (j = 0; j < catalog[0].Naverage; j++) { 522 523 /* accumulate list of valid measurements */ 524 m = catalog[0].average[j].measureOffset; 525 N = 0; 526 527 for (k = 0; k < catalog[0].average[j].Nmeasure; k++, m++) { 528 529 //reset flag on each invocation 530 catalog[0].measure[m].dbFlags &= ~ID_MEAS_POOR_ASTROM; 531 532 // skip measurements based on user selected criteria 533 if (!MeasFilterTest(&catalog[0].measure[m])) continue; 534 R[N] = catalog[0].measure[m].dR; 535 D[N] = catalog[0].measure[m].dD; 536 dR[N] = GetAstromError( &catalog[0].measure[m], ERROR_MODE_RA); 537 dD[N] = GetAstromError( &catalog[0].measure[m], ERROR_MODE_DEC); 538 if (isnan(R[N]) || isnan(D[N])) continue; 539 N++; 540 } 541 if (N <= TOOFEW) continue; 542 543 /* calculate mean of all points*/ 544 initstats ("MEAN"); 545 liststats (R, dR, N, &statsR); 546 liststats (D, dD, N, &statsD); 547 statsR.sigma = MAX (MIN_ERROR, statsR.sigma); 548 statsD.sigma = MAX (MIN_ERROR, statsD.sigma); 549 550 /* calculate deviations of all points*/ 551 m = catalog[0].average[j].measureOffset; 552 N = 0; 553 for (k = 0; k < catalog[0].average[j].Nmeasure; k++, m++) { 554 //skip bad measurements 555 if (!MeasFilterTest(&catalog[0].measure[m])) continue; 556 x = catalog[0].measure[m].dR - statsR.median; 557 y = catalog[0].measure[m].dD - statsD.median; 558 theta = atan2(y,x); 559 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) + 560 SQR(statsD.sigma * Ns * sin(theta))); 561 index[N] = m; 562 N++; 563 } 564 565 // sort d2 566 dsortpair(d2, index, N); 567 N = (N/2 > (N-1)) ? N/2 : N-1; 568 569 // recalculate image center, sigma based on closest 50% of points 570 for(k = 0; k < N; k++) { 571 int ind = (int) index[k]; 572 R[k] = catalog[0].measure[ind].dR; 573 D[k] = catalog[0].measure[ind].dD; 574 dR[k] = GetAstromError( &catalog[0].measure[ind], ERROR_MODE_RA); 575 dD[k] = GetAstromError( &catalog[0].measure[ind], ERROR_MODE_DEC); 576 } 577 liststats (R, dR, N, &statsR); 578 liststats (D, dD, N, &statsD); 579 statsR.sigma = MAX (MIN_ERROR, statsR.sigma); 580 statsD.sigma = MAX (MIN_ERROR, statsD.sigma); 581 582 // use these new statistics to flag outliers 583 m = catalog[0].average[j].measureOffset; 584 N = 0; 585 for (k = 0; k < catalog[0].average[j].Nmeasure; k++, m++) { 586 //skip bad measurements 587 if (!MeasFilterTest(&catalog[0].measure[m])) continue; 588 x = catalog[0].measure[m].dR - statsR.median; 589 y = catalog[0].measure[m].dD - statsD.median; 590 theta = atan2(y,x); 591 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) + 592 SQR(statsD.sigma * Ns * sin(theta))); 593 if ((d2[N]) > 1) { 594 catalog[0].measure[m].dbFlags |= ID_MEAS_POOR_ASTROM; 595 Ndel ++; 455 596 } 456 initstats ("MEAN"); 457 liststats (R, dR, m, &statsR); 458 liststats (D, dD, m, &statsD); 459 statsR.sigma = MAX (MIN_ERROR, statsR.sigma); 460 statsD.sigma = MAX (MIN_ERROR, statsD.sigma); 461 462 /* apply to list of all relevant measurements*/ 463 m = catalog[i].average[j].measureOffset; 464 N = 0; 465 for (k = 0; k < catalog[i].average[j].Nmeasure; k++, m++) { 466 // skip measurements based on user selected criteria 467 if (!MeasFilterTest(&catalog[i].measure[m])) continue; 468 469 R[N] = getMeanR(&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); 470 D[N] = getMeanD(&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); 471 dR[N] = GetAstromError( &catalog[i].measure[m], ERROR_MODE_RA); 472 dD[N] = GetAstromError( &catalog[i].measure[m], ERROR_MODE_DEC); 473 474 if((fabs(R[N] - statsR.median) > Ns * statsR.sigma) || 475 (fabs(D[N] - statsR.median) > Ns * statsD.sigma)) { 476 catalog[i].measure[m].dbFlags |= ID_MEAS_POOR_ASTROM; 477 Ndel++; 478 } 479 N++; 480 Nave ++; 481 } 482 initstats (STATMODE); 483 484 if (TRUE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave); 485 free (R); 486 free(dR); 487 free(D); 488 free(dD); 489 } 490 } 491 } 492 493 597 N++; 598 Nave++; 599 } //done rejecting outliers 600 601 //examine results 602 relastroVisualPlotOutliers(catalog, catalog[0].average[j].measureOffset, 603 catalog[0].average[j].Nmeasure, 604 statsR, statsD, Ns); 605 606 } //done looping over objects 607 608 if (VERBOSE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave); 609 free (R); 610 free(dR); 611 free(D); 612 free(dD); 613 free(d2); 614 free(index); 615 } 616 617 618 494 619 /** Determine whether a measurement should be included in the analysis, based on supplied filter criteria */ 495 620 int MeasFilterTest(Measure *measure) { … … 501 626 if (!finite(measure[0].dR) || !finite(measure[0].dD)) return FALSE; 502 627 if (!finite(measure[0].M)) return FALSE; //XXX is this necessary for all relastro tasks? 503 628 504 629 /* select measurements by photcode, or equiv photcode, if specified */ 505 630 if (NphotcodesKeep > 0) { -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/UpdateObjects.c
r23649 r24243 98 98 99 99 //does the measurement pass the supplied filtering constraints? 100 if (!MeasFilterTest(&catalog[i].measure[m])) continue; 100 if (!MeasFilterTest(&catalog[i].measure[m])) { 101 catalog[i].measure[m].dbFlags &= ~ID_MEAS_USED_OBJ; 102 continue; 103 } 101 104 102 105 //outlier rejection 103 if (FlagOutliers && (catalog[i].measure[m].dbFlags & ID_MEAS_POOR_ASTROM)) { 106 if (FlagOutlier && (catalog[i].measure[m].dbFlags & ID_MEAS_POOR_ASTROM)) { 107 catalog[i].measure[m].dbFlags &= ~ID_MEAS_USED_OBJ; 104 108 continue; 105 109 } … … 114 118 # endif 115 119 120 catalog[i].measure[m].dbFlags |= ID_MEAS_USED_OBJ; 121 116 122 R[N] = getMeanR (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); 117 123 D[N] = getMeanD (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); … … 141 147 if (N < SRC_MEAS_TOOFEW) { 142 148 // XXX need to define PHOTOM and ASTROM object flags 143 // catalog[i].average[j].code|= ID_STAR_FEW;144 continue;149 catalog[i].average[j].flags |= ID_STAR_FEW; 150 if (N < 2) continue; 145 151 } 146 152 … … 236 242 } 237 243 244 //make sure that the fit succeeded 245 assert(finite(fit.Ro) && finite(fit.Do) && 246 finite(fit.dRo) && finite(fit.dDo) && 247 finite(fit.uR) && finite(fit.uD) && 248 finite(fit.duR) && finite(fit.duD) && 249 finite(fit.p) && finite(fit.dp)); 250 238 251 // the measure fields must be updated before the average fields 239 252 m = catalog[i].average[j].measureOffset; -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/args.c
r23649 r24243 40 40 FIT_TARGET = TARGET_MOSAICS; 41 41 } 42 43 FlagOutlier = FALSE; 42 44 if ((N = get_argument (argc, argv, "-clip"))) { 43 45 remove_argument (N, &argc, argv); 46 CLIP_THRESH = atof (argv[N]); 47 remove_argument (N, &argc, argv); 44 48 FlagOutlier = TRUE; 45 49 } 50 46 51 if (FIT_TARGET == TARGET_NONE) usage(); 47 52 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/bcatalog.c
r23649 r24243 48 48 49 49 //filter objects based on user supplied criteria 50 if (!MeasFilterTest(&catalog[0].measure[offset])) continue; 50 if (!MeasFilterTest(&catalog[0].measure[offset])) { 51 catalog[0].measure[offset].dbFlags &= ~ID_MEAS_USED_CHIP; 52 continue; 53 } 51 54 52 55 //filter out outliers 53 if (FlagOutlier && (catalog[0].measure[offset].dbFlags & ID_MEAS_POOR_ASTROM)) continue; 54 56 if (FlagOutlier && (catalog[0].measure[offset].dbFlags & ID_MEAS_POOR_ASTROM)) { 57 catalog[0].measure[offset].dbFlags &= ~ID_MEAS_USED_CHIP; 58 continue; 59 } 60 catalog[0].measure[offset].dbFlags |= ID_MEAS_USED_CHIP; 61 55 62 // re-assess on each run of relastro if a measurement should be used 56 63 … … 73 80 subcatalog[0].measure[Nmeasure].dbFlags &= ~ID_MEAS_AREA; 74 81 } 82 75 83 Nmeasure ++; 76 84 Nm ++; -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/load_catalogs.c
r23649 r24243 32 32 //outlier rejection 33 33 if (FlagOutlier) { 34 FlagOutliers(&tcatalog , 1);34 FlagOutliers(&tcatalog); 35 35 } 36 36 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastroVisual.c
r23344 r24243 16 16 17 17 static int isVisual = FALSE; 18 static int plotRawRef = TRUE; 19 static int plotScatter = TRUE; 20 static int plotResid = TRUE; 21 static int plotVector = TRUE; 18 static int plotRawRef = FALSE; 19 static int plotScatter = FALSE; 20 static int plotResid = FALSE; 21 static int plotVector = FALSE; 22 static int plotOutliers = TRUE; 22 23 23 24 /** Spawn a kapa window */ … … 75 76 float xVec[], float yVec[], 76 77 int npts, int *kapaID) { 77 if (! plotResid) return 1;78 if (!isVisual || !plotResid) return TRUE; 78 79 Graphdata graphdata; 79 80 KapaSection section; 80 81 81 if (!initWindow(kapaID)) return 0;82 if (!initWindow(kapaID)) return FALSE; 82 83 83 84 KapaInitGraph(&graphdata); … … 389 390 return 1; 390 391 } 392 393 int relastroVisualPlotOutliers(Catalog *catalog, int offset, int Nmeasure, 394 StatType statsR, StatType statsD, double thresh) { 395 396 float *Din, *Rin, *Dout, *Rout; 397 double xmin, xmax, ymin, ymax, range; 398 float xCirc[100], yCirc[100]; 399 int m, i; 400 int Nin, Nout; 401 Measure meas; 402 Graphdata graphdata; 403 KapaSection section; 404 405 if (!isVisual || !plotOutliers) return 1; 406 if (!initWindow(&kapa)) return 0; 407 408 // populate vectors 409 ALLOCATE(Din, float, Nmeasure); 410 ALLOCATE(Rin, float, Nmeasure); 411 ALLOCATE(Dout, float, Nmeasure); 412 ALLOCATE(Rout, float, Nmeasure); 413 414 //create the threshhold ellipse 415 for(i = 0; i < 100; i++) { 416 xCirc[i] = statsR.median + thresh * statsR.sigma * cos(2 * 3.14 / 99. * i); 417 yCirc[i] = statsD.median + thresh * statsD.sigma * sin(2 * 3.14 / 99. * i); 418 } 419 420 m = offset; 421 Nin = Nout = 0; 422 xmin = +FLT_MAX; 423 xmax = -FLT_MAX; 424 ymax = -FLT_MAX; 425 ymin = +FLT_MAX; 426 for(i = 0; i < Nmeasure; i++, m++) { 427 meas = catalog[0].measure[m]; 428 if (!MeasFilterTest(&meas)) continue; 429 xmin = MIN(xmin, meas.dR); 430 xmax = MAX(xmax, meas.dR); 431 ymin = MIN(ymin, meas.dD); 432 ymax = MAX(ymax, meas.dD); 433 434 if (meas.dbFlags & ID_MEAS_POOR_ASTROM) { 435 Rout[Nout] = (float)(meas.dR); 436 Dout[Nout] = (float)(meas.dD); 437 fprintf(stderr, "r: %f\td: %f\t outlier: 1\n", Rout[Nout], Dout[Nout]); 438 Nout++; 439 } else { 440 Rin[Nin] = (float)(meas.dR); 441 Din[Nin] = (float)(meas.dD); 442 fprintf(stderr, "r: %f\td: %f\t outlier: 0\n", Rin[Nin], Din[Nin]); 443 Nin++; 444 } 445 } 446 447 range = (xmax - xmin); 448 xmin -= .1 * range; 449 xmax += .1 * range; 450 range = (ymax - ymin); 451 ymax += .1 * range; 452 ymin -= .1 * range; 453 454 //temporary fix 455 xmin = -1; xmax = 1; ymin = -1; ymax = 1; 456 457 458 //initialize graph info 459 section.x = 0; section.y = 0; section.dx = 1; section.dy = 1; 460 section.name = "junk"; 461 462 KapaInitGraph(&graphdata); 463 KapaClearPlots(kapa); 464 KapaSetFont(kapa, "helvetica", 14); 465 466 graphdata.ptype = 7; 467 graphdata.style = 2; 468 graphdata.size = 3; 469 graphdata.xmin = xmin; 470 graphdata.xmax = xmax; 471 graphdata.ymin = ymin; 472 graphdata.ymax = ymax; 473 474 KapaSetSection(kapa, §ion); 475 KapaSetLimits(kapa, &graphdata); 476 KapaBox(kapa, &graphdata); 477 478 KapaSendLabel( kapa, "RA (arcsec)", KAPA_LABEL_XM); 479 KapaSendLabel( kapa, "Dec (arcsec)", KAPA_LABEL_YM); 480 KapaSendLabel( kapa, "Points flagged as outliers (red)", 481 KAPA_LABEL_XP); 482 483 graphdata.color = KapaColorByName("green"); 484 KapaPrepPlot(kapa, Nin, &graphdata); 485 KapaPlotVector(kapa, Nin, Rin, "x"); 486 KapaPlotVector(kapa, Nin, Din, "y"); 487 488 graphdata.color = KapaColorByName("red"); 489 KapaPrepPlot(kapa, Nout, &graphdata); 490 KapaPlotVector(kapa, Nout, Rout, "x"); 491 KapaPlotVector(kapa, Nout, Dout, "y"); 492 493 graphdata.color = KapaColorByName("black"); 494 graphdata.ptype = 0; 495 graphdata.style = 0; 496 KapaPrepPlot(kapa, 100, &graphdata); 497 KapaPlotVector(kapa, 100, xCirc, "x"); 498 KapaPlotVector(kapa, 100, yCirc, "y"); 499 500 501 502 askUser(&plotOutliers); 503 504 FREE(Rout); 505 FREE(Dout); 506 FREE(Rin); 507 FREE(Din); 508 509 return TRUE; 510 } 511 512 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastroVisual.h
r23344 r24243 4 4 int relastroVisualPlotRawRef(StarData *raw, StarData *ref, double dRmax, int numObj); 5 5 int relastroVisualPlotScatter(double values[], double thresh, int npts); 6 int relastroVisualPlotOutliers(Catalog *catalog, int offset, int Nmeasure, 7 StatType statsR, StatType statsD, double thresh); 6 8 7 9 #endif -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastro_objects.c
r23650 r24243 9 9 Catalog catalog; 10 10 11 //CNB12 fprintf(stderr, "beginning relastro objects\n");13 11 14 12 // load the current sky table (layout of all SkyRegions) … … 19 17 skylist = SkyListByPatch (sky, -1, &UserPatch); 20 18 21 //CNB22 fprintf(stder, "looping over skylist regions\n");23 19 // load data from each region file, only use bright stars 24 20 for (i = 0; i < skylist[0].Nregions; i++) { … … 42 38 } 43 39 44 if (FlagOutlier s) {45 FlagOutliers(&catalog , 1);40 if (FlagOutlier) { 41 FlagOutliers(&catalog); 46 42 } 47 43 … … 57 53 } 58 54 59 //CNB60 fprintf(stderr, "updating objects\n");61 55 UpdateObjects (&catalog, 1); 62 56 -
branches/cnb_branches/cnb_branch_20090301/ppImage
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/ppStack
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/ppSub
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/psModules
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/psModules/src/astrom/pmAstrometryModel.c
r19595 r24243 471 471 char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 472 472 if (!thisone) continue; 473 if (!strcmp (name, thisone)) return (chip);473 if (!strcmp (name, thisone)) return (chip); 474 474 } 475 475 return NULL; -
branches/cnb_branches/cnb_branch_20090301/psastro
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/psastro/src/psastroModel.c
r21409 r24243 46 46 exit (1); 47 47 } 48 48 49 49 // run the full astrometry analysis (chip and/or mosaic) 50 50 if (!psastroModelAdjust (config)) { … … 52 52 exit (1); 53 53 } 54 54 55 55 // save the model 56 56 if (!psastroModelDataSave (config)) { -
branches/cnb_branches/cnb_branch_20090301/psphot
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpVersion.c
r23352 r24243 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ 12 13 12 #ifdef HAVE_CONFIG_H 14 13 #include <config.h> … … 20 19 #include <psphot.h> 21 20 #include <ppStats.h> 22 #include "pswarp.h"23 24 21 25 22 psString pswarpVersion(void)
Note:
See TracChangeset
for help on using the changeset viewer.
