IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37572


Ignore:
Timestamp:
Nov 9, 2014, 8:25:06 AM (12 years ago)
Author:
eugene
Message:

moved BuildChipMatch into LoadImagesDVO, and added the loading of the astrom offset table

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

Legend:

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

    r37563 r37572  
    172172int AstromOffsetTableMatchChips (Image *images, off_t Nimages, AstromOffsetTable *table);
    173173AstromOffsetTable *AstromOffsetTableInit();
     174void AstromOffsetTableFree(AstromOffsetTable *table);
    174175
    175176# endif
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c

    r37563 r37572  
    6969}
    7070
     71void AstromOffsetTableFree (AstromOffsetTable *table) {
     72
     73  if (!table) return;
     74
     75  int i, j;
     76  for (i = 0; i < table->Nmap; i++) {
     77    for (j = 0; j < table->map[i][0].Nx; j++) {
     78      free (table->map[i][0].dXv);
     79      free (table->map[i][0].dYv);
     80    }
     81    free (table->map[i]);
     82    free (table->map[i][0].dXv[j]);
     83    free (table->map[i][0].dYv[j]);
     84  }
     85  free (table->IDtoSeq);
     86  free (table->map);
     87}
     88
    7189int AstromOffsetTableNewMap (AstromOffsetTable *table, int order, Image *image) {
    7290
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/LoadImages.c

    r33649 r37572  
    99static Image *imageCache = NULL;
    1010static off_t cacheNimage = 0;
     11AstromOffsetTable *table = NULL;
    1112
    1213static time_t getLastModified(char *filename);
     
    3940    lastModified = 0;
    4041  }
    41 
    4242
    4343  gfits_db_init (&db);
     
    7777  }
    7878
     79  // assign image->parent and image->coords.mosaic
     80  BuildChipMatch (image, *Nimage);
     81  // MARKTIME("build chip match: %f sec\n", dtime);
     82
     83  char mapfile[DVO_MAX_PATH];
     84  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", catdir);
     85
     86  if (table) AstromOffsetTableFree(table);
     87  table = AstromOffsetMapLoad (mapfile, FALSE);
     88
     89  // assign images.coords.offsetMap -> table->map[i]
     90  if (table) {
     91    AstromOffsetTableMatchChips (image, *Nimage, table);
     92  }
     93
    7994  return (image);
    8095}
     
    92107  if (!dvoUseImageCache && (images != NULL)) {
    93108    free(images);
     109    AstromOffsetTableFree (table);
    94110  } else {
    95111    // defer free until next LoadImages with a different or modified Images.dat
Note: See TracChangeset for help on using the changeset viewer.