Changeset 4694 for trunk/archive/scripts/src/pmFPAConstruct.c
- Timestamp:
- Aug 1, 2005, 2:21:14 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/archive/scripts/src/pmFPAConstruct.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/pmFPAConstruct.c
r4594 r4694 81 81 // Extensions are chips; Content contains a list of cells 82 82 while (contentItem = psMetadataGetAndIncrement(contentsIter)) { 83 const char *extName = contentItem->name; // The name of the extension84 papChip *chip = papChipAlloc(fpa ); // The chip83 psString extName = contentItem->name; // The name of the extension 84 papChip *chip = papChipAlloc(fpa, extName); // The chip 85 85 chip->extname = extName;// Mark chip to receive FITS data 86 86 if (contentItem->type != PS_META_STR) { … … 97 97 while (cellName = psListGetAndIncrement(cellNamesIter)) { 98 98 // Get the cell data 99 papCell *cell = papCellAlloc(chip ); // The cell99 papCell *cell = papCellAlloc(chip, cellName); // The cell 100 100 psMetadata *cellData = getCellData(camera, cellName); 101 101 metadataCopy(cell->values, cellData); … … 109 109 psMetadata *chips = psMetadataAlloc(); // Given a chip name, holds the chip number 110 110 while (contentItem = psMetadataGetAndIncrement(contentsIter)) { 111 const char *extName = contentItem->name; // The name of the extension111 psString extName = contentItem->name; // The name of the extension 112 112 psTrace(__func__, 1, "Getting %s....\n", extName); 113 113 … … 122 122 psLogMsg(__func__, PS_LOG_WARN, "Unable to read contents of %s: ignored.\n", extName); 123 123 } else { 124 const char *chipName = psListGet(contents, 0); // The name of the chip125 const char *cellType = psListGet(contents, 1); // The type of cell124 psString chipName = psListGet(contents, 0); // The name of the chip 125 psString cellType = psListGet(contents, 1); // The type of cell 126 126 psTrace(__func__, 7, "Extension is cell of type %s, from chip %s\n", cellType, 127 127 chipName); … … 129 129 papChip *chip = psMetadataLookupChip(&mdStatus, chips, chipName); // The chip 130 130 if (! mdStatus && ! chip) { 131 chip = papChipAlloc(fpa );131 chip = papChipAlloc(fpa, chipName); 132 132 psMetadataAdd(chips, PS_LIST_TAIL, chipName, PS_META_CHIP, "", chip); 133 133 } … … 135 135 psArray *images = NULL; 136 136 psMetadata *header = NULL; 137 papCell *cell = papCellAlloc(chip ); // The cell137 papCell *cell = papCellAlloc(chip, extName); // The cell 138 138 cell->extname = extName; // Mark cell to receive FITS data 139 139 psMetadata *cellData = getCellData(camera, cellType); … … 147 147 fpa->extname = "PHU"; 148 148 while (contentItem = psMetadataGetAndIncrement(contentsIter)) { 149 const char *chipName = contentItem->name; // The name of the chip149 psString chipName = contentItem->name; // The name of the chip 150 150 151 151 if (contentItem->type != PS_META_STR) { … … 154 154 continue; 155 155 } 156 const char *content = contentItem->data.V; // The content of the extension156 psString content = contentItem->data.V; // The content of the extension 157 157 psTrace(__func__, 5, "Component cells are: %s\n", content); 158 papChip *chip = papChipAlloc(fpa ); // The chip158 papChip *chip = papChipAlloc(fpa, chipName); // The chip 159 159 psList *cellNames = papSplit(content, ", "); // Split the list of cells 160 160 psListIterator *cellNamesIter = psListIteratorAlloc(cellNames, PS_LIST_HEAD, false); … … 162 162 while (cellName = psListGetAndIncrement(cellNamesIter)) { 163 163 psTrace(__func__, 7, "Processing cell %s....\n", cellName); 164 papCell *cell = papCellAlloc(chip ); // The cell164 papCell *cell = papCellAlloc(chip, cellName); // The cell 165 165 psMetadata *cellData = getCellData(camera, cellName); 166 166 metadataCopy(cell->values, cellData); … … 179 179 } else if (strncmp(phuType, "CHIP", 4) == 0) { 180 180 // The FITS file contains a single chip only 181 papChip *chip = papChipAlloc(fpa); // The chip 181 psString chipName = psStringCopy("CHIP"); // Name for chip 182 papChip *chip = papChipAlloc(fpa, chipName); // The chip 182 183 183 184 if (strncmp(extType, "NONE", 4) == 0) { … … 193 194 psList *cellNames = papSplit(contents, " ,"); // Names of cells 194 195 psListIterator *cellIter = psListIteratorAlloc(cellNames, PS_LIST_HEAD, false); // Iterator 195 const char *cellName = NULL;196 psString cellName = NULL; 196 197 while (cellName = psListGetAndIncrement(cellIter)) { 197 papCell *cell = papCellAlloc(chip ); // The cell198 papCell *cell = papCellAlloc(chip, cellName); // The cell 198 199 psMetadata *cellData = getCellData(camera, cellName); 199 200 metadataCopy(cell->values, cellData); … … 219 220 psMetadataItem *contentItem = NULL; // Item from metadata 220 221 while (contentItem = psMetadataGetAndIncrement(contentsIter)) { 221 const char *extName = contentItem->name; // The name of the extension 222 223 psMemCheckCorruption(true); 224 225 psTrace(__func__, 1, "Getting %s....\n", extName); 226 222 psString extName = contentItem->name; // The name of the extension 227 223 // Content is a cell type 228 224 if (contentItem->type != PS_META_STR) { … … 233 229 } 234 230 const char *cellType = contentItem->data.V; // The type of cell 235 psTrace(__func__, 2, "Cell type is %s\n", cellType);231 psTrace(__func__, 5, "Cell type is %s\n", cellType); 236 232 psArray *images = NULL; 237 233 psMetadata *header = NULL; 238 papCell *cell = papCellAlloc(chip ); // The cell234 papCell *cell = papCellAlloc(chip, extName); // The cell 239 235 cell->extname = extName; // Mark cell to receive FITS data 240 236 psMetadata *cellData = getCellData(camera, cellType); … … 266 262 { 267 263 psTrace(__func__, 0, "FPA:\n"); 268 if (fpa->pixels) { 269 psTrace(__func__, 1, "---> FPA contains pixels.\n"); 264 if (fpa->extname) { 265 psTrace(__func__, 1, "---> FPA is extension %s.\n", fpa->extname); 266 if (! fpa->pixels) { 267 psTrace(__func__, 1, "---> NO PIXELS for extension %s\n", fpa->extname); 268 } 270 269 } 271 270 … … 275 274 psTrace(__func__, 1, "Chip: %d\n", i); 276 275 papChip *chip = chips->data[i]; // The chip 277 if (chip->pixels) { 278 psTrace(__func__, 2, "---> Chip contains pixels.\n"); 276 if (chip->extname) { 277 psTrace(__func__, 2, "---> Chip is extension %s.\n", chip->extname); 278 if (! chip->pixels) { 279 psTrace(__func__, 2, "---> NO PIXELS for extension %s\n", chip->extname); 280 } 279 281 } 280 282 // Iterate over the chip … … 283 285 psTrace(__func__, 2, "Cell: %d\n", j); 284 286 papCell *cell = cells->data[j]; // The cell 285 if (cell->pixels) { 286 psTrace(__func__, 3, "---> Cell contains pixels.\n"); 287 if (cell->extname) { 288 psTrace(__func__, 3, "---> Cell is extension %s.\n", cell->extname); 289 if (! cell->pixels) { 290 psTrace(__func__, 3, "---> NO PIXELS for extension %s\n", cell->extname); 291 } 287 292 } 288 293 psMetadataPrint(cell->values, 3); … … 292 297 papReadout *readout = readouts->data[k]; // The readout 293 298 psImage *image = readout->image; // The image 294 psTrace(__func__, 4, "Image: [%d:%d,%d:%d]\n", image->col0, image->col0 + 295 image->numCols, image->row0, image->row0 + image->numRows); 299 psTrace(__func__, 4, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 + 300 image->numCols, image->row0, image->row0 + image->numRows, image->numCols, 301 image->numRows); 296 302 psList *overscans = readout->overscans; // The list of overscans 297 303 psListIterator *overscansIter = psListIteratorAlloc(overscans, PS_LIST_HEAD, false); 298 304 while (image = psListGetAndIncrement(overscansIter)) { 299 psTrace(__func__, 4, "Overscan: [%d:%d,%d:%d]\n", image->col0, image->col0 + 300 image->numCols, image->row0, image->row0 + image->numRows); 305 psTrace(__func__, 4, "Overscan: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 + 306 image->numCols, image->row0, image->row0 + image->numRows, image->numCols, 307 image->numRows); 301 308 } 302 309 psFree(overscansIter);
Note:
See TracChangeset
for help on using the changeset viewer.
