IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 28, 2014, 7:02:01 AM (12 years ago)
Author:
eugene
Message:

add support to copy & save coords with offsetmaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapIO.c

    r37680 r37683  
    142142    table->map[i][0].dX           = map_disk[i].dY;
    143143
     144    // since this was on disk, we obviously keep it
     145    table->map[i][0].keep         = TRUE;
     146
    144147    ALLOCATE (table->map[i][0].dXv, float *, map_disk[i].Nx);
    145148    ALLOCATE (table->map[i][0].dYv, float *, map_disk[i].Nx);
     
    167170  // assign the map values (this allocates just the area needed for each image, not the
    168171  // full 6x6, saving some memory while doing the analysis)
     172  // some maps in the table should be skipped because their image no longer uses them
     173  int Ndisk = 0;
    169174  for (i = 0; i < table->Nmap; i++) {
    170     map_disk[i].Nx       = table->map[i][0].Nx;
    171     map_disk[i].Ny       = table->map[i][0].Ny;
    172     map_disk[i].tableID  = table->map[i][0].tableID;
    173     map_disk[i].imageID  = table->map[i][0].imageID;
     175    if (!table->map[i][0].keep) continue;
     176    map_disk[Ndisk].Nx      = table->map[i][0].Nx;
     177    map_disk[Ndisk].Ny      = table->map[i][0].Ny;
     178    map_disk[Ndisk].tableID = table->map[i][0].tableID;
     179    map_disk[Ndisk].imageID = table->map[i][0].imageID;
    174180   
    175     map_disk[i].dX      = table->map[i][0].dX;
    176     map_disk[i].dY      = table->map[i][0].dY;
     181    map_disk[Ndisk].dX      = table->map[i][0].dX;
     182    map_disk[Ndisk].dY      = table->map[i][0].dY;
    177183
    178     for (j = 0; j < map_disk[i].Nx; j++) {
    179       for (k = 0; k < map_disk[i].Ny; k++) {
    180         map_disk[i].dXv[j][k] = table->map[i][0].dXv[j][k];
    181         map_disk[i].dYv[j][k] = table->map[i][0].dYv[j][k];
     184    for (j = 0; j < map_disk[Ndisk].Nx; j++) {
     185      for (k = 0; k < map_disk[Ndisk].Ny; k++) {
     186        map_disk[Ndisk].dXv[j][k] = table->map[i][0].dXv[j][k];
     187        map_disk[Ndisk].dYv[j][k] = table->map[i][0].dYv[j][k];
    182188      }
    183189    }
     190    Ndisk ++;
    184191  }
    185   *Nmap = table->Nmap;
     192  *Nmap = Ndisk;
    186193  return map_disk;
    187194}
Note: See TracChangeset for help on using the changeset viewer.