IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36990


Ignore:
Timestamp:
Jul 10, 2014, 12:05:21 PM (12 years ago)
Author:
eugene
Message:

move gpc1-based photcode tests to specfic functions; do not remove mean Mcal from image.Mcal in relphot_parallel_region (mosaic values are not passed to remote clients)

Location:
branches/eam_branches/ipp-20140610/Ohana/src/relphot
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/Makefile

    r36630 r36990  
    3434$(SRC)/args.$(ARCH).o            \
    3535$(SRC)/help.$(ARCH).o            \
     36$(SRC)/extra.$(ARCH).o           \
    3637$(SRC)/bcatalog.$(ARCH).o        \
    3738$(SRC)/global_stats.$(ARCH).o    \
     
    8283$(SRC)/args.$(ARCH).o            \
    8384$(SRC)/help.$(ARCH).o            \
     85$(SRC)/extra.$(ARCH).o           \
    8486$(SRC)/synthetic_mags.$(ARCH).o  \
    8587$(SRC)/plotstuff.$(ARCH).o       \
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/doc/mosaic.txt

    r33963 r36990  
     1
     2
     32014.07.09
     4
     5* trying to make sense of mosaic.Mcal vs image.Mcal in the context of UBERCAL:
     6
     7  * relphot_images:
     8    * load_images (convert raw FITS table to Image structure, select subset matching selection)
     9      * initMosaics (associate mosaics to images (gpc1 photcodes only))
     10        * initMosaicGrid (define spatial range of mosaics [only used by grid analysis]; set Mcal to <image.Mcal> and image.Mcal to 0.0)
     11    --- calculate image or mosaic Mcal values
     12    * setMcalFinal (set image.Mcal = mosaicMcal)
     13
     14  * relphot_parallel_regions:
     15    * assign_images
     16      * makeMosaics (equivalent to initMosaics, but works on full image table, not subset)
     17      * setMosaicCenters (set Mcal to <image.Mcal> and image.Mcal to 0.0) <--- this is wrong!
     18      (sends images ONLY, not mosaics, to remote machines)
     19      (slurps back new image values, applies to db)
     20     
     21  * relphot_parallel_images:
     22    * makeMosaics (associate mosaics to images, gpc1 photcodes only)
     23      * initMosaicGrid (needed in this one)
     24---
    125
    226For 'mosaic' zero points, I define the mosaics by grouping the images
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/include/relphot.h

    r36984 r36990  
    4848  float dMsys;
    4949  unsigned short nFitPhotom;
    50   float Xm;
     50  short Xm;
    5151  float secz;
    5252  float ubercalDist;
     
    317317int           findMosaics         PROTO((Catalog *catalog, int Ncatalog, int doMosaicList));
    318318
    319 void makeMosaics (Image *image, off_t Nimage);
     319void makeMosaics (Image *image, off_t Nimage, int mergeMcal);
    320320Mosaic *getMosaicForImage (off_t im);
    321321void setMosaicCenters (Image *image, off_t Nimage);
     
    509509int relphot_parallel_images ();
    510510int relphot_parallel_regions ();
     511
     512// in extra.c
     513int isGPC1chip  (int photcode);
     514int isGPC1stack (int photcode);
     515int isGPC1warp  (int photcode);
     516
     517
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/ImageOps.c

    r36976 r36990  
    532532
    533533  // FREEZE_IMAGES only applies to mosaic data (eg, gpc1)
    534   // skip this function if photcode is gpc1 and FREEZE_IMAGES
    535   // otherwise, allow image to be calibrated
    536   // if (FREEZE_IMAGES) return;
    537534
    538535  fprintf (stderr, "limiting negative clouds to %f\n", CLOUD_TOLERANCE);
     
    565562    }     
    566563
    567     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    568     if (FREEZE_IMAGES && isGPC1cam) continue;
     564    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    569565
    570566    // UBERCAL image: if this is an ubercal image, set minUbercalDist to 0:
     
    713709    if (image[i].flags & IMAGE_BAD) continue;
    714710
    715     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    716     if (FREEZE_IMAGES && isGPC1cam) continue;
     711    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    717712
    718713    mlist[N] = image[i].Mcal;
     
    825820  for (i = 0; i < Nimage; i++) {
    826821
    827     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    828     if (FREEZE_IMAGES && isGPC1cam) continue;
     822    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    829823
    830824    Mlist[Nplot] = image[i].Mcal;
     
    873867
    874868  for (i = 0; i < Nimage; i++) {
    875     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    876     if (FREEZE_IMAGES && isGPC1cam) continue;
     869    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
     870
    877871    bin = image[i].dMcal / 0.00025;
    878872    bin = MAX (0, MIN (NBIN - 1, bin));
     
    910904    if (image[i].flags & IMAGE_BAD)  continue;
    911905
    912     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    913     if (FREEZE_IMAGES && isGPC1cam) continue;
     906    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    914907
    915908    N = 0;
     
    957950    if (image[i].flags & IMAGE_BAD)  continue;
    958951
    959     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    960     if (FREEZE_IMAGES && isGPC1cam) continue;
     952    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    961953
    962954    list[n] = pow (10.0, 0.01*image[i].Xm);
     
    990982    if (image[i].flags & IMAGE_BAD)  continue;
    991983
    992     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    993     if (FREEZE_IMAGES && isGPC1cam) continue;
     984    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    994985
    995986    list[n] = image[i].Mcal;
     
    10231014    if (image[i].flags & IMAGE_BAD)  continue;
    10241015
    1025     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    1026     if (FREEZE_IMAGES && isGPC1cam) continue;
     1016    if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue;
    10271017
    10281018    list[n] = image[i].dMcal;
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/MosaicOps.c

    r36984 r36990  
    11# include "relphot.h"
    22void plot_setMcal (double *list, int Npts, StatType *stats, float clouds);
     3off_t findMosaic (unsigned int *startTimes, off_t Nmosaic, unsigned int start);
    34
    45// see discussion in ImagesOps.c re: IDX_T
     
    3637// MosaicN_image was 'Nimlist'
    3738// MosaicToImage was 'imlist'
     39
     40void sort_times (unsigned int *T, int N) {
     41
     42# define SWAPFUNC(A,B){ unsigned int tmp; \
     43  tmp = T[A]; T[A] = T[B]; T[B] = tmp; \
     44}
     45# define COMPARE(A,B)(T[A] < T[B])
     46
     47  OHANA_SORT (N, COMPARE, SWAPFUNC);
     48
     49# undef SWAPFUNC
     50# undef COMPARE
     51
     52}
    3853
    3954/* find mosaic frames (unique time periods & photcode name matches mosaic) */
     
    136151}
    137152
    138 off_t findMosaic (unsigned int *startTimes, off_t Nmosaic, unsigned int start);
    139 
    140 void sort_times (unsigned int *T, int N) {
    141 
    142 # define SWAPFUNC(A,B){ unsigned int tmp; \
    143   tmp = T[A]; T[A] = T[B]; T[B] = tmp; \
    144 }
    145 # define COMPARE(A,B)(T[A] < T[B])
    146 
    147   OHANA_SORT (N, COMPARE, SWAPFUNC);
    148 
    149 # undef SWAPFUNC
    150 # undef COMPARE
    151 
    152 }
    153 
    154153/* find mosaic frames (unique time periods) (NOTE : we do NOT require matching photcodes...)
    155154   this function will also identify the images NOT in the subset which belong to a selected mosaic
     
    157156void initMosaics (Image *subset, off_t Nsubset, Image *image, char *inSubset, off_t Nimage) {
    158157
    159   off_t i, j, status, found, NMOSAIC, *MosaicN_IMAGE;
     158  off_t i, j, found, NMOSAIC, *MosaicN_IMAGE;
    160159  unsigned int start, stop, *startTimes, *startTimesMosaic;
    161   char *pname;
    162160
    163161  if (!MOSAIC_ZEROPT) return;
     
    174172  int Nmoschip = 0;
    175173  for (i = 0; i < Nsubset; i++) {
    176     int isGPC1cam = ((subset[i].photcode >= 10000) && (subset[i].photcode <= 10500));
    177     if (!isGPC1cam) {
    178       continue;
    179     }
     174    if (!isGPC1chip(subset[i].photcode)) continue;
    180175    startTimes[Nmoschip] = subset[i].tzero;
    181176    Nmoschip ++;
     
    191186  // generate a list of the unique start times (these define the mosaics)
    192187  for (i = 0; i < Nmoschip; i++) {
    193     if (startTimes[i] < startTimesMosaic[Nmosaic]) {
    194       fprintf (stderr, "error?\n");
    195       abort();
    196     }
     188    myAssert (startTimes[i] >= startTimesMosaic[Nmosaic], "times out of order?");
    197189    if (startTimes[i] == startTimesMosaic[Nmosaic]) continue;
    198190    Nmosaic ++;
     
    221213    mosaic[i].dMcal    = 0.0;
    222214    mosaic[i].dMsys    = 0.0;
    223     mosaic[i].Xm   = 0.0;
     215    mosaic[i].Xm       = 0.0;
    224216    mosaic[i].flags    = 0;
    225217    mosaic[i].secz     = NAN;
     
    244236    }
    245237   
    246     // this is gpc1-specific.  needs a more general solution
    247     int isGPC1cam = ((image[i].photcode >= 10000) && (image[i].photcode <= 10500));
    248     if (!isGPC1cam) {
    249       continue;
    250     }
    251 
    252     if (0) {
    253       // XXX this version fails if we have stack and fforce data: GPC1.g.SkyChip
    254       /* select valid mosaic images by photcode */
    255       pname = GetPhotcodeNamebyCode (image[i].photcode);
    256       if (!pname) continue;
    257       status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
    258       if (status) continue;
    259     }
     238    if (!isGPC1chip(image[i].photcode)) continue;
    260239
    261240    /* set image time range */
     
    281260    ImageToMosaic[i] = -1;
    282261
    283     // this is gpc1-specific.  needs a more general solution
    284     int isGPC1cam = ((subset[i].photcode >= 10000) && (subset[i].photcode <= 10500));
    285     if (!isGPC1cam) {
     262    if (!isGPC1chip(subset[i].photcode)) {
    286263      Nsimple ++;
    287264      continue;
    288     }
    289 
    290     if (0) {
    291       // XXX this version fails if we have stack and fforce data: GPC1.g.SkyChip
    292       /* select valid mosaic images by photcode */
    293       pname = GetPhotcodeNamebyCode (subset[i].photcode);
    294       status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
    295       if (status) continue;
    296265    }
    297266
     
    325294      abort();
    326295    }
    327     mosaic[j].stop  = stop;
    328     mosaic[j].Mcal  = 0.0;
    329     mosaic[j].dMcal = 0.0;
    330     mosaic[j].Xm = 0.0;
    331     mosaic[j].dMsys = subset[i].flags;
    332     mosaic[j].flags = subset[i].flags;
    333     mosaic[j].secz  = subset[i].secz;
     296    mosaic[j].stop     = stop;
     297    mosaic[j].Mcal     = 0.0;
     298    mosaic[j].dMcal    = 0.0;
     299    mosaic[j].Xm       = 0.0;
     300    mosaic[j].dMsys    = subset[i].flags;
     301    mosaic[j].flags    = subset[i].flags;
     302    mosaic[j].secz     = subset[i].secz;
    334303    mosaic[j].photcode = GetPhotcodeEquivCodebyCode (subset[i].photcode);
    335304  }
     
    346315}
    347316
    348 /* find mosaic frames (unique time periods) (NOTE : we do NOT require matching photcodes but we
    349    match images by MOSAICNAME.  this last point is weak: it forces a single camera at a time.
    350    we can extend the logic to multiple cameras if we make list of MOSAICNAMES (better to assign a camera ID)
     317/* find mosaic frames (unique time periods) (NOTE : require gpc1 chips, which is pretty limiting)
     318   if mergeMcal is TRUE, <image.Mcal> values will be saved on Mosaic.Mcal
    351319 */
    352 void makeMosaics (Image *image, off_t Nimage) {
    353 
    354   off_t i, j, status, found, NMOSAIC, *MosaicN_IMAGE;
     320void makeMosaics (Image *image, off_t Nimage, int mergeMcal) {
     321
     322  off_t i, j, found, NMOSAIC, *MosaicN_IMAGE;
    355323  unsigned int start, stop, *startTimes, *startTimesMosaic;
    356   char *pname;
    357324
    358325  if (!MOSAIC_ZEROPT) return;
     
    367334  // generate a list of all image start times
    368335  ALLOCATE (startTimes, unsigned int, Nimage);
     336  int Nmoschip = 0;
    369337  for (i = 0; i < Nimage; i++) {
    370     startTimes[i] = image[i].tzero;
    371   }
    372   sort_times (startTimes, Nimage);
     338    if (!isGPC1chip(image[i].photcode)) continue;
     339    startTimes[Nmoschip] = image[i].tzero;
     340    Nmoschip ++;
     341  }
     342  sort_times (startTimes, Nmoschip);
    373343  MARKTIME("create array of all image obstimes: %f sec\n", dtime);
    374344 
     
    379349
    380350  // generate a list of the unique start times (these define the mosaics)
    381   for (i = 0; i < Nimage; i++) {
    382     if (startTimes[i] < startTimesMosaic[Nmosaic]) {
    383       fprintf (stderr, "error?\n");
    384       abort();
    385     }
     351  for (i = 0; i < Nmoschip; i++) {
     352    myAssert (startTimes[i] >= startTimesMosaic[Nmosaic], "times out of order?");
    386353    if (startTimes[i] == startTimesMosaic[Nmosaic]) continue;
    387354    Nmosaic ++;
     
    405372  // init the mosaic array values
    406373  for (i = 0; i < Nmosaic; i++) {
    407     mosaic[i].start = startTimesMosaic[i];
    408     mosaic[i].stop  = 0;
    409     mosaic[i].Mcal  = 0.0;
    410     mosaic[i].dMcal = 0.0;
    411     mosaic[i].dMsys = 0.0;
    412     mosaic[i].Xm    = 0.0;
    413     mosaic[i].flags = 0;
    414     mosaic[i].secz  = NAN;
     374    mosaic[i].start    = startTimesMosaic[i];
     375    mosaic[i].stop     = 0;
     376    mosaic[i].Mcal     = 0.0;
     377    mosaic[i].dMcal    = 0.0;
     378    mosaic[i].dMsys    = 0.0;
     379    mosaic[i].Xm       = 0.0;
     380    mosaic[i].flags    = 0;
     381    mosaic[i].secz     = NAN;
    415382    mosaic[i].photcode = 0;
    416     mosaic[i].skipCal = FALSE;
     383    mosaic[i].skipCal  = FALSE;
    417384   
    418385    memset (&mosaic[i].coords, 0, sizeof(Coords));
     
    427394
    428395  // assign each image to a mosaic
     396  int Nsimple = 0;
    429397  for (i = 0; i < Nimage; i++) {
    430398    ImageToMosaic[i] = -1;
    431399
    432     /* select valid mosaic images by photcode */
    433     pname = GetPhotcodeNamebyCode (image[i].photcode);
    434     if (!pname) continue;
    435 
    436     status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));
    437     if (status) continue;
     400    if (!isGPC1chip(image[i].photcode)) {
     401      Nsimple ++;
     402      continue;
     403    }
    438404
    439405    start = image[i].tzero;
     
    466432      abort();
    467433    }
    468     mosaic[j].stop  = stop;
    469     mosaic[j].Mcal  = 0.0;
    470     mosaic[j].dMcal = 0.0;
    471     mosaic[j].Xm    = 0.0;
    472     mosaic[j].dMsys = image[i].flags;
    473     mosaic[j].flags = image[i].flags;
    474     mosaic[j].secz  = image[i].secz;
     434    mosaic[j].stop     = stop;
     435    mosaic[j].Mcal     = 0.0;
     436    mosaic[j].dMcal    = 0.0;
     437    mosaic[j].Xm       = 0.0;
     438    mosaic[j].dMsys    = image[i].flags;
     439    mosaic[j].flags    = image[i].flags;
     440    mosaic[j].secz     = image[i].secz;
    475441    mosaic[j].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode);
    476442  }
     
    482448  free (startTimesMosaic);
    483449
     450  if (mergeMcal) {
     451    initMosaicGrid (image, Nimage);
     452  }
     453
    484454  fprintf (stderr, "matched %d images to %d mosaics\n", (int) Nimage, (int) Nmosaic);
    485 
    486455  return;
    487456}
     
    539508  off_t i, j, m, NX, NY, NC, Nc;
    540509  double R, D, Rmid, Dmid;
    541   double Mcal, dMcal, Xm;
    542510  double *Rc, *Dc;
    543511
     
    549517    Nc = 0;
    550518    Rmid = Dmid = NAN;
    551     Mcal = dMcal = Xm = 0;
    552519    for (j = 0; j < MosaicN_Image[i]; j++) {
    553520      m = MosaicToImage[i][j];
     
    589556        REALLOCATE (Dc, double, NC);
    590557      }
    591 
    592       Mcal  += image[m].Mcal;
    593       dMcal += image[m].dMcal;
    594       Xm    += image[m].Xm;
    595 
    596       // for ubercal images, we (elsewhere) keep Mcal frozen
    597 
    598       /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
    599       image[m].Mcal  = 0.0;
    600       image[m].dMcal = NAN;
    601       image[m].Xm    = NAN_S_SHORT;
    602558    }
    603559
     
    643599    mosaic[i].coords.pc2_1  = 0.0;
    644600
    645     mosaic[i].Mcal   = Mcal / MosaicN_Image[i];
    646     mosaic[i].dMcal  = dMcal / MosaicN_Image[i];
    647     mosaic[i].Xm = Xm / MosaicN_Image[i];
     601    mosaic[i].Mcal   = 0.0;
     602    mosaic[i].dMcal  = 0.0;
     603    mosaic[i].Xm     = 0.0;
    648604  }
    649605  return;
     
    661617  double R, D, Rmin, Rmax, Dmin, Dmax;
    662618  double Mcal, dMcal, Xm;
     619
     620  fprintf (stderr, "*** moving Mcal from image.Mcal to mosaic.Mcal ***\n");
    663621
    664622  dXmax = dYmax = 0.0;
     
    693651      Dmin = MIN (Dmin, D);
    694652      Dmax = MAX (Dmax, D);
     653
     654      /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
     655
     656      // XXX: how does this work with UBERCAL?  We want to keep the Mcal values supplied by ubercal, but
     657      // solve for a single offset for each exposure (Mosaic.Mcal). 
     658      // we also want to keep the flat-field terms for each exposure (regardless of ubercal or not)
     659      // if it helps, note that ubercal uses a single zp per exposure, so the mean of those values is the same as the value
     660
    695661      Mcal  += image[m].Mcal;
    696662      dMcal += image[m].dMcal;
    697663      Xm    += image[m].Xm;
    698664
    699       // XXX: how does this work with UBERCAL?  We want to keep the Mcal values supplied by ubercal, but
    700       // solve for a single offset for each exposure (Mosaic.Mcal). 
    701 
    702       // we also want to keep the flat-field terms for each exposure (regardless of ubercal or not)
    703 
    704       // if it helps, note that ubercal uses a single zp per exposure, so the mean of those values is the same as the value
    705 
    706       /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */
    707665      image[m].Mcal   = 0.0;
    708666      image[m].dMcal  = NAN;
    709       image[m].Xm = NAN_S_SHORT;
     667      image[m].Xm     = NAN_S_SHORT;
    710668    }
    711669    dS /= MosaicN_Image[i];
     
    725683    mosaic[i].Mcal   = Mcal / MosaicN_Image[i];
    726684    mosaic[i].dMcal  = dMcal / MosaicN_Image[i];
    727     mosaic[i].Xm = Xm / MosaicN_Image[i];
     685    mosaic[i].Xm     = Xm / MosaicN_Image[i];
    728686  }
    729687  if (!USE_GRID) return;
     
    735693}
    736694
    737 // XXX : what about mosaics with skipCal == TRUE?
    738695void setMcalFinal () {
    739696
     
    745702  image = getimages (&Nimage, NULL);
    746703
    747   // XXX I think this is OK in the ubercal context, but probably need to skip UBERCAL
    748   // images? (no need to update them)
     704  fprintf (stderr, "*** return Mcal from mosaic.Mcal to image.Mcal ***\n");
    749705
    750706  // copy the mosaic results to the images.  set the mosaic Mcal to 0.0 since we have moved its
     
    12671223
    12681224  if (testImage) {
    1269     fprintf (stderr, "%f %f  :  %f\n", myMosaic[0].Mcal, myMosaic[0].dMsys, myMosaic[0].Xm);
     1225    fprintf (stderr, "%f %f  :  %f\n", myMosaic[0].Mcal, myMosaic[0].dMsys, pow (10.0, 0.01*myMosaic[0].Xm));
    12701226  }
    12711227
     
    16201576    if (mosaic[i].flags & IMAGE_BAD) continue;
    16211577    if (mosaic[i].skipCal) continue;
     1578    if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue;
     1579
    16221580    list[n] = mosaic[i].Mcal;
    16231581    dlist[n] = 1;
     
    16501608    if (mosaic[i].flags & IMAGE_BAD) continue;
    16511609    if (mosaic[i].skipCal) continue;
     1610    if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue;
     1611
    16521612    list[n] = mosaic[i].dMcal;
    16531613    dlist[n] = 1;
     
    16811641    if (mosaic[i].flags & IMAGE_BAD)  continue;
    16821642    if (mosaic[i].skipCal) continue;
     1643    if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue;
    16831644
    16841645    N = 0;
     
    17271688    if (mosaic[i].flags & IMAGE_BAD) continue;
    17281689    if (mosaic[i].skipCal) continue;
     1690    if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue;
     1691
    17291692    list[n]  = pow (10.0, 0.01*mosaic[i].Xm);
    17301693    dlist[n] = 1;
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/Shutdown.c

    r33651 r36990  
    2323  SetProtect (TRUE);
    2424  if (db) gfits_db_close (db);
    25   fprintf (stderr, "ERROR: addstar halted\n");
     25  fprintf (stderr, "ERROR: relphot halted\n");
    2626  exit (1);
    2727}
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/assign_images.c

    r36976 r36990  
    2525
    2626  if (MOSAIC_ZEROPT) {
    27     makeMosaics (image, Nimage);
     27    makeMosaics (image, Nimage, FALSE);
    2828
    2929    // center coords and Mcal, dMcal, Mchisq for the mosaics
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/launch_region_hosts.c

    r36884 r36990  
    5555
    5656    char command[1024];
    57     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->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
     57    snprintf (command, 1024, "relphot %s", PhotcodeList);
     58    strextend (command, "-parallel-images %s", filename);
     59    strextend (command, "-region-hosts %s", REGION_FILE);
     60    strextend (command, "-region-hostID %d", host->hostID);
     61    strextend (command, "-D CATDIR %s", CATDIR);
     62    strextend (command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
     63    strextend (command, "-statmode %s", STATMODE);
     64    strextend (command, "-D CAMERA %s", CAMERA);
     65    strextend (command, "-D STAR_TOOFEW %d", STAR_TOOFEW);
     66    strextend (command, "-minerror %f", MIN_ERROR);
     67    strextend (command, "-cloud-limit %f", CLOUD_TOLERANCE);
    5968
    6069    if (VERBOSE)             strextend (command, "-v");
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/relphot_parallel_images.c

    r36630 r36990  
    3838  // unlink (IMAGE_TABLE); // XXX a bit risky, add some protection?
    3939
    40   // XXX need to deal with mosaic vs image...
    41   makeMosaics (image, Nimage);
     40  makeMosaics (image, Nimage, TRUE);
    4241
    4342  initImages (image, NULL, Nimage);
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/setMrelCatalog.c

    r36976 r36990  
    159159
    160160      // are we a PS1 exposure photcode?
    161       if ((measureT[k].photcode >= 10000) && (measureT[k].photcode <= 10500)) {
    162         NexpPS1 ++;
    163       }
     161      if (isGPC1chip(measureT[k].photcode)) NexpPS1 ++;
    164162
    165163      // SKIP gpc1 stack data
    166       if ((measureT[k].photcode >= 11000) && (measureT[k].photcode <= 11500)) {
    167         continue;
    168       }
     164      if (isGPC1stack(measureT[k].photcode)) continue;
    169165
    170166      // SKIP gpc1 forced-warp data
    171       if ((measureT[k].photcode >= 12000) && (measureT[k].photcode <= 12500)) {
    172         continue;
    173       }
     167      if (isGPC1warp(measureT[k].photcode)) continue;
    174168
    175169      if (measureT[k].dbFlags & MEAS_BAD) SKIP_THIS_MEAS(Nbad);
     
    497491
    498492      // only examine gpc1 stack data
    499       // XXX this is absurdly hardwired (along with several photcode tests)
    500       if (measure[k].photcode < 11000) continue;
    501       if (measure[k].photcode > 11400) continue;
     493      if (!isGPC1stack(measure[k].photcode)) continue;
    502494
    503495      haveStack = TRUE;
     
    695687    for (k = 0; k < average[0].Nmeasure; k++, meas++) {
    696688
    697       // skip measurements which are not ForcedWarp values
    698       if ((measure[k].photcode < 12000) || (measure[k].photcode > 12500)) continue;
     689      // only examine gpc1 forced-warp data
     690      if (!isGPC1warp(measure[k].photcode)) continue;
    699691
    700692      // skip measurements that do not match the current photcode
Note: See TracChangeset for help on using the changeset viewer.