IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39446


Ignore:
Timestamp:
Mar 10, 2016, 6:12:05 AM (10 years ago)
Author:
eugene
Message:

attempt to free image data if possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20160226/src/relastro/src/load_images.c

    r39439 r39446  
    2727  MARKTIME("build chip match: %f sec\n", dtime);
    2828
    29   char mapfile[DVO_MAX_PATH];
    30   snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
    31   table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
    32 
    33   // assign images.coords.offsetMap -> table->map[i]
    34   if (table) {
    35     AstromOffsetTableMatchChips (image, Nimage, table);
    36   } else {
    37     table = AstromOffsetTableInit ();
    38   }
    39 
    4029  // select the images which overlap the selected sky regions
    4130  if (UseAllImages) {
     
    5443  }
    5544   
     45  /* unlock, if we can (else, unlocked below) and free, if we can */
     46  int unlockImages = !UPDATE || (RELASTRO_OP == OP_UPDATE_OFFSETS);
     47  if (unlockImages) {
     48    if (subset != image) {
     49      // if we have generated an image subset and we are running UPDATE_OFFSETS, the we can free images here
     50      free (image);
     51      db[0].ftable.buffer = NULL;
     52      BuildChipMatch (subset, Nsubset);
     53    }
     54    dvo_image_unlock (db);
     55  }
     56
     57  char mapfile[DVO_MAX_PATH];
     58  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
     59  table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
     60
     61  // assign images.coords.offsetMap -> table->map[i]
     62  if (table) {
     63    AstromOffsetTableMatchChips (subset, Nsubset, table);
     64  } else {
     65    table = AstromOffsetTableInit ();
     66  }
     67
    5668  initImages (subset, LineNumber, Nsubset);
    5769  MARKTIME("  init images: %f sec\n", dtime);
     
    6072  MARKTIME("  init mosaics: %f sec\n", dtime);
    6173 
    62   /* unlock, if we can (else, unlocked below) */
    63   int unlockImages = !UPDATE || (RELASTRO_OP == OP_UPDATE_OFFSETS);
    64   if (unlockImages) dvo_image_unlock (db);
    65 
    6674  return TRUE;
    6775}
Note: See TracChangeset for help on using the changeset viewer.