IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 15, 2003, 11:21:03 PM (23 years ago)
Author:
eugene
Message:

support for altpath, clean MODE, TYPE consts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/imregister/detrend/output.c

    r70 r73  
    11# include "imregister.h"
    22# include "detrend.h"
     3
     4char *RandomPath (char *dBPath);
     5extern double drand48();
    36
    47int OutputSubset (Match *match, int Nmatch) {
     
    180183int PrintSubset (DetReg *detdata, Match *match, int Nmatch) {
    181184 
    182   char *dBPath, *typestr, *filtstr, filename[128];
     185  char *dBPath, *Path, *typestr, *filtstr, filename[128];
    183186  char *timestr, *modestr, *ccdstr, ccdinfo[16], ccdformat[16];
    184187  int i, j, Nc;
     188  struct timeval now;
     189  long A;
     190
     191  gettimeofday (&now, NULL);
     192  A = now.tv_usec + now.tv_sec;
     193  srand48 (A);
    185194
    186195  Nc = strlen (ccds[0]);
     
    225234
    226235    if (output.Select) {
    227       fprintf (stdout, "%s/%s\n", dBPath, filename);
    228     } else {
    229       fprintf (stdout, "%-40s = %19s %7s %6s %6s %s %2d %2d %6.1f  %20s\n",
     236      if (detdata[i].altpath) {
     237        Path = RandomPath (dBPath);
     238      } else {
     239        Path = dBPath;
     240      }
     241      fprintf (stdout, "%s/%s\n", Path, filename);
     242    } else {
     243      fprintf (stdout, "%-40s = %19s %7s %6s %6s %s %2d %2d %6.1f  %20s  %1d\n",
    230244               filename, timestr, modestr, typestr, filtstr, ccdstr,
    231                detdata[i].Nentry, detdata[i].Norder, detdata[i].exptime, detdata[i].label);
     245               detdata[i].Nentry, detdata[i].Norder, detdata[i].exptime, detdata[i].label, detdata[i].altpath);
    232246    }
    233247    free (timestr);
    234248  } 
    235249  return (TRUE);
     250}
     251
     252char *RandomPath (char *dBPath) {
     253 
     254  int N;
     255
     256  N = (NDetrendAltDB + 0.99)*drand48();
     257  if (N == NDetrendAltDB) return (dBPath);
     258  return (DetrendAltDB[N]);
    236259}
    237260
Note: See TracChangeset for help on using the changeset viewer.