IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35671


Ignore:
Timestamp:
Jun 18, 2013, 12:41:02 PM (13 years ago)
Author:
eugene
Message:

add option to include bad images when applying offsets (needed for a general reset); add some test options and count the number of modified detections; when doing UpdateObjectOffsets, do not require images to completely overlap a region (want to update all detections in the region); allow relastro clients to run on only the needed hosts

Location:
branches/eam_branches/ipp-20130509/Ohana/src/relastro
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/include/relastro.h

    r35669 r35671  
    161161
    162162int    RESET;
     163int    RESET_BAD_IMAGES;
    163164int    NLOOP;
    164165int    NTHREADS;
     
    278279int           liststats_pos       PROTO((double *value, double *dvalue, int N, StatType *stats, int XVERB));
    279280Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int subselect, int hostID, char *hostpath));
    280 int           load_images         PROTO((FITS_DB *db, SkyList *skylist));
    281 Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
     281int           load_images         PROTO((FITS_DB *db, SkyList *skylist, int UseFullOverlap));
     282Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap));
    282283
    283284void check_permissions (char *basefile);
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/ImageOps.c

    r35669 r35671  
    222222
    223223  ID = measure[0].imageID;
     224
     225  if (catalog[cat].measure) {
     226    Measure *measureBig = &catalog[cat].measure[meas];
     227    int TESTPT = FALSE;
     228    TESTPT |= (measureBig->imageID == CAT_ID_SRC) && (measureBig->detID == OBJ_ID_SRC);
     229    TESTPT |= (measureBig->imageID == CAT_ID_DST) && (measureBig->detID == OBJ_ID_DST);
     230    if (TESTPT) {
     231      fprintf (stderr, "got test det\n");
     232    }
     233  }
     234
    224235  idx = getImageByID (ID);
    225236  if (idx == -1) {
     
    379390}
    380391
     392static int NcatTotal = 0;
     393
    381394// return StarData values for detections in the specified image, converting coordinates from the
    382395// chip positions: X,Y -> L,M -> P,Q -> R,D
     
    445458
    446459    Measure *measure = &catalog[c].measure[m];
     460    MeasureTiny *measureT = &catalog[c].measureT[m];
     461
     462    int TESTPT = FALSE;
     463
     464    TESTPT |= (measure->imageID == CAT_ID_SRC) && (measure->detID == OBJ_ID_SRC);
     465    TESTPT |= (measure->imageID == CAT_ID_DST) && (measure->detID == OBJ_ID_DST);
     466    if (TESTPT) {
     467      fprintf (stderr, "got test det\n");
     468    }
    447469
    448470    if (USE_FIXED_PIXCOORDS) {
     
    517539      NoffDECori ++;
    518540      if (VERBOSE2) {
    519         fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f)\n", average[0].R, average[0].D, dR, measure[0].dD, dD);
     541        fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, measure[0].dD, dD);
    520542        dump_measures (&average[0], catalog[c].measure);
    521543      }      // abort();
     
    535557  }
    536558
     559  NcatTotal += nPos;
     560
    537561  int Noff = NoffRAave + NoffDECave + NoffRAori + NoffDECori;
    538562  if (VERBOSE && (Noff > 0)) fprintf (stderr, "Noff ave RA %d, Noff ave DEC %d, Noff ori RA %d, Noff ori DEC %d\n", NoffRAave, NoffDECave, NoffRAori, NoffDECori);
     
    540564
    541565  return;
     566}
     567
     568void printNcatTotal () {
     569  fprintf (stderr, "NcatTotal: %d\n", NcatTotal);
    542570}
    543571
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateMeasures.c

    r33652 r35671  
    11# include "relastro.h"
     2
     3void printNcatTotal ();
    24
    35// this function operates on Measure, not MeasureTiny
     
    1315    ID_IMAGE_ASTROM_SKIP |
    1416    ID_IMAGE_ASTROM_FEW;
     17
     18  if (RESET_BAD_IMAGES) badImage = 0;
    1519
    1620  image = getimages (&Nimage, NULL);
     
    2832  }
    2933
     34  printNcatTotal ();
     35
    3036  return (TRUE);
    3137}
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r35669 r35671  
    6565    freeImageBins (1);
    6666
     67    if (!UPDATE) {
     68      dvo_catalog_unlock (&catalog);
     69      dvo_catalog_free (&catalog);
     70      continue;
     71    }
     72   
    6773    // write the updated detections to disk
    6874    save_catalogs (&catalog, 1);
     
    8591  }   
    8692
    87   int i;
     93  int i, j;
    8894  for (i = 0; i < table->Nhosts; i++) {
     95
     96    if (sky->Nregions < table->Nhosts) {
     97      // do any of the regions want this host?
     98      int wantThisHost = FALSE;
     99      for (j = 0; j < sky->Nregions; j++) {
     100        if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {
     101          wantThisHost = TRUE;
     102          break;
     103        }
     104      }
     105      if (!wantThisHost) {
     106        // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);
     107        continue;
     108      }
     109    }
    89110
    90111    // ensure that the paths are absolute path names
     
    113134    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
    114135    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                    strcpy (command, tmpline); }
     136    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command);                    strcpy (command, tmpline); }
     137
     138    if (RESET_BAD_IMAGES) { snprintf (tmpline, 1024, "%s -reset-bad-images", command);               strcpy (command, tmpline); }
     139
    115140    if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  strcpy (command, tmpline); }
    116141    if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   strcpy (command, tmpline); }
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjects.c

    r35669 r35671  
    356356      float dPos = hypot (dXoff, dYoff);
    357357      if (dPos > MaxMeanOffset) {
     358        if (Noffset < 100) {
     359          fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", coords.crval1, coords.crval2, fit.Ro, fit.Do, dXoff, dYoff);
     360        }
    358361        Noffset ++;
    359362        continue;
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/args.c

    r35669 r35671  
    315315  }
    316316
     317  RESET_BAD_IMAGES = FALSE;
     318  if ((N = get_argument (argc, argv, "-reset-bad-images"))) {
     319    remove_argument (N, &argc, argv);
     320    RESET_BAD_IMAGES = TRUE;
     321  }
     322
    317323  UPDATE = FALSE;
    318324  if ((N = get_argument (argc, argv, "-update"))) {
     
    640646  }
    641647
     648  RESET_BAD_IMAGES = FALSE;
     649  if ((N = get_argument (argc, argv, "-reset-bad-images"))) {
     650    remove_argument (N, &argc, argv);
     651    RESET_BAD_IMAGES = TRUE;
     652  }
     653
    642654  UPDATE = FALSE;
    643655  if ((N = get_argument (argc, argv, "-update"))) {
    644656    remove_argument (N, &argc, argv);
    645657    UPDATE = TRUE;
    646   }
    647 
    648   // do not hold the lock on the Image table for relastro_client -update-offsets
    649   if (FIT_TARGET == TARGET_UPDATE_OFFSETS) {
    650     UPDATE = FALSE;
    651658  }
    652659
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/high_speed_catalogs.c

    r35669 r35671  
    8080// CATDIR is supplied globally
    8181# define DEBUG 1
    82 int high_speed_catalogs_parallel (SkyList *skylist) {
     82int high_speed_catalogs_parallel (SkyList *sky) {
    8383
    8484  // launch the setphot_client jobs to the parallel hosts
    8585
    8686  // load the list of hosts
    87   HostTable *table = HostTableLoad (CATDIR, skylist->hosts);
     87  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
    8888  if (!table) {
    89     fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", skylist->hosts, CATDIR);
     89    fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
    9090    exit (1);
    9191  }   
     
    9898  if (PARALLEL_OUTPUT) {
    9999    // load the list of hosts
    100     tableOut = HostTableLoad (HIGH_SPEED_DIR, skylist->hosts);
     100    tableOut = HostTableLoad (HIGH_SPEED_DIR, sky->hosts);
    101101    if (!tableOut) {
    102       fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", skylist->hosts, HIGH_SPEED_DIR);
     102      fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky->hosts, HIGH_SPEED_DIR);
    103103      exit (1);
    104104    }   
     
    109109  }
    110110
    111   int i;
     111  int i, j;
    112112  for (i = 0; i < table->Nhosts; i++) {
     113
     114    if (sky->Nregions < table->Nhosts) {
     115      // do any of the regions want this host?
     116      int wantThisHost = FALSE;
     117      for (j = 0; j < sky->Nregions; j++) {
     118        if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {
     119          wantThisHost = TRUE;
     120          break;
     121        }
     122      }
     123      if (!wantThisHost) {
     124        // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);
     125        continue;
     126      }
     127    }
    113128
    114129    // ensure that the paths are absolute path names
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/hpm_catalogs.c

    r35669 r35671  
    7878// CATDIR is supplied globally
    7979# define DEBUG 1
    80 int hpm_catalogs_parallel (SkyList *skylist) {
     80int hpm_catalogs_parallel (SkyList *sky) {
    8181
    8282  // launch the setphot_client jobs to the parallel hosts
    8383
    8484  // load the list of hosts
    85   HostTable *table = HostTableLoad (CATDIR, skylist->hosts);
     85  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
    8686  if (!table) {
    87     fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", skylist->hosts, CATDIR);
     87    fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
    8888    exit (1);
    8989  }   
     
    9696  if (PARALLEL_OUTPUT) {
    9797    // load the list of hosts
    98     tableOut = HostTableLoad (HIGH_SPEED_DIR, skylist->hosts);
     98    tableOut = HostTableLoad (HIGH_SPEED_DIR, sky->hosts);
    9999    if (!tableOut) {
    100       fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", skylist->hosts, HIGH_SPEED_DIR);
     100      fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky->hosts, HIGH_SPEED_DIR);
    101101      exit (1);
    102102    }   
     
    107107  }
    108108
    109   int i;
     109  int i, j;
    110110  for (i = 0; i < table->Nhosts; i++) {
     111
     112    if (sky->Nregions < table->Nhosts) {
     113      // do any of the regions want this host?
     114      int wantThisHost = FALSE;
     115      for (j = 0; j < sky->Nregions; j++) {
     116        if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {
     117          wantThisHost = TRUE;
     118          break;
     119        }
     120      }
     121      if (!wantThisHost) {
     122        // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);
     123        continue;
     124      }
     125    }
    111126
    112127    // ensure that the paths are absolute path names
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/load_images.c

    r33652 r35671  
    77  fprintf (stderr, MSG, __VA_ARGS__); }
    88
    9 int load_images (FITS_DB *db, SkyList *skylist) {
     9int load_images (FITS_DB *db, SkyList *skylist, int UseFullOverlap) {
    1010
    1111  Image     *image, *subset;
     
    2525
    2626  // select the images which overlap the selected sky regions
    27   subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset);
     27  subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, UseFullOverlap);
    2828  MARKTIME("  select images: %f sec\n", dtime);
    2929
     
    3535 
    3636  /* unlock, if we can (else, unlocked below) */
    37   if (!UPDATE) dvo_image_unlock (db);
     37  int unlockImages = !UPDATE || (FIT_TARGET == TARGET_UPDATE_OFFSETS);
     38  if (unlockImages) dvo_image_unlock (db);
    3839
    3940  return TRUE;
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro.c

    r35416 r35671  
    3939      // iterate over catalogs to make detection coordinates consistant
    4040      UpdateObjectOffsets (skylist, 0, NULL);
     41      exit (0);
    4142
    4243    default:
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_client.c

    r35416 r35671  
    7777
    7878      /* load regions and images based on specified sky patch (default depth) */
    79       load_images (&db, skylist);
     79      load_images (&db, skylist, FALSE);
    8080     
    8181      // // load the image subset table from the specified location
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_images.c

    r33652 r35671  
    2020  MARKTIME("load image data: %f sec\n", dtime);
    2121
    22   /* load regions and images based on specified sky patch (default depth) */
    23   load_images (&db, skylist);
     22  /* load regions and images based on specified sky patch (default depth) (require full overlap) */
     23  load_images (&db, skylist, TRUE);
    2424  MARKTIME("load images: %f sec\n", dtime);
    2525
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_objects.c

    r35669 r35671  
    110110  }   
    111111
    112   int i;
     112  int i, j;
    113113  for (i = 0; i < table->Nhosts; i++) {
     114
     115    if (sky->Nregions < table->Nhosts) {
     116      // do any of the regions want this host?
     117      int wantThisHost = FALSE;
     118      for (j = 0; j < sky->Nregions; j++) {
     119        if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {
     120          wantThisHost = TRUE;
     121          break;
     122        }
     123      }
     124      if (!wantThisHost) {
     125        // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);
     126        continue;
     127      }
     128    }
    114129
    115130    // ensure that the paths are absolute path names
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/select_images.c

    r34088 r35671  
    2222  fprintf (stderr, MSG, __VA_ARGS__); }
    2323
    24 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage) {
     24Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap) {
    2525 
    2626  Image *image;
     
    122122  for (i = 0; i < Ntimage; i++) {
    123123     
     124    if (FALSE && !strncmp(timage[i].name, "o5479g0238o", 10)) {
     125      fprintf (stderr, "test image 1\n");
     126    }
     127    if (FALSE && !strncmp(timage[i].name, "o6227g0311o", 10)) {
     128      fprintf (stderr, "test image 2\n");
     129    }
     130
    124131    /* select images by photcode, or equiv photcode, if specified */
    125132    if (NphotcodesKeep > 0) {
    126133      found = FALSE;
     134      // XXX this bit of code excludes DIS mosaics and should be fixed
    127135      for (k = 0; (k < NphotcodesKeep) && !found; k++) {
    128136        if (photcodesKeep[k][0].code == timage[i].photcode) found = TRUE;
     
    196204    if (RmaxImage < RminSkyRegion) continue;
    197205
    198     if (!strncmp(timage[i].name, "o5903g0638o", 10) && (timage[i].photcode == 10355)) {
     206    if (FALSE && !strncmp(timage[i].name, "o5903g0638o", 10) && (timage[i].photcode == 10355)) {
    199207      fprintf (stderr, "test image\n");
    200208    }
     
    203211    // images) XXX : if we calibrate the mosaic, require that the full mosaic be inside
    204212    // the region and all of its chips..
    205 # define FULL_OVERLAP 1
    206     if (FULL_OVERLAP && strcmp(&timage[i].coords.ctype[4], "-DIS")) {
     213    if (UseFullOverlap && strcmp(&timage[i].coords.ctype[4], "-DIS")) {
    207214      if (RmaxImage > UserPatch.Rmax) continue;
    208215      if (RminImage < UserPatch.Rmin) continue;
Note: See TracChangeset for help on using the changeset viewer.