Changeset 34260 for trunk/Ohana/src/opihi
- Timestamp:
- Jul 31, 2012, 4:02:00 PM (14 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 6 edited
-
cmd.astro (modified) (1 prop)
-
dvo/dvo_host_utils.c (modified) (3 diffs)
-
dvo/gimages.c (modified) (1 diff)
-
dvo/hosts.c (modified) (7 diffs)
-
dvo/mextract.c (modified) (1 diff)
-
lib.shell/check_stack.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120627/Ohana/src/opihi/cmd.astro (added) merged: 34139,34244,34255
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/dvo/dvo_host_utils.c
r33963 r34260 15 15 snprintf (uniquer, 12, "%05d.%05d", PID, TIME % 100000); 16 16 17 // write the dvo comment (host independent) 18 char commandBase[DVO_MAX_PATH]; 19 snprintf (commandBase, DVO_MAX_PATH, "dvo.command.%s.txt", uniquer); 20 char *commandFile = abspath(commandBase, DVO_MAX_PATH); 21 22 FILE *f = fopen (commandFile, "w"); 23 fprintf (f, "%s\n", basecmd); 24 if (fflush (f)) DIE("flush", "failed to flush"); 25 26 int fd = fileno (f); 27 if (fsync (fd)) DIE("fsync", "failed to fsync"); 28 29 if (fclose (f)) DIE("close", "failed to close"); 30 31 // force NFS to write the file to disk 32 int state; 33 f = fsetlockfile (commandFile, 0.5, LCK_XCLD, &state); 34 fclearlockfile (commandFile, f, LCK_XCLD, &state); 35 17 36 int top_status = TRUE; 18 37 int i; … … 29 48 snprintf (table->hosts[i].results, DVO_MAX_PATH, "%s/dvo.results.%s.fits", table->hosts[i].pathname, uniquer); 30 49 31 char commandBase[DVO_MAX_PATH];32 snprintf (commandBase, DVO_MAX_PATH, "dvo.command.%s.txt", uniquer);33 char *commandFile = abspath(commandBase, DVO_MAX_PATH);34 35 FILE *f = fopen (commandFile, "w");36 fprintf (f, "%s\n", basecmd);37 if (fflush (f)) DIE("flush", "failed to flush");38 39 int fd = fileno (f);40 if (fsync (fd)) DIE("fsync", "failed to fsync");41 42 if (fclose (f)) DIE("close", "failed to close");43 44 // force NFS to write the file to disk45 int state;46 f = fsetlockfile (commandFile, 0.5, LCK_XCLD, &state);47 fclearlockfile (commandFile, f, LCK_XCLD, &state);48 49 50 char command[1024]; 50 51 snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, table->hosts[i].results, options, table->hosts[i].hostID, table->hosts[i].pathname); 51 free (commandFile);52 52 53 53 if (VERBOSE) gprint (GP_ERR, "command: %s\n", command); … … 75 75 } 76 76 } 77 free (commandFile); 77 78 return top_status; 78 79 } -
trunk/Ohana/src/opihi/dvo/gimages.c
r31635 r34260 216 216 217 217 if (PixelCoords) { 218 gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x \n",219 Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags);218 gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x %7d\n", 219 Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID); 220 220 } else { 221 221 XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 222 gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x \n",223 Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags );222 gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x %7d\n", 223 Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID); 224 224 } 225 225 sprintf (name, "IMAGEx:%d", Nfound); -
trunk/Ohana/src/opihi/dvo/hosts.c
r34088 r34260 2 2 # include <glob.h> 3 3 # define DVO_MAX_PATH 1024 4 5 enum {TEMP_NONE, TEMP_DVO_RESULTS, TEMP_DVO_LOG, TEMP_RELPHOT_RESULTS, TEMP_RELPHOT_LOG}; 4 6 5 7 // functions to manage the remote hosts … … 10 12 gprint (GP_ERR, " commands:\n"); 11 13 gprint (GP_ERR, " purge-temp : delete all tempfiles for this shell\n"); 14 gprint (GP_ERR, " : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type]\n"); 15 gprint (GP_ERR, " get-results : determine name of RESULTS file\n"); 12 16 return FALSE; 13 17 } … … 27 31 remove_argument (N, &argc, argv); 28 32 ALL_PID = TRUE; 29 remove_argument (N, &argc, argv);30 33 } 31 34 … … 46 49 } 47 50 51 // we have the following types of temp files: 52 // dvo.results.*.fits 53 // dvo.results.*.fits.log 54 // log.rlpc.* (relphot logs) 55 // relphot.catalog.subset.dat [no glob needed] 56 int TEMP_TYPE = TEMP_DVO_RESULTS; 57 if ((N = get_argument (argc, argv, "-type"))) { 58 TEMP_TYPE = TEMP_NONE; 59 remove_argument (N, &argc, argv); 60 if (!strcasecmp(argv[N], "dvo.results")) TEMP_TYPE = TEMP_DVO_RESULTS; 61 if (!strcasecmp(argv[N], "dvo.log")) TEMP_TYPE = TEMP_DVO_LOG; 62 if (!strcasecmp(argv[N], "relphot.results")) TEMP_TYPE = TEMP_RELPHOT_RESULTS; 63 if (!strcasecmp(argv[N], "relphot.log")) TEMP_TYPE = TEMP_RELPHOT_LOG; 64 if (TEMP_TYPE == TEMP_NONE) { 65 gprint (GP_ERR, "USAGE: hosts purge-temp [-type (type)]\n"); 66 gprint (GP_ERR, " allowed types dvo.results, dvo.log, relphot.results, relphot.log]\n"); 67 return FALSE; 68 } 69 remove_argument (N, &argc, argv); 70 } 71 48 72 // XXX wrap this up in a function: 49 73 char *CATDIR = GetCATDIR(); … … 63 87 } 64 88 89 if (argc != 2) { 90 gprint (GP_ERR, "USAGE: hosts purge-temp [-all-pid] [-old-pid PID] [-verbose] [-commit]\n"); 91 return FALSE; 92 } 93 65 94 int i; 66 95 for (i = 0; i < table->Nhosts; i++) { … … 68 97 char name[DVO_MAX_PATH]; 69 98 if (ALL_PID) { 70 snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.*.fits", table->hosts[i].pathname); 99 if (TEMP_TYPE == TEMP_DVO_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits", table->hosts[i].pathname); 100 if (TEMP_TYPE == TEMP_DVO_LOG) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits.log", table->hosts[i].pathname); 101 if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname); 102 if (TEMP_TYPE == TEMP_RELPHOT_LOG) snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 71 103 } else { 72 snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID); 104 if (TEMP_TYPE == TEMP_DVO_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID); 105 if (TEMP_TYPE == TEMP_DVO_LOG) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits.log", table->hosts[i].pathname, PID); 106 if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname); 107 if (TEMP_TYPE == TEMP_RELPHOT_LOG) snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 73 108 } 74 109 if (VERBOSE) gprint (GP_ERR, "checking %s\n", name); … … 108 143 } 109 144 110 111 112 145 gprint (GP_ERR, "error: unknown hosts command %s\n", argv[1]); 113 146 return FALSE; -
trunk/Ohana/src/opihi/dvo/mextract.c
r33963 r34260 129 129 if (fields[i].ID == MEAS_YCCD) loadImages = TRUE; 130 130 } 131 if (fields[i].ID == MEAS_XMOSAIC) loadImages = mosaicMode = TRUE; 132 if (fields[i].ID == MEAS_YMOSAIC) loadImages = mosaicMode = TRUE; 133 if (fields[i].ID == MEAS_EXTERN_ID) loadImages = mosaicMode = TRUE; 134 if (fields[i].ID == MEAS_FLAT) loadImages = mosaicMode = TRUE; 131 if (fields[i].ID == MEAS_XMOSAIC) loadImages = mosaicMode = TRUE; 132 if (fields[i].ID == MEAS_YMOSAIC) loadImages = mosaicMode = TRUE; 133 if (fields[i].ID == MEAS_EXTERN_ID) loadImages = mosaicMode = TRUE; 134 if (fields[i].ID == MEAS_FLAT) loadImages = mosaicMode = TRUE; 135 if (fields[i].ID == MEAS_CENTER_OFFSET) loadImages = mosaicMode = TRUE; 135 136 } 136 137 if (loadImages && !SetImageSelection (mosaicMode, selection)) goto escape; -
trunk/Ohana/src/opihi/lib.shell/check_stack.c
r20936 r34260 1 1 # include "opihi.h" 2 # ifndef MAX_INT 3 # define MAX_INT 2147483647 4 # endif 2 5 3 6 int check_stack (StackVar *stack, int Nstack, int validsize) { … … 12 15 13 16 /** if this is a number, put it on the list of scalars and move on. assume value is 14 * an int unless proven otherwise **/ 17 * an int unless proven otherwise. 18 19 If we have built libdvo with opihi_int defined as a 32bit signed int, then we have 20 an overflow for values > MAX_INT (2^31). If the float value is larger than this, 21 we should treat the value as a float. (NOTE: this means we cannot use 32bit flags, 22 only 31bit flags. 23 24 **/ 25 15 26 stack[i].FltValue = strtod (stack[i].name, &c1); 16 27 stack[i].IntValue = strtol (stack[i].name, &c2, 0); 28 if ((fabs(stack[i].FltValue) > MAX_INT) && (c1 == stack[i].name + strlen (stack[i].name))) { 29 stack[i].type = 'S'; // 'S' == (float) 30 continue; 31 } 17 32 if (c2 == stack[i].name + strlen (stack[i].name)) { 18 33 stack[i].type = 's'; // 's' == (int)
Note:
See TracChangeset
for help on using the changeset viewer.
