IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39693


Ignore:
Timestamp:
Sep 13, 2016, 12:31:29 PM (10 years ago)
Author:
eugene
Message:

add code to repair stacks and to repair the psps object IDs

Location:
trunk/Ohana/src/relastro
Files:
2 added
6 edited

Legend:

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

    r39619 r39693  
    2626RELASTRO = \
    2727$(SRC)/CheckMeasureToImage.$(ARCH).o \
     28$(SRC)/RepairObjectIDs.$(ARCH).o \
     29$(SRC)/RepairStacks.$(ARCH).o \
    2830$(SRC)/RepairStackMeasures.$(ARCH).o \
    2931$(SRC)/StackImageMaps.$(ARCH).o \
     
    114116RELASTRO_CLIENT = \
    115117$(SRC)/CheckMeasureToImage.$(ARCH).o \
     118$(SRC)/RepairObjectIDs.$(ARCH).o \
     119$(SRC)/RepairStacks.$(ARCH).o \
    116120$(SRC)/RepairStackMeasures.$(ARCH).o \
    117121$(SRC)/StackImageMaps.$(ARCH).o \
  • trunk/Ohana/src/relastro/include/relastro.h

    r39619 r39693  
    3131typedef enum {FIT_NONE, FIT_AVERAGE, FIT_PM_ONLY, FIT_PAR_ONLY, FIT_PM_AND_PAR} FitMode;
    3232
    33 typedef enum {OP_NONE, OP_IMAGES, OP_HIGH_SPEED, OP_MERGE_SOURCE, OP_UPDATE_OBJECTS, OP_UPDATE_OFFSETS, OP_LOAD_OBJECTS, OP_HPM, OP_PARALLEL_REGIONS, OP_PARALLEL_IMAGES, OP_REPAIR_WARPS} RelastroOp;
     33typedef enum {OP_NONE, OP_IMAGES, OP_HIGH_SPEED, OP_MERGE_SOURCE, OP_UPDATE_OBJECTS, OP_UPDATE_OFFSETS, OP_LOAD_OBJECTS, OP_HPM, OP_PARALLEL_REGIONS, OP_PARALLEL_IMAGES, OP_REPAIR_STACKS, OP_REPAIR_WARPS, OP_REPAIR_OBJECT_ID} RelastroOp;
    3434
    3535typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS} FitTarget;
     
    864864uint64_t CreatePSPSDetectionID(double tobs, int ccdid, int detID);
    865865
     866int RepairStacks (SkyList *skylist, int hostID, char *hostpath);
     867
     868int RepairObjectIDs (SkyList *skylist, int hostID, char *hostpath);
     869
    866870void sort_by_ra (double *R, double *D, int *I, int *S, int N);
    867871void FreeStackGroups (void);
  • trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r39669 r39693  
    194194    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
    195195
    196     if (REPAIR_STACKS)          strextend (&command, "-repair-stacks");
     196    if (REPAIR_STACKS)          strextend (&command, "-repair-stacks-on-update");
    197197    if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures");
    198198
     
    327327    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
    328328
    329     if (REPAIR_STACKS)          strextend (&command, "-repair-stacks");
     329    if (REPAIR_STACKS)          strextend (&command, "-repair-stacks-on-update");
    330330    if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures");
    331331
  • trunk/Ohana/src/relastro/src/args.c

    r39619 r39693  
    5353  }
    5454
     55  if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     56    remove_argument (N, &argc, argv);
     57    RELASTRO_OP = OP_REPAIR_STACKS;
     58  }
     59  if ((N = get_argument (argc, argv, "-repair-object-id"))) {
     60    remove_argument (N, &argc, argv);
     61    RELASTRO_OP = OP_REPAIR_OBJECT_ID;
     62  }
     63
    5564  if ((N = get_argument (argc, argv, "-repair-warps"))) {
    5665    remove_argument (N, &argc, argv);
     
    5968
    6069  REPAIR_STACKS = FALSE;
    61   if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     70  if ((N = get_argument (argc, argv, "-repair-stacks-on-update"))) {
    6271    remove_argument (N, &argc, argv);
    6372    REPAIR_STACKS = TRUE;
     
    691700  }
    692701
     702  if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     703    remove_argument (N, &argc, argv);
     704    RELASTRO_OP = OP_REPAIR_STACKS;
     705  }
     706
     707  if ((N = get_argument (argc, argv, "-repair-object-id"))) {
     708    remove_argument (N, &argc, argv);
     709    RELASTRO_OP = OP_REPAIR_OBJECT_ID;
     710  }
     711
    693712  if ((N = get_argument (argc, argv, "-repair-warps"))) {
    694713    remove_argument (N, &argc, argv);
     
    697716
    698717  REPAIR_STACKS = FALSE;
    699   if ((N = get_argument (argc, argv, "-repair-stacks"))) {
     718  if ((N = get_argument (argc, argv, "-repair-stacks-on-update"))) {
    700719    remove_argument (N, &argc, argv);
    701720    REPAIR_STACKS = TRUE;
  • trunk/Ohana/src/relastro/src/relastro.c

    r39619 r39693  
    104104    }
    105105
     106    case OP_REPAIR_STACKS: {
     107      FITS_DB db;
     108      if (!PARALLEL) {
     109     
     110        set_db (&db);
     111        gfits_db_init (&db);
     112
     113        /* lock and load the image db table */
     114        int status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT);
     115        if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
     116        if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename);
     117        if (!dvo_image_load (&db, VERBOSE, FALSE)) Shutdown ("can't read image catalog %s", db.filename);
     118        // the raw FITS data is freed by dvo_image_load, leaving only the Image structure data
     119
     120        /* load regions and images based on specified sky patch (default depth) */
     121        load_images (&db, skylist, FALSE, USE_ALL_IMAGES);
     122      }
     123
     124      // iterate over catalogs to make detection coordinates consistant
     125      RepairStacks (skylist, 0, NULL);
     126
     127      if (!PARALLEL) {
     128        freeImages (db.ftable.buffer);
     129        gfits_db_free (&db);
     130        freeMosaics ();
     131      }
     132
     133      relastro_free (sky, skylist);
     134      exit (0);
     135    }
     136
     137    case OP_REPAIR_OBJECT_ID: {
     138
     139      // iterate over catalogs to make detection coordinates consistant
     140      RepairObjectIDs (skylist, 0, NULL);
     141
     142      relastro_free (sky, skylist);
     143      exit (0);
     144    }
     145
    106146    case OP_HIGH_SPEED:
    107147      /* high-speed is a 2pt cross-correlation process for linking moving objects (high PM) */
  • trunk/Ohana/src/relastro/src/relastro_client.c

    r39619 r39693  
    104104    }
    105105
     106    case OP_REPAIR_OBJECT_ID: {
     107
     108      // iterate over catalogs to make detection coordinates consistant
     109      RepairObjectIDs (skylist, HOST_ID, HOSTDIR);
     110
     111      relastro_free (sky, skylist);
     112      exit (0);
     113    }
     114
     115      // XXX loading the images is fairly costly -- see if we can do an image subset?
     116    case OP_REPAIR_STACKS: {
     117      FITS_DB db;
     118     
     119      set_db (&db);
     120      gfits_db_init (&db);
     121
     122      /* lock and load the image db table */
     123      int status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT);
     124      if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
     125      if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename);
     126      if (!dvo_image_load (&db, VERBOSE, FALSE)) Shutdown ("can't read image catalog %s", db.filename);
     127      // the raw FITS data is freed by dvo_image_load, leaving only the Image structure data
     128
     129      /* load regions and images based on specified sky patch (default depth) */
     130      load_images (&db, skylist, FALSE, USE_ALL_IMAGES);
     131
     132      RepairStacks (skylist, HOST_ID, HOSTDIR);
     133     
     134      freeImages (db.ftable.buffer);
     135      gfits_db_free (&db);
     136      freeMosaics ();
     137
     138      relastro_client_free (sky, skylist);
     139      break;
     140    }
     141
    106142      // XXX loading the images is fairly costly -- see if we can do an image subset?
    107143    case OP_REPAIR_WARPS: {
Note: See TracChangeset for help on using the changeset viewer.