IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37664


Ignore:
Timestamp:
Nov 23, 2014, 5:04:15 AM (12 years ago)
Author:
eugene
Message:

pass chip astrom map back and forth in region host mode

Location:
branches/eam_branches/ipp-20140904/Ohana/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h

    r37652 r37664  
    306306  Image *image;
    307307  off_t *imseq;
     308
     309  AstromOffsetTable *astromTable;
    308310
    309311  int *neighbors;             // list of neighbor index values
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h

    r37572 r37664  
    173173AstromOffsetTable *AstromOffsetTableInit();
    174174void AstromOffsetTableFree(AstromOffsetTable *table);
     175int AstromOffsetTableAddMapFromImage (AstromOffsetTable *table, Image *image);
    175176
    176177# endif
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c

    r37575 r37664  
    122122}
    123123
     124int AstromOffsetTableAddMapFromImage (AstromOffsetTable *table, Image *image) {
     125
     126  int Nmap = table->Nmap;
     127
     128  table->Nmap++;
     129  REALLOCATE (table->map, AstromOffsetMap *, table->Nmap);
     130
     131  // find the imageID and update the IDtoSeq allocation if needed
     132  off_t i;
     133  if (image->imageID > table->MaxImageID) {
     134    int oldMaxID = table->MaxImageID;
     135    table->MaxImageID = image->imageID;
     136    REALLOCATE (table->IDtoSeq, int, table->MaxImageID + 1);
     137    for (i = oldMaxID + 1; i < table->MaxImageID + 1; i++) {
     138      table->IDtoSeq[i] = -1;
     139    }
     140  }
     141  myAssert (table->IDtoSeq[image->imageID] == -1, "table IDtoSeq not initiazed or image collision");
     142  table->IDtoSeq[image->imageID] = Nmap;
     143 
     144  table->map[Nmap] = image[0].coords.offsetMap;
     145  return TRUE;   
     146}
     147
    124148AstromOffsetTable *AstromOffsetTableInit() {
    125149
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/RegionHostTable.c

    r36630 r37664  
    3131    hosts[i].Nneighbors = 0;
    3232    hosts[i].isNeighbor = FALSE;
     33
     34    hosts[i].astromTable = NULL;
    3335  }
    3436  return;
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h

    r37663 r37664  
    583583int save_astrom_table ();
    584584AstromOffsetTable *get_astrom_table ();
     585void put_astrom_table (AstromOffsetTable *myTable);
    585586
    586587int fit_map (AstromOffsetMap *map, StarData *raw, StarData *ref, int Npts);
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/assign_images.c

    r37662 r37664  
    2323  BuildChipMatch (image, Nimage);
    2424  MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime);
     25
     26  char mapfile[DVO_MAX_PATH];
     27  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
     28  AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, VERBOSE);
     29
     30  // assign images.coords.offsetMap -> table->map[i]
     31  if (table) {
     32    AstromOffsetTableMatchChips (image, Nimage, table);
     33  } else {
     34    table = AstromOffsetTableInit ();
     35  }
     36  put_astrom_table (table);
    2537
    2638  initMosaics (image, Nimage);
     
    160172        host->astromTable = AstromOffsetTableInit();
    161173      }
    162       AstromOffsetTableAddMapFromImage(host->astromTable, image[j]);
     174      AstromOffsetTableAddMapFromImage(host->astromTable, &image[j]);
    163175    }
    164176  }
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c

    r37662 r37664  
    6666
    6767      // write the image subset for this host
    68       AstromOffsetMapTableSave (host->astromTable, mapname);
     68      AstromOffsetMapSave (host->astromTable, mapname);
    6969    }
    7070
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c

    r37662 r37664  
    4141   
    4242    // write the image subset for this host
    43     AstromOffsetMapTableSave (table, mapname);
     43    AstromOffsetMapSave (table, mapname);
    4444  }
    4545
     
    5353int slurp_image_pos (RegionHostTable *regionHosts, int nloop) {
    5454
    55   off_t Nimage, i;
     55  off_t Nimage, i, j;
    5656  Image *images = getimages (&Nimage, NULL);
    5757
     
    9595  // load the astrometry offset maps, if they exist, and apply
    9696  for (i = 0; i < regionHosts->Nhosts; i++) {
     97    if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
     98    if (REGION_HOST_ID && !regionHosts->hosts[i].isNeighbor) continue;
     99
    97100    char mapname[1024];
    98101    snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
     
    103106    for (j = 0; j < table->Nmap; j++) {
    104107      off_t seq = getImageByID (table->map[j][0].imageID);
     108      // I do not necessarily own all images listed in the table.  skip if not found
     109      if (seq < 0) continue;
     110
    105111      images[seq].coords.offsetMap = table->map[j];
    106112      // is this sufficient?
  • branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/ImageTable.c

    r37593 r37664  
    3232  }
    3333
    34   // XXX do not make the chip match -- we have not loaded the PHU entries
     34  // XXX do not make the chip match -- we have not loaded the PHU entries (and do not need them here)
    3535  // BuildChipMatch (image, Nimage);
    3636
Note: See TracChangeset for help on using the changeset viewer.