IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39642


Ignore:
Timestamp:
Jul 29, 2016, 11:46:14 AM (10 years ago)
Author:
eugene
Message:

add option to use all images rather than generating a subset

Location:
trunk/Ohana/src/relphot
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/include/relphot.h

    r39641 r39642  
    355355char *UserCatalog;
    356356
     357int USE_ALL_IMAGES;
    357358int USE_BASIC_CHECK;
    358359int USE_FULL_OVERLAP;
     
    437438Catalog      *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog, char *syncfile));
    438439
    439 int           load_images         PROTO((FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages));
     440int           load_images         PROTO((FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages, int UseAllImages));
    440441Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, char *inSubset, off_t **LineNumber, off_t *Nimage, SkyRegion *region));
    441442
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r39641 r39642  
    615615void setMcal (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) {
    616616
    617   off_t i, j, m, c, n, N, Nmax;
     617  off_t i, j, m, c, n, Nmax;
    618618  int mark, bad, Nfew, Nbad, Nmos, Nrel, Ngrid, Nsys;
    619619  float Msys, Mrel, Mmos, Mgrid, Mflat;
     
    787787    if (PLOTSTUFF) {
    788788      fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].Mcal, image[i].dMcal);
    789       plot_setMcal (refStars->flxlist, N, &stats, CLOUD_TOLERANCE);
     789      plot_setMcal (refStars->flxlist, Nref, &stats, CLOUD_TOLERANCE);
    790790    }
    791791
  • trunk/Ohana/src/relphot/src/args.c

    r39641 r39642  
    5656    UserCatalog = strcreate (argv[N]);
    5757    remove_argument (N, &argc, argv);
     58  }
     59
     60  // If we are looking at the whole sky (or whole relevant sky), use the full image table
     61  // -- this save substantial memory.  this could be automatic if the skyregion covers
     62  // more than 2pi.
     63  USE_ALL_IMAGES = FALSE;
     64  if ((N = get_argument (argc, argv, "-use-all-images"))) {
     65    remove_argument (N, &argc, argv);
     66    USE_ALL_IMAGES = TRUE;
    5867  }
    5968
     
    603612  }
    604613
     614  USE_ALL_IMAGES = FALSE;
     615  if ((N = get_argument (argc, argv, "-use-all-images"))) {
     616    remove_argument (N, &argc, argv);
     617    USE_ALL_IMAGES = TRUE;
     618  }
     619
    605620  USE_BASIC_CHECK = FALSE;
    606621  if ((N = get_argument (argc, argv, "-basic-image-search"))) {
  • trunk/Ohana/src/relphot/src/load_images.c

    r39481 r39642  
    55// This function generates a subset of the images based on selections.  Input db has already
    66// been loaded with the raw fits table data
    7 int load_images (FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages) {
     7int load_images (FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages, int UseAllImages) {
    88
    99  Image     *image, *subset;
     
    3131
    3232  // select the images which overlap the selected sky regions
    33   // 'subset' points to a new copy of the data (different from 'image')
    34   subset = select_images (skylist, image, Nimage, inSubset, &LineNumber, &Nsubset, region);
    35   MARKTIME("selected %d overlapping images: %f sec\n", (int) Nsubset, dtime);
     33  // 'subset' points to a new copy of the data (different from 'image') if a subset is selected
     34  if (UseAllImages) {
     35    ALLOCATE (LineNumber, off_t, Nimage);
     36    for (off_t i = 0; i < Nimage; i++) {
     37      LineNumber[i] = i;
     38      inSubset[i] = TRUE;
     39    }
     40    subset  = image;
     41    Nsubset = Nimage;
     42  } else {
     43    subset = select_images (skylist, image, Nimage, inSubset, &LineNumber, &Nsubset, region);
     44    MARKTIME("selected %d overlapping images: %f sec\n", (int) Nsubset, dtime);
    3645
    37   if (Nimage == 0) {
    38     fprintf (stderr, "no images selected for analysis : problem with region or photcode?\n");
    39     exit (4);
     46    if (Nimage == 0) {
     47      fprintf (stderr, "no images selected for analysis : problem with region or photcode?\n");
     48      exit (4);
     49    }
     50
     51    if (Nsubset == Nimage) {
     52      free (subset);
     53      subset = image;
     54    }
    4055  }
    4156
  • trunk/Ohana/src/relphot/src/relphot_images.c

    r39641 r39642  
    3939
    4040  /* load regions and images based on specified sky patch and/or catalog */
    41   load_images (&db, skylist, &UserPatch, FALSE);
     41  load_images (&db, skylist, &UserPatch, FALSE, USE_ALL_IMAGES);
    4242  MARKTIME("-- load images: %f sec\n", dtime);
    4343
  • trunk/Ohana/src/relphot/src/relphot_objects.c

    r39632 r39642  
    3838
    3939  /* load regions and images based on specified sky patch (default depth) */
    40   load_images (&db, skylist, &UserPatch, TRUE);
     40  load_images (&db, skylist, &UserPatch, TRUE, USE_ALL_IMAGES);
    4141  MARKTIME("loaded images: %f sec\n", dtime);
    4242
     
    249249    if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); }
    250250    if (USE_BASIC_CHECK)   { strextend (&command, "-basic-image-search"); }
     251    if (USE_ALL_IMAGES)    { strextend (&command, "-use-all-images"); }
    251252
    252253    if (!(STAGES & STAGE_CHIP))  { strextend (&command, "-skip-chip"); }
Note: See TracChangeset for help on using the changeset viewer.