IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2012, 4:02:00 PM (14 years ago)
Author:
eugene
Message:

add PS1_V4 schema; add set mean fluxes based on stacks; define the primary image ID (based on distance from center or boundary tree) and set mean flux from stacks based on that info; fix (uniquify) psps ID for stack detections; mean fluxes are in Jy; detection fluxes are instrumental counts per second

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/dvo_host_utils.c

    r33963 r34260  
    1515  snprintf (uniquer, 12, "%05d.%05d", PID, TIME % 100000);
    1616
     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
    1736  int top_status = TRUE;
    1837  int i;
     
    2948    snprintf (table->hosts[i].results, DVO_MAX_PATH, "%s/dvo.results.%s.fits", table->hosts[i].pathname, uniquer);
    3049
    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 disk
    45     int state;
    46     f = fsetlockfile (commandFile, 0.5, LCK_XCLD, &state);
    47     fclearlockfile (commandFile, f, LCK_XCLD, &state);
    48 
    4950    char command[1024];
    5051    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);
    5252
    5353    if (VERBOSE) gprint (GP_ERR, "command: %s\n", command);
     
    7575    }
    7676  }
     77  free (commandFile);
    7778  return top_status;
    7879}
Note: See TracChangeset for help on using the changeset viewer.