IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15477


Ignore:
Timestamp:
Nov 6, 2007, 1:15:12 PM (19 years ago)
Author:
Paul Price
Message:

Replacing psLogMsg with psWarning

Location:
trunk/psModules/src/camera
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAConstruct.c

    r15218 r15477  
    4545    psMetadata *cellData = psMetadataLookupMetadata(&status, cells, cellName); // The data for the particular cell
    4646    if (!status || !cellData) {
    47         psLogMsg(__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);
    4848    }
    4949
     
    304304        // Put in the cell data
    305305        if (newCell->config) {
    306             psLogMsg(__func__, PS_LOG_WARN, "Overwriting cell data in chip\n");
     306            psWarning("Overwriting cell data in chip\n");
    307307            psFree(newCell->config); // Make way!
    308308        }
     
    13041304        const char *chipName = componentsItem->name; // Name of the chip
    13051305        if (componentsItem->type != PS_DATA_STRING) {
    1306             psLogMsg(__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 "
    13071307                     "type STR (type=%x) --- ignored.\n", chipName, componentsItem->type);
    13081308            continue;
  • trunk/psModules/src/camera/pmFPAFlags.c

    r13190 r15477  
    136136
    137137    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;
    141141    }
    142142    return false;
     
    170170
    171171    if (view->chip == -1) {
    172         bool exists = pmFPACheckDataStatus (fpa);
    173         return exists;
     172        bool exists = pmFPACheckDataStatus (fpa);
     173        return exists;
    174174    }
    175175
    176176    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;
    179179    }
    180180    pmChip *chip = fpa->chips->data[view->chip];
    181181
    182182    if (view->cell == -1) {
    183         bool exists = pmChipCheckDataStatus (chip);
    184         return exists;
     183        bool exists = pmChipCheckDataStatus (chip);
     184        return exists;
    185185    }
    186186
    187187    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;
    190190    }
    191191    pmCell *cell = chip->cells->data[view->cell];
    192192
    193193    if (view->readout == -1) {
    194         bool exists = pmCellCheckDataStatus (cell);
    195         return exists;
     194        bool exists = pmCellCheckDataStatus (cell);
     195        return exists;
    196196    }
    197197
    198198    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;
    201201    }
    202202    pmReadout *readout = cell->readouts->data[view->readout];
     
    290290    psArray *chips = fpa->chips;        // Component chips
    291291    if (chips == NULL) {
    292         psLogMsg(__func__, PS_LOG_WARN, "WARNING: fpa->chips == NULL\n");
     292        psWarning("WARNING: fpa->chips == NULL\n");
    293293        return(0);
    294294    }
    295295    if ((chipNum >= chips->n) || (NULL == (pmChip *) chips->data[chipNum])) {
    296         psLogMsg(__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);
    297297        return(0);
    298298    }
  • trunk/psModules/src/camera/pmFPAMosaic.c

    r15288 r15477  
    704704    psArray *readouts = cell->readouts; // The array of readouts
    705705    if (readouts->n > 1) {
    706         psLogMsg(__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);
    708708    }
    709709    pmReadout *readout = readouts->data[0]; // The only readout we'll bother with
     
    754754    int x0Target = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.X0");
    755755    if (!mdok) {
    756         psLogMsg(__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");
    757757        FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0);
    758758    }
    759759    int y0Target = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0");
    760760    if (!mdok) {
    761         psLogMsg(__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");
    762762        FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0);
    763763    }
    764764    int xParityTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XPARITY");
    765765    if (!mdok || (xParityTarget != -1 && xParityTarget != 1)) {
    766         psLogMsg(__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");
    767767        FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1);
    768768        xParityTarget = 1;
     
    770770    int yParityTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.YPARITY");
    771771    if (!mdok || (yParityTarget != -1 && yParityTarget != 1)) {
    772         psLogMsg(__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");
    773773        FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1);
    774774        yParityTarget = 1;
     
    863863    int x0Target = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.X0");
    864864    if (!mdok) {
    865         psLogMsg(__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");
    866866        FIX_CONCEPT(targetChip->concepts, "CHIP.X0", S32, 0);
    867867    }
    868868    int y0Target = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.Y0");
    869869    if (!mdok) {
    870         psLogMsg(__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");
    871871        FIX_CONCEPT(targetChip->concepts, "CHIP.Y0", S32, 0);
    872872    }
    873873    x0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.X0");
    874874    if (!mdok) {
    875         psLogMsg(__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");
    876876        FIX_CONCEPT(targetCell->concepts, "CELL.X0", S32, 0);
    877877    }
    878878    y0Target += psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.Y0");
    879879    if (!mdok) {
    880         psLogMsg(__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");
    881881        FIX_CONCEPT(targetCell->concepts, "CELL.Y0", S32, 0);
    882882    }
    883883    int xParityChipTarget = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.XPARITY");
    884884    if (!mdok || (xParityChipTarget != -1 && xParityChipTarget != 1)) {
    885         psLogMsg(__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");
    886886        FIX_CONCEPT(targetChip->concepts, "CHIP.XPARITY", S32, 1);
    887887        xParityChipTarget = 1;
     
    889889    int yParityChipTarget = psMetadataLookupS32(&mdok, targetChip->concepts, "CHIP.YPARITY");
    890890    if (!mdok || (yParityChipTarget != -1 && yParityChipTarget != 1)) {
    891         psLogMsg(__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");
    892892        FIX_CONCEPT(targetChip->concepts, "CHIP.YPARITY", S32, 1);
    893893        yParityChipTarget = 1;
     
    895895    int xParityCellTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.XPARITY");
    896896    if (!mdok || (xParityCellTarget != -1 && xParityCellTarget != 1)) {
    897         psLogMsg(__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");
    898898        FIX_CONCEPT(targetCell->concepts, "CELL.XPARITY", S32, 1);
    899899        xParityCellTarget = 1;
     
    901901    int yParityCellTarget = psMetadataLookupS32(&mdok, targetCell->concepts, "CELL.YPARITY");
    902902    if (!mdok || (yParityCellTarget != -1 && yParityCellTarget != 1)) {
    903         psLogMsg(__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");
    904904        FIX_CONCEPT(targetCell->concepts, "CELL.YPARITY", S32, 1);
    905905        yParityCellTarget = 1;
     
    13341334    pmHDU *sourceHDU = pmHDUGetHighest(source, firstSourceChip, firstSourceCell); // The HDU for the source
    13351335    if (!sourceHDU) {
    1336         psLogMsg(__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");
    13371337        return false;
    13381338    }
    13391339    pmHDU *targetHDU = pmHDUGetHighest(target, targetChip, targetCell); // The HDU for the target
    13401340    if (!targetHDU) {
    1341         psLogMsg(__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");
    13421342        return false;
    13431343    }
  • trunk/psModules/src/camera/pmHDU.c

    r12696 r15477  
    119119
    120120    if (*images) {
    121         psLogMsg(__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);
    122122        psFree(*images);                // Blow away anything existing
    123123    }
     
    167167
    168168    if (!images && !hdu->header) {
    169         psLogMsg(__func__, PS_LOG_WARN, "Nothing to write for HDU %s\n", hdu->extname);
     169        psWarning("Nothing to write for HDU %s\n", hdu->extname);
    170170        return false;
    171171    }
  • trunk/psModules/src/camera/pmHDUGenerate.c

    r15327 r15477  
    134134    psMetadataItem *biassecItem = psMetadataLookup(cell->concepts, "CELL.BIASSEC"); // Bias sections
    135135    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");
    138137        return false;
    139138    }
     
    146145    if (!mdok || (cellreaddir != 1 && cellreaddir != 2)) {
    147146        // Probably unnecessary, but just in case....
    148         psLogMsg(__func__, PS_LOG_WARN, "CELL.READDIR is not set in cell --- ignored.\n");
     147        psWarning("CELL.READDIR is not set in cell --- ignored.\n");
    149148        return false;
    150149    }
     
    152151        *readdir = cellreaddir;
    153152    } else if (*readdir != cellreaddir) {
    154         psLogMsg(__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");
    155154        return false;
    156155    }
     
    255254        psMetadataItem *trimsecItem = psMetadataLookup(cell->concepts, "CELL.TRIMSEC"); // Item with trimsec
    256255        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");
    259257            continue;
    260258        }
     
    264262        if (!mdok || (cellreaddir != 1 && cellreaddir != 2)) {
    265263            // Probably unnecessary, but just in case....
    266             psLogMsg(__func__, PS_LOG_WARN, "CELL.READDIR is not set in cell --- ignored.\n");
     264            psWarning("CELL.READDIR is not set in cell --- ignored.\n");
    267265            continue;
    268266        }
     
    270268            readdir = cellreaddir;
    271269        } else if (readdir != cellreaddir) {
    272             psLogMsg(__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");
    273271            cellreaddir = readdir;
    274272        }
     
    282280        if (readout->mask &&
    283281                (readout->mask->numCols != image->numCols || readout->mask->numRows != image->numRows)) {
    284             psLogMsg(__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",
    285283                     image->numCols, image->numRows, readout->mask->numCols, readout->mask->numRows);
    286284        }
    287285        if (readout->weight &&
    288286                (readout->weight->numCols != image->numCols || readout->weight->numRows != image->numRows)) {
    289             psLogMsg(__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",
    290288                     image->numCols, image->numRows, readout->weight->numCols, readout->weight->numRows);
    291289        }
     
    318316
    319317    if (previous != current) {
    320         psLogMsg(__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);
    322320        return PS_MAX(previous, current);
    323321    }
     
    336334    if (source->numCols != region->x1 - region->x0 || source->numRows != region->y1 - region->y0) {
    337335        psString regionString = psRegionToString(*region);
    338         psLogMsg(__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",
    339337                 source->numCols, source->numRows, regionString);
    340338        psFree(regionString);
     
    475473
    476474                if (biassecs->n != readout->bias->n) {
    477                     psLogMsg(__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);
    479477                }
    480478                psListIterator *biasIter = psListIteratorAlloc(readout->bias, PS_LIST_HEAD, false); // Iteratr
Note: See TracChangeset for help on using the changeset viewer.