Changeset 10144 for trunk/ppImage/src/ppImageAddstar.c
- Timestamp:
- Nov 22, 2006, 10:45:22 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageAddstar.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageAddstar.c
r8751 r10144 21 21 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, "PSASTRO.OUTPUT"); 22 22 if (!status) { 23 psError (PS_ERR_IO, true, "no PSASTRO.OUTPUT file defined");24 return false;23 psError (PS_ERR_IO, true, "no PSASTRO.OUTPUT file defined"); 24 return false; 25 25 } 26 26 … … 30 30 pmFPAview *view = pmFPAviewAlloc (0); 31 31 if (file->fileLevel == PM_FPA_LEVEL_CHIP) { 32 // call addstar on this file33 setFilename (file, view);34 addstarFile (addstarCommand, file->filename);35 return true;32 // call addstar on this file 33 setFilename (file, view); 34 addstarFile (addstarCommand, file->filename); 35 return true; 36 36 } 37 37 … … 40 40 if (!chip->process || !chip->file_exists) { continue; } 41 41 42 if (file->fileLevel == PM_FPA_LEVEL_CHIP) {43 // call addstar on this file44 setFilename (file, view);45 addstarFile (addstarCommand, file->filename);46 continue;47 }42 if (file->fileLevel == PM_FPA_LEVEL_CHIP) { 43 // call addstar on this file 44 setFilename (file, view); 45 addstarFile (addstarCommand, file->filename); 46 continue; 47 } 48 48 49 while ((cell = pmFPAviewNextCell (view, file->fpa, 1)) != NULL) {50 psLogMsg ("ppImageAddstar", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);51 if (! cell->process || ! cell->file_exists) { continue; }49 while ((cell = pmFPAviewNextCell (view, file->fpa, 1)) != NULL) { 50 psLogMsg ("ppImageAddstar", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 51 if (! cell->process || ! cell->file_exists) { continue; } 52 52 53 if (file->fileLevel == PM_FPA_LEVEL_CELL) {54 // call addstar on this file55 setFilename (file, view);56 addstarFile (addstarCommand, file->filename);57 continue;58 }53 if (file->fileLevel == PM_FPA_LEVEL_CELL) { 54 // call addstar on this file 55 setFilename (file, view); 56 addstarFile (addstarCommand, file->filename); 57 continue; 58 } 59 59 60 // process each of the readouts61 while ((readout = pmFPAviewNextReadout (view, file->fpa, 1)) != NULL) {62 if (! readout->data_exists) { continue; }60 // process each of the readouts 61 while ((readout = pmFPAviewNextReadout (view, file->fpa, 1)) != NULL) { 62 if (! readout->data_exists) { continue; } 63 63 64 if (file->fileLevel == PM_FPA_LEVEL_READOUT) {65 // call addstar on this file66 setFilename (file, view);67 addstarFile (addstarCommand, file->filename);68 continue;69 } else {70 psError (PS_ERR_IO, true, "inconsistent fileLevel for %s: %d\n", file->name, file->fileLevel);71 return false;72 }73 }74 }64 if (file->fileLevel == PM_FPA_LEVEL_READOUT) { 65 // call addstar on this file 66 setFilename (file, view); 67 addstarFile (addstarCommand, file->filename); 68 continue; 69 } else { 70 psError (PS_ERR_IO, true, "inconsistent fileLevel for %s: %d\n", file->name, file->fileLevel); 71 return false; 72 } 73 } 74 } 75 75 } 76 76 return true; … … 90 90 // indirect filenames are not allowed for output 91 91 if (!strcasecmp (file->filename, "@FILES")) { 92 psError(PS_ERR_IO, true, "indirect filenames are not allowed for output : %s\n", file->name);93 return false;92 psError(PS_ERR_IO, true, "indirect filenames are not allowed for output : %s\n", file->name); 93 return false; 94 94 } 95 95 if (!strcasecmp (file->filename, "@DETDB")) { 96 psError(PS_ERR_IO, true, "detrend db filenames are not allowed for output : %s\n", file->name);97 return false;96 psError(PS_ERR_IO, true, "detrend db filenames are not allowed for output : %s\n", file->name); 97 return false; 98 98 } 99 99 return true; … … 104 104 bool status; 105 105 char *addstarLine = psStringSubstitute (addstarCommand, filename, "%s"); 106 106 107 107 // catch addstar stderr/stdout and do what? 108 108 psIOBuffer *buffer = psIOBufferAlloc (512); 109 109 psPipe *pipe = psPipeOpen (addstarLine); 110 status = psIOBufferReadEmpty (buffer, 100, pipe-> stdout);110 status = psIOBufferReadEmpty (buffer, 100, pipe->fd_stdout); 111 111 if (!status) { 112 psError (PS_ERR_IO, false, "detselect is not responding");112 psError (PS_ERR_IO, false, "detselect is not responding"); 113 113 } 114 114 psFree (addstarLine);
Note:
See TracChangeset
for help on using the changeset viewer.
