Changeset 9699
- Timestamp:
- Oct 20, 2006, 5:26:12 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPAConstruct.c (modified) (5 diffs)
-
pmHDUUtils.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAConstruct.c
r9588 r9699 797 797 798 798 799 // Print spaces to indent 800 #define INDENT(FILE, LEVEL) \ 801 { \ 802 for (int i = 0; i < (LEVEL); i++) { \ 803 fprintf(FILE, " "); \ 804 } \ 805 } 806 799 807 void pmFPAPrint(FILE *fd, const pmFPA *fpa, bool header, bool concepts) 800 808 { 801 809 PS_ASSERT_PTR_NON_NULL(fpa,); 802 810 803 psTrace("psModules.camera", 1, "FPA:\n"); 811 IDENT(fd, 1); 812 fprintf(fd, 1, "FPA:\n"); 804 813 if (fpa->hdu) { 805 814 pmHDUPrint(fd, fpa->hdu, 2, header); … … 812 821 // Iterate over the FPA 813 822 for (int i = 0; i < chips->n; i++) { 814 psTrace("psModules.camera", 3, "Chip: %d\n", i); 823 INDENT(fd, 3); 824 fprintf(fd, "Chip: %d\n", i); 815 825 pmChip *chip = chips->data[i]; // The chip 816 826 if (chip->hdu) { … … 824 834 psArray *cells = chip->cells; // Array of cells 825 835 for (int j = 0; j < cells->n; j++) { 826 psTrace("psModules.camera", 5, "Cell: %d\n", j); 836 INDENT(fd, 5); 837 fprintf(fd, "Cell: %d\n", j); 827 838 pmCell *cell = cells->data[j]; // The cell 828 839 if (cell->hdu) { … … 836 847 for (int k = 0; k < readouts->n; k++) { 837 848 pmReadout *readout = readouts->data[k]; // The readout 838 psTrace("psModules.camera", 6, "Readout %d:\n", k); 839 psTrace("psModules.camera", 7, "row0: %d\n", readout->row0); 840 psTrace("psModules.camera", 7, "col0: %d\n", readout->col0); 849 INDENT(fd, 6); 850 fprintf(fd, "Readout %d:\n", k); 851 INDENT(fd, 7); 852 fprintf(fd, "col0: %d\n", readout->col0); 853 INDENT(fd, 7); 854 fprintf(fd, "row0: %d\n", readout->row0); 841 855 psImage *image = readout->image; // The image 842 856 psList *bias = readout->bias; // The list of bias images 843 857 if (image) { 844 psTrace("psModules.camera", 7, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 + 858 INDENT(fd, 7); 859 fprintf(fd, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 + 845 860 image->numCols, image->row0, image->row0 + image->numRows, image->numCols, 846 861 image->numRows); … … 850 865 psImage *biasImage = NULL; // Bias image from iteration 851 866 while ((biasImage = psListGetAndIncrement(biasIter))) { 852 psTrace("psModules.camera", 7, "Bias: [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0, 867 INDENT(fd, 7); 868 fprintf(fd, "Bias: [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0, 853 869 biasImage->col0 + biasImage->numCols, biasImage->row0, 854 870 biasImage->row0 + biasImage->numRows, biasImage->numCols, biasImage->numRows); -
trunk/psModules/src/camera/pmHDUUtils.c
r9608 r9699 80 80 } 81 81 82 // Print spaces to indent 83 #define INDENT(FILE, LEVEL) \ 84 { \ 85 for (int i = 0; i < (LEVEL); i++) { \ 86 fprintf(FILE, " "); \ 87 } \ 88 } 89 82 90 void pmHDUPrint(FILE *fd, const pmHDU *hdu, int level, bool header) 83 91 { 84 92 PS_ASSERT_PTR_NON_NULL(hdu,); 85 93 86 #ifndef PS_NO_TRACE 87 94 INDENT(fd, level); 88 95 if (hdu->blankPHU) { 89 psTrace("psModules.camera", level, "HDU: (PHU)\n");96 fprintf(fd, "HDU: (PHU)\n"); 90 97 } else { 91 psTrace("psModules.camera", level, "HDU: %s\n", hdu->extname);98 fprintf(fd, "HDU: %s\n", hdu->extname); 92 99 } 93 100 94 psTrace("psModules.camera", level + 1, "Format: %p\n", hdu->format); 101 INDENT(fd, level + 1); 102 fprintf(fd, "Format: %p\n", hdu->format); 95 103 if (header) { 104 INDENT(fd, level + 1); 96 105 if (hdu->header) { 97 psTrace("psModules.camera", level + 1, "Header:\n");106 fprintf(fd, "Header:\n"); 98 107 psMetadataPrint(fd, hdu->header, level + 2); 99 108 } else { 100 psTrace("psModules.camera", level + 1, "No header.\n");109 fprintf(fd, "No header.\n"); 101 110 } 102 111 } 103 112 113 INDENT(fd, level + 1); 104 114 if (hdu->images) { 105 psTrace("psModules.camera", level + 1, "Images:\n");115 fprintf(fd, "Images:\n"); 106 116 for (long i = 0; i < hdu->images->n; i++) { 107 117 psImage *image = hdu->images->data[i]; // Image of interest 108 psTrace("psModules.camera", level + 2, "%ld: %dx%d\n", i, image->numCols, image->numRows); 118 INDENT(fd, level + 2); 119 fprintf(fd, "%ld: %dx%d\n", i, image->numCols, image->numRows); 109 120 } 110 121 } else { 111 psTrace("psModules.camera", level + 1, "NO images.\n");122 fprintf(fd, "NO images.\n"); 112 123 } 113 124 125 INDENT(fd, level + 1); 114 126 if (hdu->masks) { 115 psTrace("psModules.camera", level + 1, "Masks:\n");127 fprintf(fd, "Masks:\n"); 116 128 for (long i = 0; i < hdu->masks->n; i++) { 117 129 psImage *mask = hdu->masks->data[i]; // Mask of interest 118 psTrace("psModules.camera", level + 2, "%ld: %dx%d\n", i, mask->numCols, mask->numRows); 130 INDENT(fd, level + 2); 131 fprintf(fd, "%ld: %dx%d\n", i, mask->numCols, mask->numRows); 119 132 } 120 133 } else { 121 psTrace("psModules.camera", level + 1, "NO masks.\n");134 fprintf(fd, "NO masks.\n"); 122 135 } 123 136 137 INDENT(fd, level + 1); 124 138 if (hdu->weights) { 125 psTrace("psModules.camera", level + 1, "Weights:\n");139 fprintf(fd, "Weights:\n"); 126 140 for (long i = 0; i < hdu->masks->n; i++) { 127 141 psImage *weight = hdu->weights->data[i]; // Weight image of interest 128 psTrace("psModules.camera", level + 2, "%ld: %dx%d\n", i, weight->numCols, weight->numRows); 142 INDENT(fd, level + 2); 143 fprintf(fd, "%ld: %dx%d\n", i, weight->numCols, weight->numRows); 129 144 } 130 145 } else { 131 psTrace("psModules.camera", level + 1, "NO weights.\n");146 fprintf(fd, "NO weights.\n"); 132 147 } 133 #endif134 148 135 149 return;
Note:
See TracChangeset
for help on using the changeset viewer.
