IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10214


Ignore:
Timestamp:
Nov 27, 2006, 6:37:47 PM (19 years ago)
Author:
Paul Price
Message:

Cleaning up.

Location:
trunk/ppImage/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageMosaic.c

    r8751 r10214  
    33#endif
    44
    5 # include "ppImage.h"
     5#include "ppImage.h"
    66
    7 bool ppImageMosaicChip (pmConfig *config, const pmFPAview *view, char *outFile, char *inFile) {
     7bool ppImageMosaicChip(pmConfig *config, const pmFPAview *view, char *outFile, char *inFile)
     8{
     9    bool status;                        // Status of MD lookup
    810
    9     bool status;
    10 
    11     pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile);
     11    pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file
    1212    if (!status) {
    13         psErrorStackPrint(stderr, "Can't find required I/O file!\n");
    14         exit(EXIT_FAILURE);
     13        psErrorStackPrint(stderr, "Can't find required I/O file!\n");
     14        exit(EXIT_FAILURE);
    1515    }
    1616
    17     pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);
     17    pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file
    1818    if (!status) {
    19         psErrorStackPrint(stderr, "Can't find required I/O file!\n");
    20         exit(EXIT_FAILURE);
     19        psErrorStackPrint(stderr, "Can't find required I/O file!\n");
     20        exit(EXIT_FAILURE);
    2121    }
    2222
    23     pmFPAAddSourceFromView (out->fpa, view, out->format);
    24     pmChip *outChip = pmFPAviewThisChip (view, out->fpa);
    25     pmChip *inChip = pmFPAviewThisChip (view, in->fpa);
     23    pmFPAAddSourceFromView(out->fpa, view, out->format);
     24    pmChip *outChip = pmFPAviewThisChip(view, out->fpa);
     25    pmChip *inChip = pmFPAviewThisChip(view, in->fpa);
    2626
     27    // Copy over concepts
    2728    if (!(out->fpa->conceptsRead & PM_CONCEPT_SOURCE_HEADER)) {
    28         psMetadataCopy (out->fpa->concepts, in->fpa->concepts);
    29         out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER;
     29        psMetadataCopy(out->fpa->concepts, in->fpa->concepts);
     30        out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER;
    3031    }
    3132
    32     psTrace ("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
    33     pmChipMosaic (outChip, inChip);
    34 
    35     return true;
     33    psTrace("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n",
     34            in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
     35    return pmChipMosaic(outChip, inChip);
    3636}
    3737
    38 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile) {
     38bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile)
     39{
     40    bool status;                        // Status of MD lookup
    3941
    40     bool status;
    41 
    42     pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile);
     42    pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file
    4343    if (!status) {
    44         psErrorStackPrint(stderr, "Can't find required I/O file!\n");
    45         exit(EXIT_FAILURE);
     44        psErrorStackPrint(stderr, "Can't find required I/O file!\n");
     45        exit(EXIT_FAILURE);
    4646    }
    4747
    48     pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);
     48    pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file
    4949    if (!status) {
    50         psErrorStackPrint(stderr, "Can't find required I/O file!\n");
    51         exit(EXIT_FAILURE);
     50        psErrorStackPrint(stderr, "Can't find required I/O file!\n");
     51        exit(EXIT_FAILURE);
    5252    }
    5353
    5454    // XXX test printing of all concepts
    55     # if 0
     55    #if 0
    5656    for (int i = 0; i < in->fpa->chips->n; i++) {
    57         pmChip *chip = in->fpa->chips->data[i];
    58         for (int j = 0; j < chip->cells->n; j++) {
    59             pmCell *cell = chip->cells->data[j];
    60             psMetadataPrint (stdout, cell->concepts, 2);
    61         }
     57        pmChip *chip = in->fpa->chips->data[i];
     58        for (int j = 0; j < chip->cells->n; j++) {
     59            pmCell *cell = chip->cells->data[j];
     60            psMetadataPrint(stdout, cell->concepts, 2);
     61        }
    6262    }
    63     # endif
     63    #endif
    6464
    65     pmFPAview *view = pmFPAviewAlloc (0);
    66     pmFPAAddSourceFromView (out->fpa, view, out->format);
     65    pmFPAview *view = pmFPAviewAlloc(0);
     66    pmFPAAddSourceFromView(out->fpa, view, out->format);
     67    psFree(view);
    6768
    68     psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
    69     pmFPAMosaic (out->fpa, in->fpa);
    70 
    71     psFree (view);
    72     return true;
     69    psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n",
     70             in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
     71    return pmFPAMosaic(out->fpa, in->fpa);
    7372}
  • trunk/ppImage/src/ppImageOptions.c

    r9857 r10214  
    137137            overscanFit = PM_FIT_SPLINE;
    138138        } else if (strcasecmp(fit, "NONE")) {
    139             psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", fit, RECIPE_NAME);
     139            psLogMsg(__func__, PS_LOG_WARN,
     140                     "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE",
     141                     fit, RECIPE_NAME);
    140142            exit(EXIT_FAILURE);
    141143        }
     
    149151            overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
    150152        } else {
    151             psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", stat, RECIPE_NAME);
     153            psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN",
     154                              stat, RECIPE_NAME);
    152155            exit(EXIT_FAILURE);
    153156        }
     
    173176    // binned image options
    174177    options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN");
    175     if (!status) options->xBin1 = 16;
     178    if (!status) {
     179        psWarning("BIN1.XBIN not found in recipe: setting to default value.\n");
     180        options->xBin1 = 16;
     181    }
    176182    options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN");
    177     if (!status) options->yBin1 = 16;
     183    if (!status) {
     184        psWarning("BIN1.YBIN not found in recipe: setting to default value.\n");
     185        options->yBin1 = 16;
     186    }
    178187
    179188    options->xBin2 = psMetadataLookupS32(&status, recipe, "BIN2.XBIN");
    180     if (!status) options->xBin1 = 16;
     189    if (!status) {
     190        psWarning("BIN2.XBIN not found in recipe: setting to default value.\n");
     191       options->xBin1 = 16;
     192    }
    181193    options->yBin2 = psMetadataLookupS32(&status, recipe, "BIN2.YBIN");
    182     if (!status) options->yBin1 = 16;
     194    if (!status) {
     195        psWarning("BIN2.YBIN not found in recipe: setting to default value.\n");
     196        options->yBin1 = 16;
     197    }
    183198
    184199    options->BaseFITS = psMetadataLookupBool(NULL, recipe, "BASE.FITS");
     
    196211    options->doAstromMosaic = psMetadataLookupBool(NULL, recipe, "ASTROM.MOSAIC");
    197212    if ((options->doAstromChip || options->doAstromMosaic) && !options->doPhotom) {
    198         psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot do ASTROMetry without PHOTOMetry");
     213        psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot do ASTROMetry without PHOTOMetry");
    199214        exit(EXIT_FAILURE);
    200215    }
     
    202217    options->doAddstar = psMetadataLookupBool(NULL, recipe, "ADDSTAR");
    203218    if (options->doAddstar && !(options->doAstromChip || options->doAstromMosaic)) {
    204         psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot Addstar without Astrometry");
     219        psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot Addstar without Astrometry");
    205220        exit(EXIT_FAILURE);
    206221    }
Note: See TracChangeset for help on using the changeset viewer.