Changeset 31160 for trunk/Ohana/src/uniphot/src/uniphot.c
- Timestamp:
- Apr 4, 2011, 1:19:27 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/uniphot/src/uniphot.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/uniphot/src/uniphot.c
r27790 r31160 1 1 # include "uniphot.h" 2 3 static char *timeref = "2000/01/01,00:00:00"; 4 static char *timeunit = "days"; 2 5 3 6 int main (int argc, char **argv) { … … 8 11 FITS_DB db; 9 12 13 // set up time format stuff 14 time_t TimeReference = GetTimeReference (timeref); 15 int TimeUnits = GetTimeUnits (timeunit); 16 10 17 /* get configuration info, args, lockfile */ 11 18 initialize_uniphot (argc, argv); … … 15 22 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); 16 23 if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename); 17 if (!UPDATE) dvo_image_unlock (&db);18 24 19 25 /* load images */ 20 26 load_images_uniphot (&db); 27 if (!UPDATE) dvo_image_unlock (&db); 21 28 22 29 /* filter image list by selection */ … … 38 45 fprintf (stdout, "# NLOOP: %d\n", NLOOP); 39 46 fprintf (stdout, "# time groups : %d\n", Ntgroup); 47 fprintf (stdout, "# TIMEREF : %s\n", timeref); 48 fprintf (stdout, "# TIMEFORMAT : %s\n", timeunit); 40 49 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); 43 66 } 44 67 fprintf (stdout, "\n"); … … 47 70 for (i = 0; i < Nsgroup; i++) { 48 71 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); 50 73 } 51 74 if (!UPDATE) exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
