Changeset 7328
- Timestamp:
- Jun 2, 2006, 6:06:01 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotOutput.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotOutput.c
r6862 r7328 20 20 21 21 pmMomentsWriteText (sources, output); 22 return true; 23 } 24 25 bool psphotDumpSource (pmSource *source, char *name) { 26 27 FILE *f = fopen (name, "w"); 28 if (f == NULL) psAbort ("psphot", "can't open file"); 29 30 for (int i = 0; i < source->pixels->numRows; i++) { 31 for (int j = 0; j < source->pixels->numCols; j++) { 32 // skip masked points 33 if (source->mask->data.U8[i][j]) { 34 continue; 35 } 36 // skip zero-weight points 37 if (source->weight->data.F32[i][j] == 0) { 38 continue; 39 } 40 41 fprintf (f, "%d %d %f %f %d\n", 42 (j + source->pixels->col0), 43 (i + source->pixels->row0), 44 source->pixels->data.F32[i][j], 45 1.0 / source->weight->data.F32[i][j], 46 source->mask->data.U8[i][j]); 47 } 48 } 49 fclose (f); 22 50 return true; 23 51 }
Note:
See TracChangeset
for help on using the changeset viewer.
