Changeset 33270
- Timestamp:
- Feb 15, 2012, 7:50:06 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relphot/src
- Files:
-
- 6 edited
-
BrightCatalog.c (modified) (3 diffs)
-
Shutdown.c (modified) (2 diffs)
-
args.c (modified) (2 diffs)
-
help.c (modified) (1 diff)
-
initialize.c (modified) (3 diffs)
-
relphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c
r33254 r33270 474 474 } 475 475 476 // XXX this prevents different catalogs from having different Nsecfilt values 477 int Nsecfilt = GetPhotcodeNsecfilt(); 478 476 479 ALLOCATE (bcatalog[0].measure, MeasureTiny, Nmeas); 477 480 ALLOCATE (bcatalog[0].average, AverageTiny, Naves); 481 ALLOCATE (bcatalog[0].secfilt, SecFilt, Naves*Nsecfilt); 478 482 479 483 int Nm = 0; 480 484 int Na = 0; 481 485 for (i = 0; i < Ncatalog; i++) { 486 if (!catalog[i].Naverage) continue; 482 487 for (j = 0; j < catalog[i].Naverage; j++) { 483 CopyAverageTiny (&bcatalog[0].average[Na], &catalog[i].average[j]); 488 // CopyAverageTiny (&bcatalog[0].average[Na], &catalog[i].average[j]); 489 bcatalog[0].average[Na] = catalog[i].averageT[j]; 484 490 bcatalog[0].average[Na].catID = catalog[i].catID; 485 int Nsecfilt = catalog[i].Nsecfilt;486 491 for (k = 0; k < Nsecfilt; k++) { 487 492 bcatalog[0].secfilt[Nsecfilt*Na + k] = catalog[i].secfilt[Nsecfilt*j + k]; … … 491 496 } 492 497 for (j = 0; j < catalog[i].Nmeasure; j++) { 493 CopyMeasureTiny (&bcatalog[0].measure[Nm], &catalog[i].measure[j]); 498 // CopyMeasureTiny (&bcatalog[0].measure[Nm], &catalog[i].measure[j]); 499 bcatalog[0].measure[Nm] = catalog[i].measureT[j]; 494 500 bcatalog[0].measure[Nm].catID = catalog[i].catID; 495 501 Nm++; … … 497 503 } 498 504 } 505 bcatalog->Naverage = Na; 506 bcatalog->Nmeasure = Nm; 499 507 return bcatalog; 500 508 } -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/Shutdown.c
r7080 r33270 1 1 # include "relphot.h" 2 2 3 static FITS_DB *db ;3 static FITS_DB *db = NULL; 4 4 5 5 void set_db (FITS_DB *in) { … … 22 22 23 23 SetProtect (TRUE); 24 gfits_db_close (db);24 if (db) gfits_db_close (db); 25 25 fprintf (stderr, "ERROR: addstar halted\n"); 26 26 exit (1); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/args.c
r33254 r33270 291 291 if (!HOSTDIR) relphot_client_usage(); 292 292 293 CATDIR[0] = 0;294 if ((N = get_argument (argc, argv, "-catdir"))) {295 remove_argument (N, &argc, argv);296 strcpy (CATDIR, argv[N]);297 remove_argument (N, &argc, argv);298 }299 if (!CATDIR[0]) relphot_client_usage();293 // CATDIR[0] = 0; 294 // if ((N = get_argument (argc, argv, "-catdir"))) { 295 // remove_argument (N, &argc, argv); 296 // strcpy (CATDIR, argv[N]); 297 // remove_argument (N, &argc, argv); 298 // } 299 // if (!CATDIR[0]) relphot_client_usage(); 300 300 301 301 IMAGES = NULL; // used in -update mode … … 320 320 if (!MODE) relphot_client_usage(); 321 321 322 if (argc != 1) relphot_client_usage (); 322 /* specify portion of the sky */ 323 UserPatch.Rmin = 0; 324 UserPatch.Rmax = 360; 325 UserPatch.Dmin = -90; 326 UserPatch.Dmax = +90; 327 UserPatchSelect = FALSE; 328 if ((N = get_argument (argc, argv, "-region"))) { 329 remove_argument (N, &argc, argv); 330 UserPatch.Rmin = atof (argv[N]); 331 remove_argument (N, &argc, argv); 332 UserPatch.Rmax = atof (argv[N]); 333 remove_argument (N, &argc, argv); 334 UserPatch.Dmin = atof (argv[N]); 335 remove_argument (N, &argc, argv); 336 UserPatch.Dmax = atof (argv[N]); 337 remove_argument (N, &argc, argv); 338 UserPatchSelect = TRUE; 339 } 340 341 if (argc != 2) relphot_client_usage (); 323 342 324 343 return TRUE; -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/help.c
r33244 r33270 45 45 46 46 void relphot_client_usage (void) { 47 fprintf (stderr, "ERROR: USAGE: relphot -load -bcatalog (filename) -hostID (hostID) -hostdir (hostdir) -catdir (catdir)\n");48 fprintf (stderr, " or: relphot -update -images (filename) -hostID (hostID) -hostdir (hostdir) -catdir (catdir)\n");47 fprintf (stderr, "ERROR: USAGE: relphot (photcodes) -load (filename) -hostID (hostID) -hostdir (hostdir) [options]\n"); 48 fprintf (stderr, " or: relphot -update (filename) -hostID (hostID) -hostdir (hostdir) [options]\n"); 49 49 fprintf (stderr, " use -h for more usage information\n"); 50 50 exit (2); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/initialize.c
r33254 r33270 1 1 # include "relphot.h" 2 3 void ParsePhotcodeList (char *word) { 4 5 Nphotcodes = 0; 6 photcodes = NULL; 7 int NPHOTCODES = 10; 8 ALLOCATE (photcodes, PhotCode *, NPHOTCODES); 9 10 /* parse the comma-separated list of photcodesKeep */ 11 char *myList = strcreate(word); 12 char *list = myList; 13 char *codename = NULL; 14 char *ptr = NULL; 15 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 16 list = NULL; // pass NULL on successive strtok_r calls 17 fprintf (stderr, "PHOTCODE LIST: %s\n", myList); 18 fprintf (stderr, "codename: %s\n", codename); 19 if ((photcodes[Nphotcodes] = GetPhotcodebyName (codename)) == NULL) { 20 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 21 exit (1); 22 } 23 if (photcodes[Nphotcodes][0].type != PHOT_SEC) { 24 fprintf (stderr, "photcode %s is not an filter type (SEC)\n", codename); 25 exit (1); 26 } 27 Nphotcodes ++; 28 CHECK_REALLOCATE (photcodes, PhotCode *, NPHOTCODES, Nphotcodes, 10); 29 } 30 } 2 31 3 32 void initialize (int argc, char **argv) { … … 27 56 # endif 28 57 29 Nphotcodes = 0; 30 photcodes = NULL; 31 int NPHOTCODES = 10; 32 ALLOCATE (photcodes, PhotCode *, NPHOTCODES); 33 34 /* parse the comma-separated list of photcodesKeep */ 35 char *myList = strcreate(argv[N]); 36 char *list = myList; 37 char *codename = NULL; 38 char *ptr = NULL; 39 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 40 list = NULL; // pass NULL on successive strtok_r calls 41 fprintf (stderr, "PHOTCODE LIST: %s\n", myList); 42 fprintf (stderr, "codename: %s\n", codename); 43 if ((photcodes[Nphotcodes] = GetPhotcodebyName (codename)) == NULL) { 44 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 45 exit (1); 46 } 47 if (photcodes[Nphotcodes][0].type != PHOT_SEC) { 48 fprintf (stderr, "photcode %s is not an filter type (SEC)\n", codename); 49 exit (1); 50 } 51 Nphotcodes ++; 52 CHECK_REALLOCATE (photcodes, PhotCode *, NPHOTCODES, Nphotcodes, 10); 53 } 58 // load the list of photcodes into the globals (photcodes, Nphotcodes) 59 ParsePhotcodeList (argv[N]); 54 60 } 55 61 // XXX DEP PhotNsec = GetPhotcodeNsecfilt (); … … 99 105 100 106 relphot_client_help (argc, argv); 101 // ConfigInit (&argc, argv); XXX not sure if we need anything in here (maybe photcode table)107 ConfigInit (&argc, argv); 102 108 args_client (argc, argv); 109 110 // load the list of photcodes into the globals (photcodes, Nphotcodes) 111 ParsePhotcodeList (argv[1]); 103 112 } -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot.c
r33254 r33270 58 58 // XXX need to reduce number of global variables in use. 59 59 // XXX this is fairly lame: argv[1] is photcode if UserPatchSelect is true 60 // XXX clean this up: deprecate region-name here (can be optional if desired) 60 61 skylist = load_images (&db, argv[1], &UserPatch, UserPatchSelect); 61 62 MARKTIME("-- load images: %f sec\n", dtime);
Note:
See TracChangeset
for help on using the changeset viewer.
