IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36558


Ignore:
Timestamp:
Feb 25, 2014, 3:32:57 PM (12 years ago)
Author:
eugene
Message:

parallel regions with mosaics works

Location:
branches/eam_branches/ipp-20140206/Ohana/src
Files:
10 edited

Legend:

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

    r36545 r36558  
    291291  double Dmin;
    292292  double Dmax;
     293
     294  double RminCat;
     295  double RmaxCat;
     296  double DminCat;
     297  double DmaxCat;
    293298
    294299  char *hostname;
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c

    r36530 r36558  
    1111    hosts[i].Dmin = NAN;
    1212    hosts[i].Dmax = NAN;
     13
     14    hosts[i].RminCat = NAN;
     15    hosts[i].RmaxCat = NAN;
     16    hosts[i].DminCat = NAN;
     17    hosts[i].DmaxCat = NAN;
    1318
    1419    hosts[i].hostname = NULL;
     
    122127    hosts[Nhosts].Dmin = Dmin;
    123128    hosts[Nhosts].Dmax = Dmax;
     129   
     130    hosts[Nhosts].RminCat = Rmin;
     131    hosts[Nhosts].RmaxCat = Rmax;
     132    hosts[Nhosts].DminCat = Dmin;
     133    hosts[Nhosts].DmaxCat = Dmax;
    124134   
    125135    table->Rmin = MIN(Rmin, table->Rmin);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/include/relphot.h

    r36545 r36558  
    214214int    PARALLEL_MANUAL;
    215215int    PARALLEL_SERIAL;
     216
     217int    PARALLEL_REGIONS_MANUAL;
    216218
    217219int    NTHREADS;
     
    314316void          findImages          PROTO((Catalog *catalog, int Ncatalog, int doImageList));
    315317int           findMosaics         PROTO((Catalog *catalog, int Ncatalog, int doMosaicList));
     318
     319void makeMosaics (Image *image, off_t Nimage);
     320Mosaic *getMosaicForImage (off_t im);
     321void setMosaicCenters (Image *image, off_t Nimage);
    316322
    317323void set_db (FITS_DB *in);
     
    467473int select_images_hostregion (RegionHostTable *hosts, Image *image, off_t Nimage);
    468474int find_host_for_coords (RegionHostTable *regionHosts, double R, double d);
     475int calculate_image_bounds (Image *image, double *rmin, double *rmax, double *dmin, double *dmax);
    469476
    470477int launch_region_hosts (RegionHostTable *regionHosts);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/MosaicOps.c

    r36516 r36558  
    320320}
    321321
     322/* find mosaic frames (unique time periods) (NOTE : we do NOT require matching photcodes but we
     323   match images by MOSAICNAME.  this last point is weak: it forces a single camera at a time.
     324   we can extend the logic to multiple cameras if we make list of MOSAICNAMES (better to assign a camera ID)
     325 */
     326void makeMosaics (Image *image, off_t Nimage) {
     327
     328  off_t i, j, status, found, NMOSAIC, *MosaicN_IMAGE;
     329  unsigned int start, stop, *startTimes, *startTimesMosaic;
     330  char *pname;
     331
     332  if (!MOSAIC_ZEROPT) return;
     333
     334  INITTIME;
     335
     336  /* a 'mosaic' in relphot is (unlike relastro) a virtual concept: there is no
     337   * entry in the image table that represents this mosaic.  Instead, it is an
     338   * internal construct that defines a group of related images
     339   */
     340
     341  // generate a list of all image start times
     342  ALLOCATE (startTimes, unsigned int, Nimage);
     343  for (i = 0; i < Nimage; i++) {
     344    startTimes[i] = image[i].tzero;
     345  }
     346  sort_times (startTimes, Nimage);
     347  MARKTIME("create array of all image obstimes: %f sec\n", dtime);
     348 
     349  Nmosaic = 0;
     350  NMOSAIC = 1000;
     351  ALLOCATE (startTimesMosaic, unsigned int, NMOSAIC);
     352  startTimesMosaic[0] = startTimes[0];
     353
     354  // generate a list of the unique start times (these define the mosaics)
     355  for (i = 0; i < Nimage; i++) {
     356    if (startTimes[i] < startTimesMosaic[Nmosaic]) {
     357      fprintf (stderr, "error?\n");
     358      abort();
     359    }
     360    if (startTimes[i] == startTimesMosaic[Nmosaic]) continue;
     361    Nmosaic ++;
     362    if (Nmosaic >= NMOSAIC) {
     363      NMOSAIC += 1000;
     364      REALLOCATE (startTimesMosaic, unsigned int, NMOSAIC);
     365    }
     366    startTimesMosaic[Nmosaic] = startTimes[i];
     367  }
     368  Nmosaic ++;
     369  MARKTIME("create array of mosaic obstimes: %f sec\n", dtime);
     370
     371  // now I have a list of uniq start times, and they are in order
     372  // create the mosaic arrays for these times
     373  ALLOCATE (mosaic, Mosaic, Nmosaic);
     374
     375  ALLOCATE (MosaicToImage, off_t *, Nmosaic);
     376  ALLOCATE (MosaicN_Image, off_t,   Nmosaic);
     377  ALLOCATE (MosaicN_IMAGE, off_t,   Nmosaic);
     378
     379  // init the mosaic array values
     380  for (i = 0; i < Nmosaic; i++) {
     381    mosaic[i].start = startTimesMosaic[i];
     382    mosaic[i].stop  = 0;
     383    mosaic[i].Mcal  = 0.0;
     384    mosaic[i].dMcal = 0.0;
     385    mosaic[i].dMsys = 0.0;
     386    mosaic[i].Xm    = 0.0;
     387    mosaic[i].flags = 0;
     388    mosaic[i].secz  = NAN;
     389    mosaic[i].photcode = 0;
     390    mosaic[i].skipCal = FALSE;
     391   
     392    memset (&mosaic[i].coords, 0, sizeof(Coords));
     393
     394    MosaicN_IMAGE[i] = 10;
     395    MosaicN_Image[i] = 0;
     396    ALLOCATE (MosaicToImage[i], off_t, MosaicN_IMAGE[i]);
     397    MosaicToImage[i][0] = -1;
     398  }
     399
     400  ALLOCATE (ImageToMosaic, off_t, Nimage); // mosaic to which image belongs
     401
     402  // assign each image to a mosaic
     403  for (i = 0; i < Nimage; i++) {
     404    ImageToMosaic[i] = -1;
     405
     406    /* select valid mosaic images by photcode */
     407    pname = GetPhotcodeNamebyCode (image[i].photcode);
     408    if (!pname) continue;
     409
     410    status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
     411    if (status) continue;
     412
     413    start = image[i].tzero;
     414    stop  = image[i].tzero + MAX(1.01*image[i].trate*image[i].NY, 1);
     415
     416    j = findMosaic(startTimesMosaic, Nmosaic, start);
     417    if (j == -1) {
     418      fprintf (stderr, "programming error? all image images should belong to a mosaic\n");
     419      abort();
     420    }
     421
     422    // add reference from image to mosaic
     423    ImageToMosaic[i] = j;
     424
     425    // have we already found this mosaic?
     426    found = (MosaicN_Image[j] > 0);
     427
     428    /* add image to mosaic image list */
     429    MosaicToImage[j][MosaicN_Image[j]] = i;
     430    MosaicN_Image[j] ++;
     431    if (MosaicN_Image[j] == MosaicN_IMAGE[j]) {
     432      MosaicN_IMAGE[j] += 10;
     433      REALLOCATE (MosaicToImage[j], off_t, MosaicN_IMAGE[j]);
     434    }
     435    if (found) continue;
     436   
     437    /* a new mosaic, define ranges */
     438    if (mosaic[j].start != start) {
     439      fprintf (stderr, "error?\n");
     440      abort();
     441    }
     442    mosaic[j].stop  = stop;
     443    mosaic[j].Mcal  = 0.0;
     444    mosaic[j].dMcal = 0.0;
     445    mosaic[j].Xm    = 0.0;
     446    mosaic[j].dMsys = image[i].flags;
     447    mosaic[j].flags = image[i].flags;
     448    mosaic[j].secz  = image[i].secz;
     449    mosaic[j].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode);
     450  }
     451  MARKTIME("assign images to mosaic: %f sec\n", dtime);
     452
     453  // free this or not?
     454  free (MosaicN_IMAGE);
     455  free (startTimes);
     456  free (startTimesMosaic);
     457
     458  fprintf (stderr, "matched %d images to %d mosaics\n", (int) Nimage, (int) Nmosaic);
     459
     460  return;
     461}
     462
     463Mosaic *getMosaicForImage (off_t im) {
     464
     465  if (im < 0) return NULL;
     466  if (!ImageToMosaic) return NULL;
     467
     468  off_t m = ImageToMosaic[im];
     469  if (m < 0) return NULL;
     470  if (m >= Nmosaic) return NULL;
     471
     472  return (&mosaic[m]);
     473}
     474
    322475// use bisection to find the overlapping mosaic (returns exact match)
    323476// startTimes is a sorted, unique list of times
     
    350503  }
    351504  return (-1);
     505}
     506
     507void setMosaicCenters (Image *image, off_t Nimage) {
     508
     509  /* find max dR, dD range for all mosaics */
     510  /* define mosaic.coords to cover dR, dD */
     511  /* send results to initGridBins */
     512
     513  off_t i, j, m, NX, NY;
     514  double R, D, Rmid, Dmid;
     515  double Mcal, dMcal, Xm;
     516
     517  for (i = 0; i < Nmosaic; i++) {
     518    Rmid = Dmid = 0.0;
     519    Mcal = dMcal = Xm = 0;
     520    for (j = 0; j < MosaicN_Image[i]; j++) {
     521      m = MosaicToImage[i][j];
     522
     523      if (!FindMosaicForImage (image, Nimage, m)) {
     524        if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);
     525        continue;
     526      }
     527
     528      NX = image[m].NX;
     529      NY = image[m].NY;
     530      XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords);
     531
     532      Rmid += R;
     533      Dmid += D;
     534
     535      Mcal  += image[m].Mcal;
     536      dMcal += image[m].dMcal;
     537      Xm    += image[m].Xm;
     538
     539      // for ubercal images, we (elsewhere) keep Mcal frozen
     540
     541      /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
     542      image[m].Mcal  = 0.0;
     543      image[m].dMcal = NAN;
     544      image[m].Xm    = NAN_S_SHORT;
     545    }
     546    Rmid = Rmid / MosaicN_Image[i];
     547    Dmid = Dmid / MosaicN_Image[i];
     548
     549    strcpy (mosaic[i].coords.ctype, "DEC--TAN");
     550    mosaic[i].coords.crval1 = Rmid;
     551    mosaic[i].coords.crval2 = Dmid;
     552    mosaic[i].coords.crpix1 = 0.0;
     553    mosaic[i].coords.crpix2 = 0.0;
     554    mosaic[i].coords.cdelt1 = 1.0 / 3600.0;
     555    mosaic[i].coords.cdelt2 = 1.0 / 3600.0;
     556    mosaic[i].coords.pc1_1  = 1.0;
     557    mosaic[i].coords.pc2_2  = 1.0;
     558    mosaic[i].coords.pc1_2  = 0.0;
     559    mosaic[i].coords.pc2_1  = 0.0;
     560
     561    mosaic[i].Mcal  = Mcal / MosaicN_Image[i];
     562    mosaic[i].dMcal = dMcal / MosaicN_Image[i];
     563    mosaic[i].Xm    = Xm / MosaicN_Image[i];
     564  }
     565  return;
    352566}
    353567
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/args.c

    r36530 r36558  
    358358
    359359  RelphotMode mode = MODE_ERROR;
     360  if ((N = get_argument (argc, argv, "-images"))) {
     361    remove_argument (N, &argc, argv);
     362    mode = UPDATE_IMAGES;
     363  }
    360364  if ((N = get_argument (argc, argv, "-averages"))) {
    361365    remove_argument (N, &argc, argv);
     
    375379    if (!REGION_FILE) relphot_usage();
    376380  }
     381
     382  PARALLEL_REGIONS_MANUAL = FALSE;
    377383  if ((N = get_argument (argc, argv, "-parallel-regions"))) {
    378384    remove_argument (N, &argc, argv);
    379385    mode = PARALLEL_REGIONS;
    380386    if (!REGION_FILE) relphot_usage();
     387    if ((N = get_argument (argc, argv, "-parallel-regions-manual"))) {
     388      remove_argument (N, &argc, argv);
     389      PARALLEL_REGIONS_MANUAL = FALSE;
     390    }
    381391  }
    382392
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c

    r36530 r36558  
    2020  // *** NOTE : for the moment, regions must be in the range 0 - 360, -90 - +90
    2121
    22   if (VERBOSE) fprintf (stderr, "finding images\n");
     22  // generate the chip match here so we can define the mosaic centers (if needed)
    2323  BuildChipMatch (image, Nimage);
    2424  MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime);
     25
     26  if (MOSAIC_ZEROPT) {
     27    makeMosaics (image, Nimage);
     28
     29    // center coords and Mcal, dMcal, Xm for the mosaics
     30    setMosaicCenters (image, Nimage);
     31    MARKTIME("set mosaic coordinates and Mcal values: %f sec\n", dtime);
     32  }
     33
     34  // register the image array with ImageOps.c for later getimageByID calls
     35  initImages (image, NULL, Nimage);
     36
     37  if (VERBOSE) fprintf (stderr, "finding images\n");
    2538
    2639  // for each regionHost, select images which are contained by the region
    2740  // even faster would be to use a tree to get to the real regions...
    2841  select_images_hostregion (regionHosts, image, Nimage);
     42
     43  // calculate_host_image_bounds (regionHosts);
    2944
    3045  return TRUE;
     
    6479    }
    6580   
    66     // this adds 1.3 sec for 3M images
     81    // do not include DIS (PHU-level mosaics) in the output list
     82    if (!strcmp(&image[j].coords.ctype[4], "-DIS")) continue;
     83
     84    // match the image to its corresponding ASTROMETRIC mosaic (not the same as the Mosaic above)
    6785    if (!FindMosaicForImage (image, Nimage, j)) {
    6886      if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);
    6987      continue;
    7088    }
    71 
    72     // XXX need to make sure mosaics for each saved image are also saved
    73     // skip them here and add explicitly below.
    74 
    75     /* define image center - note the DIS images (mosaic phu) are special */
    76     double Xc, Yc, Rc, Dc;
    77     if (!strcmp(&image[j].coords.ctype[4], "-DIS")) {
    78       Xc = 0.0; Yc = 0.0;
     89   
     90    // use a reference coordinate for each image to assign to hosts
     91    double Rc, Dc;
     92    if (MOSAIC_ZEROPT) {
     93      // use the coords of the associated mosaic to select
     94      Mosaic *mosaic = getMosaicForImage (j);
     95      Rc = mosaic->coords.crval1;
     96      Dc = mosaic->coords.crval2;
    7997    } else {
     98
     99      // define image center - note the DIS images (mosaic phu) are special
     100      double Xc, Yc;
    80101      Xc = 0.5*image[j].NX;
    81102      Yc = 0.5*image[j].NY;
    82     }
    83 
    84     XY_to_RD (&Rc, &Dc, Xc, Yc, &image[j].coords);
    85     Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0);
     103
     104      XY_to_RD (&Rc, &Dc, Xc, Yc, &image[j].coords);
     105      Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0);
     106    }
    86107
    87108    i = find_host_for_coords (regionHosts, Rc, Dc);
    88109
    89110    if (i == -1) continue;
     111
     112    RegionHostInfo *host = &regionHosts->hosts[i];
     113
     114    double Rmin, Rmax, Dmin, Dmax;
     115    calculate_image_bounds (&image[j], &Rmin, &Rmax, &Dmin, &Dmax);
     116
     117    host->RminCat = MIN(Rmin, host->RminCat);
     118    host->RmaxCat = MAX(Rmax, host->RmaxCat);
     119    host->DminCat = MIN(Dmin, host->DminCat);
     120    host->DmaxCat = MAX(Dmax, host->DmaxCat);
     121
     122    // regionHosts needs to have the full outer boundary
     123    // (so reload_catalogs covers the correct region)
     124    regionHosts->Rmin = MIN(Rmin, regionHosts->Rmin);
     125    regionHosts->Rmax = MAX(Rmax, regionHosts->Rmax);
     126    regionHosts->Dmin = MIN(Dmin, regionHosts->Dmin);
     127    regionHosts->Dmax = MAX(Dmax, regionHosts->Dmax);
    90128
    91129    // this is a bit memory expensive : I am making a complete copy of the image table here
     
    105143}
    106144
     145double Xf[] = {0.0, 1.0, 0.0, 1.0};
     146double Yf[] = {0.0, 0.0, 1.0, 1.0};
     147
     148int calculate_image_bounds (Image *image, double *rmin, double *rmax, double *dmin, double *dmax) {
     149
     150  int n;
     151
     152  double Rmin = 360.0;
     153  double Rmax =   0.0;
     154  double Dmin = +90.0;
     155  double Dmax = -90.0;
     156
     157  // define image corners
     158  for (n = 0; n < 4; n++) {
     159    double Xc, Yc, Rc, Dc;
     160    Xc = Xf[n]*image->NX;
     161    Yc = Yf[n]*image->NY;
     162    XY_to_RD (&Rc, &Dc, Xc, Yc, &image->coords);
     163    Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0);
     164     
     165    Rmin = MIN (Rmin, Rc);
     166    Rmax = MAX (Rmax, Rc);
     167    Dmin = MIN (Dmin, Dc);
     168    Dmax = MAX (Dmax, Dc);
     169  }
     170
     171  *rmin = Rmin;
     172  *rmax = Rmax;
     173  *dmin = Dmin;
     174  *dmax = Dmax;
     175
     176  return TRUE;
     177}
     178
     179int calculate_host_image_bounds (RegionHostTable *regionHosts) {
     180
     181  int i, n;
     182  off_t j;
     183
     184  for (i = 0; i < regionHosts->Nhosts; i++) {
     185
     186    RegionHostInfo *host = &regionHosts->hosts[i];
     187
     188    // XXX clear the chip match?
     189
     190    BuildChipMatch (host->image, host->Nimage);
     191
     192    double Rmin = 360.0;
     193    double Rmax =   0.0;
     194    double Dmin = +90.0;
     195    double Dmax = -90.0;
     196
     197    for (j = 0; j < host->Nimage; j++) {
     198
     199      Image *image = &host->image[j];
     200
     201      if (!FindMosaicForImage (host->image, host->Nimage, j)) {
     202        fprintf (stderr, "missing astrometry? programming error?\n");
     203        abort ();
     204      }
     205     
     206      // define image corners
     207      for (n = 0; n < 4; n++) {
     208        double Xc, Yc, Rc, Dc;
     209        Xc = Xf[n]*image->NX;
     210        Yc = Yf[n]*image->NY;
     211        XY_to_RD (&Rc, &Dc, Xc, Yc, &image->coords);
     212        Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0);
     213     
     214        Rmin = MIN (Rmin, Rc);
     215        Dmin = MIN (Dmin, Rc);
     216       
     217        Rmax = MAX (Rmax, Rc);
     218        Dmax = MAX (Dmax, Rc);
     219      }
     220
     221    }
     222
     223    host->RminCat = Rmin;
     224    host->DminCat = Dmin;
     225    host->RmaxCat = Rmax;
     226    host->DmaxCat = Dmax;
     227
     228    // regionHosts needs to have the full outer boundary
     229    // (so reload_catalogs covers the correct region)
     230    regionHosts->Rmin = MIN(Rmin, regionHosts->Rmin);
     231    regionHosts->Rmax = MAX(Rmax, regionHosts->Rmax);
     232    regionHosts->Dmin = MIN(Dmin, regionHosts->Dmin);
     233    regionHosts->Dmax = MAX(Dmax, regionHosts->Dmax);
     234  }
     235  return TRUE;
     236}
     237
     238
    107239// XXX add a search tree to speed this up?
    108240int find_host_for_coords (RegionHostTable *regionHosts, double Rc, double Dc) {
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c

    r36548 r36558  
    5656    char command[1024];
    5757    snprintf (command, 1024, "relphot %s -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f",
    58               PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->Rmin, host->Rmax, host->Dmin, host->Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
     58              PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
    5959
    60     if (VERBOSE)       strextend (command, "-v");
    61     if (VERBOSE2)      strextend (command, "-vv");
    62     if (RESET)         strextend (command, "-reset");
    63     if (RESET_ZEROPTS) strextend (command, "-reset-zpts");
    64     if (UPDATE)        strextend (command, "-update");
    65     if (!KEEP_UBERCAL) strextend (command, "-reset-ubercal");
     60    if (VERBOSE)         strextend (command, "-v");
     61    if (VERBOSE2)        strextend (command, "-vv");
     62    if (RESET)           strextend (command, "-reset");
     63    if (RESET_ZEROPTS)   strextend (command, "-reset-zpts");
     64    if (UPDATE)          strextend (command, "-update");
     65    if (MOSAIC_ZEROPT)   strextend (command, "-mosaic");
     66    if (FREEZE_IMAGES)   strextend (command, "-imfreeze");
     67    if (FREEZE_MOSAICS)  strextend (command, "-mosfreeze");
     68    if (!KEEP_UBERCAL)   strextend (command, "-reset-ubercal");
     69    if (PARALLEL)        strextend (command, "-parallel");
     70    if (PARALLEL_MANUAL) strextend (command, "-parallel-manual");
     71    if (PARALLEL_SERIAL) strextend (command, "-parallel-serial");
    6672
    6773    // XXX deprecate this if we are happy with the new version
     
    7076    fprintf (stderr, "command: %s\n", command);
    7177   
    72     if (PARALLEL_MANUAL) continue;
     78    if (PARALLEL_REGIONS_MANUAL) continue;
    7379
    7480    // launch the job on the remote machine (no handshake)
     
    8288  }
    8389
    84   if (PARALLEL_MANUAL) {
     90  if (PARALLEL_REGIONS_MANUAL) {
    8591    fprintf (stderr, "run the relphot_client commands above.  when these are done, hit return\n");
    8692    getchar();
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/reload_catalogs.c

    r35806 r36558  
    156156  // load the list of hosts
    157157  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
     158  if (!table) {
     159    fprintf (stderr, "ERROR: problem with parallel host table\n");
     160    exit (2);
     161  }
    158162
    159163  if (BOUNDARY_TREE) {
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c

    r36545 r36558  
    3030  }
    3131
     32  // once we have read this table, we should remove it for repeat runs
     33  unlink (IMAGE_TABLE); // XXX a bit risky, add some protection?
     34
    3235  // XXX need to deal with mosaic vs image...
    33   // initMosaics (image, Nimage...)
     36  makeMosaics (image, Nimage);
    3437
    3538  initImages (image, NULL, Nimage);
     
    131134  MARKTIME("-- finalize Mcal values: %f sec\n", dtime);
    132135
     136  setMcalFinal (); // copy per-mosaic calibrations to the images
     137
    133138  share_image_mags (regionHosts, -1);
    134 
    135   // save_image_subset ();
    136139
    137140  exit (0);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c

    r36545 r36558  
    1717  int Nsecfilt = GetPhotcodeNsecfilt();
    1818
     19  int myHost = regionHosts->index[REGION_HOST_ID];
     20  double Rmin = regionHosts->hosts[myHost].Rmin;
     21  double Rmax = regionHosts->hosts[myHost].Rmax;
     22  double Dmin = regionHosts->hosts[myHost].Dmin;
     23  double Dmax = regionHosts->hosts[myHost].Dmax;
     24
    1925  // XXX skip some catalogs based on UserPatch?
    2026  for (i = 0; i < Ncatalog; i++) {
     
    2228
    2329      // do I own this object? (in region range?)
    24       if (catalog[i].averageT[j].R <  UserPatch.Rmin) continue;
    25       if (catalog[i].averageT[j].R >= UserPatch.Rmax) continue;
    26       if (catalog[i].averageT[j].D <  UserPatch.Dmin) continue;
    27       if (catalog[i].averageT[j].D >= UserPatch.Dmax) continue;
     30      if (catalog[i].averageT[j].R <  Rmin) continue;
     31      if (catalog[i].averageT[j].R >= Rmax) continue;
     32      if (catalog[i].averageT[j].D <  Dmin) continue;
     33      if (catalog[i].averageT[j].D >= Dmax) continue;
    2834
    2935      // does this object have missing detections (does someone else need it?)
     
    4349
    4450  // write out the meanmag fits table AND write state in some file
    45   int myHost = regionHosts->index[REGION_HOST_ID];
    4651  char *hostname = regionHosts->hosts[myHost].hostname;
    4752
Note: See TracChangeset for help on using the changeset viewer.