IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 30, 2014, 8:38:47 AM (12 years ago)
Author:
eugene
Message:

moving to imageSeq

Location:
branches/eam_branches/ipp-20140904/Ohana/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/ImageOps.c

    r37684 r37697  
    2828static off_t        *imageIDs; // list of all image IDs
    2929static off_t        *imageIdx; // list of index for image IDs
    30 # else
     30
     31// as an alternative, we generate imageSeq, which directly maps imageID -> seq
     32static off_t        *imageSeq; // list of index for image IDs
     33
     34// MAX_ID requires 512M to store the image index
     35# define MAX_ID      0x8000000
     36static off_t         minImageID = MAX_ID;
     37static off_t         maxImageID = 0;
     38
     39# else /* not using IMAGE_ID */
    3140static unsigned int *start;
    3241static unsigned int *stop;
     
    8493    imageIdx[i] = i;
    8594    imageIDs[i] = image[i].imageID;
     95    minImageID = MIN(minImageID, image[i].imageID);
     96    maxImageID = MAX(maxImageID, image[i].imageID);
     97    myAssert (image[i].imageID < MAX_ID, "image IDs too large for index memory");
    8698  }
    8799  llsortpair (imageIDs, imageIdx, Nimage);
     100
     101  ALLOCATE (imageSeq, off_t, maxImageID + 1);
     102  for (i = 0; i < maxImageID + 1; i++)  {
     103    imageSeq[i] = -1; // not yet assigned
     104  }
     105
     106  for (i = 0; i < Nimage; i++) {
     107    off_t N = image[i].imageID;
     108    myAssert (imageSeq[N] == -1, "previously assigned");
     109    imageSeq[N] = i;
     110  }
     111
    88112# else
    89113  ALLOCATE (start, unsigned, Nimage);
     
    98122
    99123off_t getImageByID (off_t ID) {
     124# if USE_IMAGE_ID
     125
     126  if (imageSeq) {
     127    myAssert (ID >= minImageID, "oops");
     128    myAssert (ID <= maxImageID, "oops");
     129    off_t N = imageSeq[ID];
     130    return N;
     131  }
    100132
    101133  // we have a pair of vectors (imageIDs, imageIdx) sorted by imageIDs
    102134  // use bisection to find the specified image ID
    103135
    104 # if USE_IMAGE_ID
    105136  off_t Nlo, Nhi, N;
    106137
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateMeasures.c

    r37622 r37697  
    33// this function operates on Measure, not MeasureTiny
    44int UpdateMeasures (Catalog *catalog, int Ncatalog) {
     5
     6  off_t i, Nimage;
     7  Image *image;
     8
     9  int badImage =
     10    ID_IMAGE_ASTROM_NOCAL |
     11    ID_IMAGE_ASTROM_POOR |
     12    ID_IMAGE_ASTROM_FAIL |
     13    ID_IMAGE_ASTROM_SKIP |
     14    ID_IMAGE_ASTROM_FEW;
     15
     16  if (RESET_BAD_IMAGES) badImage = 0;
     17
     18  image = getimages (&Nimage, NULL);
     19
     20  for (i = 0; i < Ncatalog; i++) {
     21    for (j = 0; j < catalog[i].Nmeasure; j++) {
     22      MeasureTiny *measureT = &catalog[i].measureT[j];
     23      Measure     *measure  =  catalog[i].measure ? &catalog[i].measure[j] : NULL;
     24
     25      off_t im = getImageByID (measureT->imageID);
     26
     27      // check that we have the
     28
     29    // skip images that have failed solutions (divergent or otherwise)
     30    // XXX apply this or not??
     31    if (FALSE && (image[i].flags & badImage)) continue;
     32
     33  }
     34
     35  // printNcatTotal ();
     36
     37  return (TRUE);
     38}
     39
     40// this function operates on Measure, not MeasureTiny
     41int UpdateMeasuresOld (Catalog *catalog, int Ncatalog) {
    542
    643  off_t i, Nimage;
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_client.c

    r36833 r37697  
    7979      load_images (&db, skylist, FALSE);
    8080     
     81      // I can free the database after I have loaded the images...
     82
    8183      // // load the image subset table from the specified location
    8284      // off_t Nimage;
  • branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/ImageOps.c

    r37116 r37697  
    3535static off_t        *imageIdx; // list of index for image IDs
    3636
     37// QQ // as an alternative, we generate imageSeq, which directly maps imageID -> seq
     38// QQ static off_t        *imageSeq; // list of index for image IDs
     39// QQ
     40// QQ // MAX_ID requires 512M to store the image index
     41// QQ # define MAX_ID 0x8000000
     42// QQ static off_t         minImageID = MAX_ID;
     43// QQ static off_t         maxImageID = 0;
     44
    3745// elsewhere, we have loaded a set of catalogs with measures (catalog[cat].measure[meas])
    3846// each image has N_onImage[ImageIndex] measurements
     
    95103
    96104    TessellationIDsByImageName (&tessID[i], &projectID[i], &skycellID[i], image[i].name);
     105
     106    // QQ minImageID = MIN(minImageID, image[i].imageID);
     107    // QQ maxImageID = MAX(maxImageID, image[i].imageID);
     108    // QQ myAssert (image[i].imageID < MAX_ID, "image IDs too large for index memory");
    97109  }
    98110
     
    100112  // XXX does this break the imageID <-> projectID, etc match?
    101113  llsortpair (imageIDs, imageIdx, Nimage);
     114
     115  // QQ ALLOCATE (imageSeq, off_t, maxImageID + 1);
     116  // QQ for (i = 0; i < maxImageID + 1; i++)  {
     117  // QQ   imageSeq[i] = -1; // not yet assigned
     118  // QQ }
     119  // QQ
     120  // QQ for (i = 0; i < Nimage; i++) {
     121  // QQ   off_t N = image[i].imageID;
     122  // QQ   myAssert (imageSeq[N] == -1, "previously assigned");
     123  // QQ   imageSeq[N] = i;
     124  // QQ }
    102125}
    103126
     
    167190
    168191off_t getImageByID (off_t ID) {
     192
     193  // QQ  if (imageSeq) {
     194  // QQ    myAssert (ID >= minImageID, "oops");
     195  // QQ    myAssert (ID <= maxImageID, "oops");
     196  // QQ    off_t N = imageSeq[ID];
     197  // QQ    return N;
     198  // QQ  }
    169199
    170200  // we have a pair of vectors (imageIDs, imageIdx) sorted by imageIDs
  • branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/relphot_parallel_regions.c

    r37593 r37697  
    5555  /* launch processing on the parallel region hosts */
    5656  if (!launch_region_hosts (regionHosts)) Shutdown ("error launching region hosts");
     57  MARKTIME ("finished relphot -parallel-regions: %f sec total\n", dtime);
    5758
    5859  // retrieve updated image parameters from the remote hosts (also set Image.mcal)
Note: See TracChangeset for help on using the changeset viewer.