Changeset 75
- Timestamp:
- May 15, 2003, 11:22:51 PM (23 years ago)
- Location:
- trunk/Ohana/src/imregister/src
- Files:
-
- 4 edited
-
detsearch.c (modified) (5 diffs)
-
imregister.c (modified) (4 diffs)
-
imsort.c (modified) (4 diffs)
-
imstatreg.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/src/detsearch.c
r3 r75 1 1 # include "imregister.h" 2 2 # include "detrend.h" 3 static char *version = "detsearch $Revision: 3. 0$";3 static char *version = "detsearch $Revision: 3.1 $"; 4 4 5 5 int main (int argc, char **argv) { … … 13 13 args (argc, argv); 14 14 15 if (output.Criteria) PrintCriteria (); 16 15 17 status = load_db (); 16 18 if (!status) { … … 18 20 exit (0); 19 21 } 20 if (!output.Modify && !output.Delete ) close_db ();22 if (!output.Modify && !output.Delete && !output.Altpath) close_db (); 21 23 22 24 match = MatchCriteria (&Nmatch); /* match basic criteria */ … … 24 26 match = CloseCriteria (match, &Nmatch); /* reduce matches based on closeness */ 25 27 26 if (output.Criteria) PrintCriteria ();27 28 28 if (output.Select) { 29 29 match = UniqueSubset (match, &Nmatch); … … 35 35 } 36 36 37 if (output.Altpath) SetAltpath (match, Nmatch); 37 38 if (output.Modify) ModifySubset (match, Nmatch); 38 39 if (output.Delete) DeleteSubset (match, Nmatch); -
trunk/Ohana/src/imregister/src/imregister.c
r70 r75 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imregister $Revision: 3. 1$";3 static char *version = "imregister $Revision: 3.2 $"; 4 4 5 5 int main (int argc, char **argv) { … … 15 15 /* define new entries (pimage, Nnew) */ 16 16 switch (image[0].mode) { 17 case M ODE_CUBE:17 case M_CUBE: 18 18 Nnew = image[0].ccd + 1; 19 19 ALLOCATE (pimage, RegImage, Nnew); … … 23 23 pimage[i] = image[0]; 24 24 pimage[i].ccd = i - 1; 25 pimage[i].mode = M ODE_SLICE;25 pimage[i].mode = M_SLICE; 26 26 pimage[i].obstime += *dtime*pimage[i].ccd; 27 27 } 28 28 break; 29 case M ODE_MEF:29 case M_MEF: 30 30 Nnew = image[0].ccd; 31 31 ALLOCATE (pimage, RegImage, Nnew); … … 35 35 } 36 36 break; 37 case M ODE_SPLIT:38 case M ODE_SINGLE:37 case M_SPLIT: 38 case M_SINGLE: 39 39 Nnew = 1; 40 40 pimage = &image[0]; -
trunk/Ohana/src/imregister/src/imsort.c
r67 r75 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imsort $Revision: 3. 1$";3 static char *version = "imsort $Revision: 3.2 $"; 4 4 5 5 int main (int argc, char **argv) { … … 15 15 /* define new entries (pimage, Nnew) */ 16 16 switch (image[0].mode) { 17 case M ODE_CUBE:17 case M_CUBE: 18 18 Nnew = image[0].ccd + 1; 19 19 ALLOCATE (pimage, RegImage, Nnew); … … 23 23 pimage[i] = image[0]; 24 24 pimage[i].ccd = i - 1; 25 pimage[i].mode = M ODE_SLICE;25 pimage[i].mode = M_SLICE; 26 26 pimage[i].obstime += *dtime*pimage[i].ccd; 27 27 } 28 28 break; 29 case M ODE_MEF:29 case M_MEF: 30 30 Nnew = image[0].ccd; 31 31 ALLOCATE (pimage, RegImage, Nnew); … … 35 35 } 36 36 break; 37 case M ODE_SPLIT:38 case M ODE_SINGLE:37 case M_SPLIT: 38 case M_SINGLE: 39 39 Nnew = 1; 40 40 pimage = &image[0]; -
trunk/Ohana/src/imregister/src/imstatreg.c
r70 r75 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imstatreg $Revision: 3. 2$";3 static char *version = "imstatreg $Revision: 3.3 $"; 4 4 5 5 int main (int argc, char **argv) { … … 7 7 RegImage *image; 8 8 float *dtime; 9 int i, *match, Nmatch, status, child ;9 int i, *match, Nmatch, status, child, Nentry; 10 10 char *TempDB, *LogFile; 11 FILE *f; 11 12 12 13 get_version (argc, argv, version); … … 15 16 if (CLIENT) imregclient (argv[1], argv[2], argv[3]); 16 17 18 /* create db.log and db.bfr */ 17 19 ALLOCATE (TempDB, char, strlen (ImageDB) + 10); 18 20 sprintf (TempDB, "%s.bfr", ImageDB); 21 ALLOCATE (LogFile, char, strlen (ImageDB) + 10); 22 sprintf (LogFile, "%s.log", ImageDB); 19 23 20 24 SetSignals (); … … 33 37 34 38 /* redirect stderr, stdout to logfile */ 35 ALLOCATE (LogFile, char, strlen (ImageDB) + 10); 36 sprintf (LogFile, "%s.log", ImageDB); 37 tmpfd = freopen (LogFile, "w", stderr); 38 if (tmpfd == (FILE *) NULL) 39 fprintf (LogFile, "can't open log file %s, writing to stderr\n", LogFile); 39 f = freopen (LogFile, "w", stderr); 40 if (f == (FILE *) NULL) 41 fprintf (stderr, "can't open log file %s, writing to stderr\n", LogFile); 40 42 else 41 stderr = tmpfd;42 tmpfd= freopen (LogFile, "w", stdout);43 if ( tmpfd== (FILE *) NULL)44 fprintf ( LogFile, "can't open log file %s, writing to stderr\n", LogFile);43 stderr = f; 44 f = freopen (LogFile, "w", stdout); 45 if (f == (FILE *) NULL) 46 fprintf (stderr, "can't open log file %s, writing to stderr\n", LogFile); 45 47 else 46 stdout = tmpfd;48 stdout = f; 47 49 48 /* start loop */50 /* start loop */ 49 51 while (1) { 50 52 51 fflush (stderr);52 fflush (stdout);53 53 set_db (TempDB); 54 54 status = load_db (); 55 55 if (!status) { 56 56 fprintf (stderr, "temporary database is empty\n"); 57 close_db (); sleep (60); continue; 57 close_db (); 58 fflush (stderr); 59 fflush (stdout); 60 sleep (60); 61 continue; 58 62 } 59 63 image = get_images (&Nentry); … … 79 83 unlink (TempDB); 80 84 clearlockfile2 (TempDB, -1, LCK_HARD, &status); 85 fflush (stderr); 86 fflush (stdout); 81 87 sleep (60); 82 88 } 83 89 } 84 85
Note:
See TracChangeset
for help on using the changeset viewer.
