Changeset 15477
- Timestamp:
- Nov 6, 2007, 1:15:12 PM (19 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 5 edited
-
pmFPAConstruct.c (modified) (3 diffs)
-
pmFPAFlags.c (modified) (3 diffs)
-
pmFPAMosaic.c (modified) (8 diffs)
-
pmHDU.c (modified) (2 diffs)
-
pmHDUGenerate.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAConstruct.c
r15218 r15477 45 45 psMetadata *cellData = psMetadataLookupMetadata(&status, cells, cellName); // The data for the particular cell 46 46 if (!status || !cellData) { 47 ps LogMsg(__func__, PS_LOG_WARN,"Unable to find specs for cell %s: ignored\n", cellName);47 psWarning("Unable to find specs for cell %s: ignored\n", cellName); 48 48 } 49 49 … … 304 304 // Put in the cell data 305 305 if (newCell->config) { 306 ps LogMsg(__func__, PS_LOG_WARN,"Overwriting cell data in chip\n");306 psWarning("Overwriting cell data in chip\n"); 307 307 psFree(newCell->config); // Make way! 308 308 } … … 1304 1304 const char *chipName = componentsItem->name; // Name of the chip 1305 1305 if (componentsItem->type != PS_DATA_STRING) { 1306 ps LogMsg(__func__, PS_LOG_WARN,"Element %s in FPA within the camera configuration is not of "1306 psWarning("Element %s in FPA within the camera configuration is not of " 1307 1307 "type STR (type=%x) --- ignored.\n", chipName, componentsItem->type); 1308 1308 continue; -
trunk/psModules/src/camera/pmFPAFlags.c
r13190 r15477 136 136 137 137 for (int i = 0; i < fpa->chips->n; i++) { 138 pmChip *chip = fpa->chips->data[i];139 if (chip == NULL) continue;140 if (chip->data_exists) return true;138 pmChip *chip = fpa->chips->data[i]; 139 if (chip == NULL) continue; 140 if (chip->data_exists) return true; 141 141 } 142 142 return false; … … 170 170 171 171 if (view->chip == -1) { 172 bool exists = pmFPACheckDataStatus (fpa);173 return exists;172 bool exists = pmFPACheckDataStatus (fpa); 173 return exists; 174 174 } 175 175 176 176 if (view->chip >= fpa->chips->n) { 177 psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n);178 return false;177 psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n); 178 return false; 179 179 } 180 180 pmChip *chip = fpa->chips->data[view->chip]; 181 181 182 182 if (view->cell == -1) { 183 bool exists = pmChipCheckDataStatus (chip);184 return exists;183 bool exists = pmChipCheckDataStatus (chip); 184 return exists; 185 185 } 186 186 187 187 if (view->cell >= chip->cells->n) { 188 psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n);189 return false;188 psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n); 189 return false; 190 190 } 191 191 pmCell *cell = chip->cells->data[view->cell]; 192 192 193 193 if (view->readout == -1) { 194 bool exists = pmCellCheckDataStatus (cell);195 return exists;194 bool exists = pmCellCheckDataStatus (cell); 195 return exists; 196 196 } 197 197 198 198 if (view->readout >= cell->readouts->n) { 199 psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n);200 return false;199 psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n); 200 return false; 201 201 } 202 202 pmReadout *readout = cell->readouts->data[view->readout]; … … 290 290 psArray *chips = fpa->chips; // Component chips 291 291 if (chips == NULL) { 292 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: fpa->chips == NULL\n");292 psWarning("WARNING: fpa->chips == NULL\n"); 293 293 return(0); 294 294 } 295 295 if ((chipNum >= chips->n) || (NULL == (pmChip *) chips->data[chipNum])) { 296 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: the specified chip (%d) does not exist.\n", chipNum);296 psWarning("WARNING: the specified chip (%d) does not exist.\n", chipNum); 297 297 return(0); 298 298 } -
trunk/psModules/src/camera/pmFPAMosaic.c
r15288 r15477 704 704 psArray *readouts = cell->readouts; // The array of readouts 705 705 if (readouts->n > 1) { 706 ps LogMsg(__func__, PS_LOG_WARN, "Cell contains more than one readout (%ld) --- only the first will "707 "be mosaicked.\n",readouts->n);706 psWarning("Cell contains more than one readout (%ld) --- only the first will be mosaicked.\n", 707 readouts->n); 708 708 } 709 709 pmReadout *readout = readouts->data[0]; // The only readout we'll bother with … … 754 754 int x0Target = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.X0"); 755 755 if (!mdok) { 756 ps LogMsg(__func__, PS_LOG_WARN,"CELL.X0 is not set for the target cell; assuming 0.\n");756 psWarning("CELL.X0 is not set for the target cell; assuming 0.\n"); 757 757 FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0); 758 758 } 759 759 int y0Target = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0"); 760 760 if (!mdok) { 761 ps LogMsg(__func__, PS_LOG_WARN,"CELL.Y0 is not set for the target cell; assuming 0.\n");761 psWarning("CELL.Y0 is not set for the target cell; assuming 0.\n"); 762 762 FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0); 763 763 } 764 764 int xParityTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XPARITY"); 765 765 if (!mdok || (xParityTarget != -1 && xParityTarget != 1)) { 766 ps LogMsg(__func__, PS_LOG_WARN,"CELL.XPARITY is not set for the target cell; assuming 1.\n");766 psWarning("CELL.XPARITY is not set for the target cell; assuming 1.\n"); 767 767 FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1); 768 768 xParityTarget = 1; … … 770 770 int yParityTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.YPARITY"); 771 771 if (!mdok || (yParityTarget != -1 && yParityTarget != 1)) { 772 ps LogMsg(__func__, PS_LOG_WARN,"CELL.YPARITY is not set for the target cell; assuming 1.\n");772 psWarning("CELL.YPARITY is not set for the target cell; assuming 1.\n"); 773 773 FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1); 774 774 yParityTarget = 1; … … 863 863 int x0Target = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.X0"); 864 864 if (!mdok) { 865 ps LogMsg(__func__, PS_LOG_WARN,"CHIP.X0 is not set for the target chip; assuming 0.\n");865 psWarning("CHIP.X0 is not set for the target chip; assuming 0.\n"); 866 866 FIX_CONCEPT(targetChip->concepts, "CHIP.X0", S32, 0); 867 867 } 868 868 int y0Target = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.Y0"); 869 869 if (!mdok) { 870 ps LogMsg(__func__, PS_LOG_WARN,"CHIP.Y0 is not set for the target chip; assuming 0.\n");870 psWarning("CHIP.Y0 is not set for the target chip; assuming 0.\n"); 871 871 FIX_CONCEPT(targetChip->concepts, "CHIP.Y0", S32, 0); 872 872 } 873 873 x0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.X0"); 874 874 if (!mdok) { 875 ps LogMsg(__func__, PS_LOG_WARN,"CELL.X0 is not set for the target cell; assuming 0.\n");875 psWarning("CELL.X0 is not set for the target cell; assuming 0.\n"); 876 876 FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0); 877 877 } 878 878 y0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0"); 879 879 if (!mdok) { 880 ps LogMsg(__func__, PS_LOG_WARN,"CELL.Y0 is not set for the target cell; assuming 0.\n");880 psWarning("CELL.Y0 is not set for the target cell; assuming 0.\n"); 881 881 FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0); 882 882 } 883 883 int xParityChipTarget = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.XPARITY"); 884 884 if (!mdok || (xParityChipTarget != -1 && xParityChipTarget != 1)) { 885 ps LogMsg(__func__, PS_LOG_WARN,"CHIP.XPARITY is not set for the target chip; assuming 1.\n");885 psWarning("CHIP.XPARITY is not set for the target chip; assuming 1.\n"); 886 886 FIX_CONCEPT(targetChip->concepts, "CHIP.XPARITY", S32, 1); 887 887 xParityChipTarget = 1; … … 889 889 int yParityChipTarget = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.YPARITY"); 890 890 if (!mdok || (yParityChipTarget != -1 && yParityChipTarget != 1)) { 891 ps LogMsg(__func__, PS_LOG_WARN,"CHIP.YPARITY is not set for the target chip; assuming 1.\n");891 psWarning("CHIP.YPARITY is not set for the target chip; assuming 1.\n"); 892 892 FIX_CONCEPT(targetChip->concepts, "CHIP.YPARITY", S32, 1); 893 893 yParityChipTarget = 1; … … 895 895 int xParityCellTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XPARITY"); 896 896 if (!mdok || (xParityCellTarget != -1 && xParityCellTarget != 1)) { 897 ps LogMsg(__func__, PS_LOG_WARN,"CELL.XPARITY is not set for the target cell; assuming 1.\n");897 psWarning("CELL.XPARITY is not set for the target cell; assuming 1.\n"); 898 898 FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1); 899 899 xParityCellTarget = 1; … … 901 901 int yParityCellTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.YPARITY"); 902 902 if (!mdok || (yParityCellTarget != -1 && yParityCellTarget != 1)) { 903 ps LogMsg(__func__, PS_LOG_WARN,"CELL.YPARITY is not set for the target cell; assuming 1.\n");903 psWarning("CELL.YPARITY is not set for the target cell; assuming 1.\n"); 904 904 FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1); 905 905 yParityCellTarget = 1; … … 1334 1334 pmHDU *sourceHDU = pmHDUGetHighest(source, firstSourceChip, firstSourceCell); // The HDU for the source 1335 1335 if (!sourceHDU) { 1336 ps LogMsg(__func__, PS_LOG_WARN,"Unable to find HDU in source FPA; unable to copy headers.\n");1336 psWarning("Unable to find HDU in source FPA; unable to copy headers.\n"); 1337 1337 return false; 1338 1338 } 1339 1339 pmHDU *targetHDU = pmHDUGetHighest(target, targetChip, targetCell); // The HDU for the target 1340 1340 if (!targetHDU) { 1341 ps LogMsg(__func__, PS_LOG_WARN,"Unable to find HDU in target FPA; unable to copy headers.\n");1341 psWarning("Unable to find HDU in target FPA; unable to copy headers.\n"); 1342 1342 return false; 1343 1343 } -
trunk/psModules/src/camera/pmHDU.c
r12696 r15477 119 119 120 120 if (*images) { 121 ps LogMsg(__func__, PS_LOG_WARN,"HDU %s has already been read --- overwriting.\n", hdu->extname);121 psWarning("HDU %s has already been read --- overwriting.\n", hdu->extname); 122 122 psFree(*images); // Blow away anything existing 123 123 } … … 167 167 168 168 if (!images && !hdu->header) { 169 ps LogMsg(__func__, PS_LOG_WARN,"Nothing to write for HDU %s\n", hdu->extname);169 psWarning("Nothing to write for HDU %s\n", hdu->extname); 170 170 return false; 171 171 } -
trunk/psModules/src/camera/pmHDUGenerate.c
r15327 r15477 134 134 psMetadataItem *biassecItem = psMetadataLookup(cell->concepts, "CELL.BIASSEC"); // Bias sections 135 135 if (!biassecItem) { 136 psLogMsg(__func__, PS_LOG_WARN, "CELL.BIASSEC has not been initialised in cell --- " 137 "ignored.\n"); 136 psWarning("CELL.BIASSEC has not been initialised in cell --- ignored.\n"); 138 137 return false; 139 138 } … … 146 145 if (!mdok || (cellreaddir != 1 && cellreaddir != 2)) { 147 146 // Probably unnecessary, but just in case.... 148 ps LogMsg(__func__, PS_LOG_WARN,"CELL.READDIR is not set in cell --- ignored.\n");147 psWarning("CELL.READDIR is not set in cell --- ignored.\n"); 149 148 return false; 150 149 } … … 152 151 *readdir = cellreaddir; 153 152 } else if (*readdir != cellreaddir) { 154 ps LogMsg(__func__, PS_LOG_WARN,"CELL.READDIR does not match read direction for HDU --- ignored.\n");153 psWarning("CELL.READDIR does not match read direction for HDU --- ignored.\n"); 155 154 return false; 156 155 } … … 255 254 psMetadataItem *trimsecItem = psMetadataLookup(cell->concepts, "CELL.TRIMSEC"); // Item with trimsec 256 255 if (!trimsecItem || trimsecItem->type != PS_DATA_REGION) { 257 psLogMsg(__func__, PS_LOG_WARN, "CELL.TRIMSEC has not been initialised in cell --- " 258 "ignored.\n"); 256 psWarning("CELL.TRIMSEC has not been initialised in cell --- ignored.\n"); 259 257 continue; 260 258 } … … 264 262 if (!mdok || (cellreaddir != 1 && cellreaddir != 2)) { 265 263 // Probably unnecessary, but just in case.... 266 ps LogMsg(__func__, PS_LOG_WARN,"CELL.READDIR is not set in cell --- ignored.\n");264 psWarning("CELL.READDIR is not set in cell --- ignored.\n"); 267 265 continue; 268 266 } … … 270 268 readdir = cellreaddir; 271 269 } else if (readdir != cellreaddir) { 272 ps LogMsg(__func__, PS_LOG_WARN,"CELL.READDIR for cells within the HDU do not match!\n");270 psWarning("CELL.READDIR for cells within the HDU do not match!\n"); 273 271 cellreaddir = readdir; 274 272 } … … 282 280 if (readout->mask && 283 281 (readout->mask->numCols != image->numCols || readout->mask->numRows != image->numRows)) { 284 ps LogMsg(__func__, PS_LOG_WARN,"Image and mask have different sizes (%dx%d vs %dx%d)!\n",282 psWarning("Image and mask have different sizes (%dx%d vs %dx%d)!\n", 285 283 image->numCols, image->numRows, readout->mask->numCols, readout->mask->numRows); 286 284 } 287 285 if (readout->weight && 288 286 (readout->weight->numCols != image->numCols || readout->weight->numRows != image->numRows)) { 289 ps LogMsg(__func__, PS_LOG_WARN,"Image and weight have different sizes (%dx%d vs %dx%d)!\n",287 psWarning("Image and weight have different sizes (%dx%d vs %dx%d)!\n", 290 288 image->numCols, image->numRows, readout->weight->numCols, readout->weight->numRows); 291 289 } … … 318 316 319 317 if (previous != current) { 320 ps LogMsg(__func__, PS_LOG_WARN, "Images within the HDU are of different types "321 "(%x vs %x) --- promoting\n",previous, current);318 psWarning("Images within the HDU are of different types (%x vs %x) --- promoting\n", 319 previous, current); 322 320 return PS_MAX(previous, current); 323 321 } … … 336 334 if (source->numCols != region->x1 - region->x0 || source->numRows != region->y1 - region->y0) { 337 335 psString regionString = psRegionToString(*region); 338 ps LogMsg(__func__, PS_LOG_WARN,"Image size (%dx%d) does not match region (%s).\n",336 psWarning("Image size (%dx%d) does not match region (%s).\n", 339 337 source->numCols, source->numRows, regionString); 340 338 psFree(regionString); … … 475 473 476 474 if (biassecs->n != readout->bias->n) { 477 ps LogMsg(__func__, PS_LOG_WARN, "Number of bias sections (%ld) and number of biases (%ld)"478 " do not match.\n",biassecs->n, readout->bias->n);475 psWarning("Number of bias sections (%ld) and number of biases (%ld) do not match.\n", 476 biassecs->n, readout->bias->n); 479 477 } 480 478 psListIterator *biasIter = psListIteratorAlloc(readout->bias, PS_LIST_HEAD, false); // Iteratr
Note:
See TracChangeset
for help on using the changeset viewer.
