Changeset 39326
- Timestamp:
- Jan 29, 2016, 2:39:24 PM (10 years ago)
- Location:
- trunk/Ohana/src/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/tools/Makefile
r38986 r39326 17 17 PROGRAMS = gconfig fhead pspsconvert ftable fields list_astro glockfile \ 18 18 radec mktemp precess csystem fits_insert \ 19 medianfilter mefhead ckfits roc random fits_to_mysql 19 medianfilter mefhead ckfits random fits_to_mysql 20 21 # roc 22 # CZW: 2016-01-29 Removing roc from the list of programs, as I've made 23 # changes to it that require the nebclient library. This complicates 24 # the dependency chain, and as roc isn't generally used, pulling it 25 # out is easier than solving that chain. 20 26 21 27 all tools: $(PROGRAMS) … … 28 34 FULL_CPPFLAGS = $(BASE_CPPFLAGS) 29 35 FULL_LDFLAGS = -ldvo -lFITS -lohana $(BASE_LDFLAGS) 36 37 # CZW: required library for roc to compile. 38 # -lnebclient 30 39 31 40 # these are all programs which just depend on a single c file: foo : foo.c -
trunk/Ohana/src/tools/src/roc.c
r33661 r39326 3 3 # include <sys/types.h> 4 4 # include <regex.h> 5 # include <nebclient.h> 5 6 6 7 # define ROC_HEADER_SIZE 0x1000 … … 16 17 int usage (void); 17 18 int print_block (char *header, int *header_size, int *Noff, char *format,...); 19 20 FILE *fopen_harder(char *filename); 18 21 19 22 int main (int argc, char **argv) { … … 241 244 for (i = 0; i < Ninput; i++) { 242 245 if (i == Nfile) continue; 243 input[i] = fopen (inputName[i], "r");246 input[i] = fopen_harder(inputName[i]); 244 247 myAssert (input[i], "failed to open file"); 245 248 } … … 364 367 365 368 ALLOCATE (input, FILE *, Ninput); 366 for (i = 0; i < Ninput; i++) { 367 input[i] = fopen(inputName[i], "r"); 368 myAssert (input[i], "failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName); 369 } 369 int error = 0; 370 for (i = 0; i < Ninput; i++) { 371 // input[i] = fopen(inputName[i], "r"); 372 input[i] = fopen_harder(inputName[i]); 373 // myAssert (input[i], "failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName); 374 if (!(input[i])) { 375 fprintf(stderr,"failed to open input: %d data file: %s in %s\n",i,inputName[i],targetName); 376 error += 1; 377 } 378 } 379 myAssert((error == 0), "Assertation that all were fine failed."); 370 380 371 381 ALLOCATE (inputData, char *, Ninput); … … 409 419 } 410 420 421 FILE *fopen_harder (char *filename) { 422 FILE *try; 423 424 fprintf(stderr,"TRYING: %s\n",filename); 425 try = fopen(filename,"r"); 426 if (try) { return(try); } 427 428 char *root = filerootname(filename); 429 fprintf(stderr,"TRYING: %s\n",root); 430 try = fopen(root,"r"); 431 if (try) { return(try); } 432 433 434 char *key = malloc(sizeof(char) * (strlen(root) + 6)); 435 char *token = strtok(root,"."); 436 sprintf(key,"neb://"); 437 token = strtok(NULL,":"); 438 while (token) { 439 sprintf(key,"%s/%s",key,token); 440 token = strtok(NULL,":"); 441 } 442 sprintf(key,"%s.fits",key); 443 fprintf(stderr,"WILL_TRY: %s\n",key); 444 445 char *disk_file = NULL; 446 nebServer *server = nebServerAlloc("http://ippc08/nebulous"); 447 disk_file = nebFind(server,key); 448 // nebServerFree(server); 449 // free(key); 450 451 if (disk_file) { 452 fprintf(stderr,"TRYING: %s\n",disk_file); 453 try = fopen(disk_file,"r"); 454 if (try) { return(try); } 455 } 456 457 return(NULL); 458 } 459 460 461 462 411 463 int roc_insert (int argc, char **argv) { 412 464
Note:
See TracChangeset
for help on using the changeset viewer.
