IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:19:27 PM (15 years ago)
Author:
eugene
Message:

updates from eam branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/uniphot/src/uniphot.c

    r27790 r31160  
    11# include "uniphot.h"
     2
     3static char *timeref  = "2000/01/01,00:00:00";
     4static char *timeunit = "days";
    25
    36int main (int argc, char **argv) {
     
    811  FITS_DB db;
    912
     13  // set up time format stuff
     14  time_t TimeReference = GetTimeReference (timeref);
     15  int TimeUnits = GetTimeUnits (timeunit);
     16
    1017  /* get configuration info, args, lockfile */
    1118  initialize_uniphot (argc, argv);
     
    1522  if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
    1623  if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename);
    17   if (!UPDATE) dvo_image_unlock (&db);
    1824
    1925  /* load images */
    2026  load_images_uniphot (&db);
     27  if (!UPDATE) dvo_image_unlock (&db);
    2128 
    2229  /* filter image list by selection */
     
    3845  fprintf (stdout, "# NLOOP: %d\n", NLOOP);
    3946  fprintf (stdout, "# time groups : %d\n", Ntgroup);
     47  fprintf (stdout, "# TIMEREF : %s\n", timeref);
     48  fprintf (stdout, "# TIMEFORMAT : %s\n", timeunit);
    4049  for (i = 0; i < Ntgroup; i++) {
    41     fprintf (stdout, "%s %5d %5d %7.4f  %7.4f %7.4f\n", tgroup[i].label,
    42              tgroup[i].Nimage, tgroup[i].Ngood, 0.001*tgroup[i].M, 0.001*tgroup[i].dM, 0.001*tgroup[i].dMsub);
     50
     51    double tstart = NAN;
     52    double tstop = NAN;
     53
     54    time_t time;
     55    if (ohana_str_to_time (tgroup[i].tstart, &time)) {
     56      tstart = TimeValue (time, TimeReference, TimeUnits);
     57    }
     58    if (ohana_str_to_time (tgroup[i].tstop, &time)) {
     59      tstop = TimeValue (time, TimeReference, TimeUnits);
     60    }
     61
     62    fprintf (stdout, "%s : %12.6f %12.6f : %5d %5d %7.4f  %7.4f %7.4f\n",
     63             tgroup[i].label, tstart, tstop,
     64             tgroup[i].Nimage, tgroup[i].Ngood,
     65             tgroup[i].M, tgroup[i].dM, tgroup[i].dMsub);
    4366  }
    4467  fprintf (stdout, "\n");
     
    4770  for (i = 0; i < Nsgroup; i++) {
    4871    fprintf (stdout, "%s %5d %5d %7.4f  %7.4f %7.4f\n", sgroup[i].label,
    49              sgroup[i].Nimage, sgroup[i].Ngood, 0.001*sgroup[i].M, 0.001*sgroup[i].dM, 0.001*sgroup[i].dMsub);
     72             sgroup[i].Nimage, sgroup[i].Ngood, sgroup[i].M, sgroup[i].dM, sgroup[i].dMsub);
    5073  }
    5174  if (!UPDATE) exit (0);
Note: See TracChangeset for help on using the changeset viewer.