IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39619 for trunk


Ignore:
Timestamp:
Jul 1, 2016, 10:09:40 AM (10 years ago)
Author:
eugene
Message:

add code to repair broken stack-to-image links; carefully check the chip, warp, stack measurement and image consistency

Location:
trunk/Ohana/src/relastro
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relastro/Makefile

    r39612 r39619  
    2525
    2626RELASTRO = \
     27$(SRC)/CheckMeasureToImage.$(ARCH).o \
     28$(SRC)/RepairStackMeasures.$(ARCH).o \
     29$(SRC)/StackImageMaps.$(ARCH).o \
    2730$(SRC)/RepairWarps.$(ARCH).o \
    2831$(SRC)/RepairWarpMeasures.$(ARCH).o \
     
    110113
    111114RELASTRO_CLIENT = \
     115$(SRC)/CheckMeasureToImage.$(ARCH).o \
     116$(SRC)/RepairStackMeasures.$(ARCH).o \
     117$(SRC)/StackImageMaps.$(ARCH).o \
    112118$(SRC)/RepairWarps.$(ARCH).o \
    113119$(SRC)/RepairWarpMeasures.$(ARCH).o \
  • trunk/Ohana/src/relastro/include/relastro.h

    r39612 r39619  
    257257
    258258typedef struct {
     259  int NStackFixExtID;
     260  int NStackFixImageID;
     261  int NstackBadCoords;
     262  int NstackFailRepair_v1;
     263  int NstackFailRepair_v2;
     264  int NstackFixCoords;
     265  int NstackMissImage;
     266  int NstackMissTime;
     267  int NstackNoImageID;
     268} StackRepairResult;
     269
     270typedef struct {
    259271  int NfixChipID;
    260272  int NfixStackID;
     
    269281} WarpRepairResult;
    270282
     283typedef struct {
     284  int NstackNoImageID;
     285  int NstackBadCoords;
     286  int NstackBadTime;
     287  int NstackBadImageCoords;
     288  int NwarpNoImageID;
     289  int NwarpBadCoords;
     290  int NwarpBadTime;
     291  int NwarpBadImageCoords;
     292  int NchipNoImageID;
     293  int NchipBadCoords;
     294  int NchipBadTime;
     295  int NchipBadImageCoords;
     296} CheckMeasureResult;
     297
    271298# define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM
    272299
     
    333360int    USE_ICRF_POLE;
    334361
     362int    REPAIR_STACKS;
    335363int    USE_IMAGE_COORDS_FOR_REPAIR;
    336364int    USE_ALL_IMAGES;
     365int    CHECK_MEASURE_TO_IMAGE;
    337366
    338367int    RESET;
     
    834863uint64_t CreatePSPSStackDetectionID(int sourceID, int imageID, int detID);
    835864uint64_t CreatePSPSDetectionID(double tobs, int ccdid, int detID);
     865
     866void sort_by_ra (double *R, double *D, int *I, int *S, int N);
     867void FreeStackGroups (void);
     868int GetStackSeq (Image *image, double Rstk, double Dstk, unsigned short photcode, float X, float Y);
     869int MakeStackIndex (void);
     870int RepairStackID (StackRepairResult *result, Image *image, double Rave, double Dave, Measure *measureB, MeasureTiny *measureT);
     871StackRepairResult RepairStackMeasures (Catalog *catalog);
     872int CheckMeasureToImage (Catalog *catalog);
  • trunk/Ohana/src/relastro/src/UpdateMeasures.c

    r39615 r39619  
    1111  image = getimages (&Nimage, NULL);
    1212
    13   // track measurements which are far from their original position (poor at pole)
    14   int NoffRAori = 0;
    15   int NoffDECori = 0;
     13  for (i = 0; i < Ncatalog; i++) {
    1614
    17   int NoffRAchip = 0;
    18   int NoffRAstack = 0;
    19   int NoffRAwarp = 0;
     15    // track measurements which are far from their original position (poor at pole)
     16    int NoffRAori = 0;
     17    int NoffDECori = 0;
    2018
    21   int NoffDECchip = 0;
    22   int NoffDECstack = 0;
    23   int NoffDECwarp = 0;
     19    int NoffRAchip = 0;
     20    int NoffRAstack = 0;
     21    int NoffRAwarp = 0;
    2422
    25   for (i = 0; i < Ncatalog; i++) {
     23    int NoffDECchip = 0;
     24    int NoffDECstack = 0;
     25    int NoffDECwarp = 0;
     26
    2627    myAssert (!catalog[i].Nmeasure || catalog[i].measureT, "programming error");
    2728    for (j = 0; j < catalog[i].Naverage; j++) {
     
    3536      MeasureTiny *measureT = &catalog[i].measureT[j];
    3637      Measure     *measureB = catalog[i].measure ? &catalog[i].measure[j] : NULL;
     38
     39      if (measureB->averef == 0x01a) {
     40        // fprintf (stderr, "test object\n");
     41      }
     42      if ((measureB->averef == 0x01a) && (measureB->detID == 0x000d469a)) {
     43        // fprintf (stderr, "example object\n");
     44      }
     45      if ((measureB->averef == 0x01e) && (measureB->detID == 0x000d487f)) {
     46        // fprintf (stderr, "example object\n");
     47      }
    3748
    3849      off_t im = getImageByID (measureT->imageID);
     
    111122      }
    112123    }
     124    if (VERBOSE) fprintf (stderr, "%s : Noff ori RA %d ( %d %d %d ), Noff ori DEC %d ( %d %d %d )\n", catalog[i].filename, NoffRAori, NoffRAchip, NoffRAstack, NoffRAwarp, NoffDECori, NoffDECchip, NoffDECstack, NoffDECwarp);
    113125  }
    114   // printNcatTotal ();
    115 
    116   if (VERBOSE) fprintf (stderr, "Noff ori RA %d ( %d %d %d ), Noff ori DEC %d ( %d %d %d )\n", NoffRAori, NoffRAchip, NoffRAstack, NoffRAwarp, NoffDECori, NoffDECchip, NoffDECstack, NoffDECwarp);
    117126
    118127  return (TRUE);
  • trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r39477 r39619  
    5757    findImages (&catalog, 1, FALSE);
    5858
     59    if (REPAIR_STACKS) RepairStackMeasures (&catalog);
     60
    5961    // update the detection coordinates using the new image parameters
    6062    UpdateMeasures (&catalog, 1);
     
    6365    // if Galaxy Motion Model correction is active, do not apply at this last stage
    6466    UpdateObjects (&catalog, 1, -1);
     67
     68    if (CHECK_MEASURE_TO_IMAGE) CheckMeasureToImage (&catalog);
    6569
    6670    free_tiny_values(&catalog);
     
    190194    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
    191195
     196    if (REPAIR_STACKS)          strextend (&command, "-repair-stacks");
     197    if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures");
     198
    192199    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
    193200    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
  • trunk/Ohana/src/relastro/src/args.c

    r39580 r39619  
    5656    remove_argument (N, &argc, argv);
    5757    RELASTRO_OP = OP_REPAIR_WARPS;
     58  }
     59
     60  REPAIR_STACKS = FALSE;
     61  if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     62    remove_argument (N, &argc, argv);
     63    REPAIR_STACKS = TRUE;
     64  }
     65  CHECK_MEASURE_TO_IMAGE = FALSE;
     66  if ((N = get_argument (argc, argv, "-check-measures"))) {
     67    remove_argument (N, &argc, argv);
     68    CHECK_MEASURE_TO_IMAGE = TRUE;
    5869  }
    5970
     
    683694    remove_argument (N, &argc, argv);
    684695    RELASTRO_OP = OP_REPAIR_WARPS;
     696  }
     697
     698  REPAIR_STACKS = FALSE;
     699  if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     700    remove_argument (N, &argc, argv);
     701    REPAIR_STACKS = TRUE;
     702  }
     703  CHECK_MEASURE_TO_IMAGE = FALSE;
     704  if ((N = get_argument (argc, argv, "-check-measures"))) {
     705    remove_argument (N, &argc, argv);
     706    CHECK_MEASURE_TO_IMAGE = TRUE;
    685707  }
    686708
  • trunk/Ohana/src/relastro/src/relastro.c

    r39580 r39619  
    4646      }
    4747
     48      if (REPAIR_STACKS && !PARALLEL) MakeStackIndex ();
     49
    4850      // iterate over catalogs to make detection coordinates consistant
    4951      UpdateObjectOffsets (skylist, 0, NULL);
     52
     53      if (REPAIR_STACKS && !PARALLEL) FreeStackGroups ();
    5054
    5155      if (!PARALLEL) {
  • trunk/Ohana/src/relastro/src/relastro_client.c

    r39580 r39619  
    9090      load_images (&db, skylist, FALSE, USE_ALL_IMAGES);
    9191
     92      if (REPAIR_STACKS) MakeStackIndex ();
     93
    9294      UpdateObjectOffsets (skylist, HOST_ID, HOSTDIR);
    9395     
     96      if (REPAIR_STACKS) FreeStackGroups ();
     97
    9498      freeImages (db.ftable.buffer);
    9599      gfits_db_free (&db);
Note: See TracChangeset for help on using the changeset viewer.