IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 3, 2010, 8:50:52 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/simtest_nebulous_branches
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/simtest_nebulous_branches

  • branches/simtest_nebulous_branches/ppStack/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppStackVersionDefinitions.h
         12ppStackErrorCodes.c
         13ppStackErrorCodes.h
  • branches/simtest_nebulous_branches/ppStack/src/ppStackCamera.c

    r23576 r27840  
    3030        pmFPAfileDefineFromArgs(&found, config, name, "FILENAMES");
    3131    if (!file || !found) {
    32         psError(PS_ERR_UNKNOWN, false, "Unable to define file %s from %s", name, filename);
     32        psError(psErrorCodeLast(), false, "Unable to define file %s from %s", name, filename);
    3333        return NULL;
    3434    }
    3535    if (file->type != type) {
    36         psError(PS_ERR_IO, true, "%s is not of type %s", name, pmFPAfileStringFromType(type));
     36        psError(PS_ERR_IO, PPSTACK_ERR_CONFIG, "%s is not of type %s", name, pmFPAfileStringFromType(type));
    3737        return NULL;
    3838    }
     
    5353    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppSim
    5454    if (!recipe) {
    55         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSTACK_RECIPE);
     55        psError(PPSTACK_ERR_CONFIG, false, "Unable to find recipe %s", PPSTACK_RECIPE);
    5656        return false;
    5757    }
     
    6767                                                           "PPSTACK.INPUT.MASK"); // Input masks
    6868        if (!status) {
    69             psError(PS_ERR_UNKNOWN, false, "Unable to define input masks from RUN metadata.");
     69            psError(psErrorCodeLast(), false, "Unable to define input masks from RUN metadata.");
    7070            psFree(runImages);
    7171            return false;
     
    7676                                                          "PPSTACK.INPUT.VARIANCE"); // Input variances
    7777        if (!status) {
    78             psError(PS_ERR_UNKNOWN, false, "Unable to define input variances from RUN metadata.");
     78            psError(psErrorCodeLast(), false, "Unable to define input variances from RUN metadata.");
    7979            psFree(runImages);
    8080            return false;
     
    8484        }
    8585        psFree(runVars);
    86 
    87         psArray *runPSF = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
    88                                                          "PPSTACK.INPUT.PSF"); // Input PSFs
    89         if (!status) {
    90             psError(PS_ERR_UNKNOWN, false, "Unable to define input PSFs from RUN metadata.");
    91             psFree(runImages);
    92             return false;
    93         }
    94         if (runPSF) {
    95             havePSFs = true;
    96         }
    97         psFree(runPSF);
    9886
    9987        psArray *runSrc = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
    10088                                                         "PPSTACK.INPUT.SOURCES"); // Input sources
    10189        if (!status) {
    102             psError(PS_ERR_UNKNOWN, false, "Unable to define input sources from RUN metadata.");
     90            psError(psErrorCodeLast(), false, "Unable to define input sources from RUN metadata.");
    10391            psFree(runImages);
    10492            return false;
    10593        }
    10694        if (!runSrc) {
    107             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to define input sources from RUN metadata.");
     95            psError(PPSTACK_ERR_CONFIG, true, "Unable to define input sources from RUN metadata.");
    10896            psFree(runImages);
    10997            return false;
     
    112100
    113101        if (convolve) {
    114             psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
    115                                                                 "PPSTACK.CONV.KERNEL"); // Convolution kernels
    116             if (!status) {
    117                 psError(PS_ERR_UNKNOWN, false, "Unable to define convolution kernels from RUN metadata.");
    118                 psFree(runImages);
    119                 return false;
    120             }
    121             if (!runKernel) {
    122                 psError(PS_ERR_UNEXPECTED_NULL, true,
    123                         "Unable to define convolution kernels from RUN metadata.");
    124                 psFree(runImages);
    125                 return false;
    126             }
    127             psFree(runKernel);
     102            {
     103                psArray *runPSF = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
     104                                                         "PPSTACK.INPUT.PSF"); // Input PSFs
     105                if (!status) {
     106                    psError(psErrorCodeLast(), false, "Unable to define input PSFs from RUN metadata.");
     107                    psFree(runImages);
     108                    return false;
     109                }
     110                if (runPSF) {
     111                    havePSFs = true;
     112                }
     113                psFree(runPSF);
     114            }
     115            {
     116
     117                psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
     118                                                                    "PPSTACK.CONV.KERNEL"); // Conv'n kernels
     119                if (!status) {
     120                    psError(psErrorCodeLast(), false,
     121                            "Unable to define convolution kernels from RUN metadata.");
     122                    psFree(runImages);
     123                    return false;
     124                }
     125                if (!runKernel) {
     126                    psError(PPSTACK_ERR_CONFIG, true,
     127                            "Unable to define convolution kernels from RUN metadata.");
     128                    psFree(runImages);
     129                    return false;
     130                }
     131                psFree(runKernel);
     132            }
    128133        }
    129134
     
    133138        psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
    134139        if (!inputs) {
    135             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find inputs.");
     140            psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to find inputs.");
    136141            return false;
    137142        }
     
    141146        while ((item = psMetadataGetAndIncrement(iter))) {
    142147            if (item->type != PS_DATA_METADATA) {
    143                 psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     148                psError(PPSTACK_ERR_ARGUMENTS, true,
    144149                        "Component %s of the input metadata is not of type METADATA", item->name);
    145150                psFree(iter);
     
    151156            psString image = psMetadataLookupStr(NULL, input, "IMAGE"); // Name of image
    152157            if (!image || strlen(image) == 0) {
    153                 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks IMAGE of type STR", item->name);
     158                psError(PPSTACK_ERR_ARGUMENTS, true, "Component %s lacks IMAGE of type STR", item->name);
    154159                psFree(iter);
    155160                return false;
     
    165170                                              image, PM_FPA_FILE_IMAGE); // File for image
    166171            if (!imageFile) {
    167                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", i, image);
     172                psError(psErrorCodeLast(), false, "Unable to define file from image %d (%s)", i, image);
    168173                return false;
    169174            }
     
    171176            if (mask && strlen(mask) > 0 &&
    172177                !defineFile(config, imageFile, "PPSTACK.INPUT.MASK", mask, PM_FPA_FILE_MASK)) {
    173                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask);
     178                psError(psErrorCodeLast(), false, "Unable to define file from mask %d (%s)", i, mask);
    174179                return false;
    175180            }
     
    179184                if (!defineFile(config, imageFile, "PPSTACK.INPUT.VARIANCE", variance,
    180185                                PM_FPA_FILE_VARIANCE)) {
    181                     psError(PS_ERR_UNKNOWN, false,
     186                    psError(psErrorCodeLast(), false,
    182187                            "Unable to define file from variance %d (%s)", i, variance);
    183188                    return false;
     
    191196                    havePSFs = true;
    192197                    if (!defineFile(config, imageFile, "PPSTACK.INPUT.PSF", psf, PM_FPA_FILE_PSF)) {
    193                         psError(PS_ERR_UNKNOWN, false, "Unable to define file from psf %d (%s)", i, psf);
     198                        psError(psErrorCodeLast(), false, "Unable to define file from psf %d (%s)", i, psf);
    194199                        return false;
    195200                    }
    196201                }
    197202            } else if (havePSFs) {
    198                 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF %d", i);
     203                psError(PPSTACK_ERR_CONFIG, true, "Unable to find PSF %d", i);
    199204                return false;
    200205            }
    201206
    202207            if (!sources || strlen(sources) == 0) {
    203                 psError(PS_ERR_UNEXPECTED_NULL, true, "SOURCES not provided for file %d", i);
     208                psError(PPSTACK_ERR_CONFIG, true, "SOURCES not provided for file %d", i);
    204209                return false;
    205210            }
    206211            if (!defineFile(config, imageFile, "PPSTACK.INPUT.SOURCES", sources, PM_FPA_FILE_CMF)) {
    207                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)",
     212                psError(psErrorCodeLast(), false, "Unable to define file from sources %d (%s)",
    208213                        i, sources);
    209214                return false;
     
    213218                pmFPAfile *kernel = pmFPAfileDefineOutput(config, imageFile->fpa, "PPSTACK.CONV.KERNEL");
    214219                if (!kernel) {
    215                     psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.CONV.KERNEL"));
     220                    psError(psErrorCodeLast(), false,
     221                            "Unable to generate output file from PPSTACK.CONV.KERNEL");
    216222                    return false;
    217223                }
     
    229235
    230236    // Output image
    231     pmFPA *fpa = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
    232     if (!fpa) {
    233         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
    234         return false;
    235     }
    236     pmFPAfile *output = pmFPAfileDefineOutput(config, fpa, "PPSTACK.OUTPUT");
    237     psFree(fpa);                        // Drop reference
     237    pmFPA *outFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
     238    if (!outFPA) {
     239        psError(psErrorCodeLast(), false, "Unable to construct an FPA from camera configuration.");
     240        return false;
     241    }
     242    pmFPAfile *output = pmFPAfileDefineOutput(config, outFPA, "PPSTACK.OUTPUT");
     243    psFree(outFPA);                        // Drop reference
    238244    if (!output) {
    239         psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT"));
     245        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT"));
    240246        return false;
    241247    }
    242248    if (output->type != PM_FPA_FILE_IMAGE) {
    243         psError(PS_ERR_IO, true, "PPSTACK.OUTPUT is not of type IMAGE");
     249        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT is not of type IMAGE");
    244250        return false;
    245251    }
    246252    output->save = true;
    247253
    248     if (!pmFPAAddSourceFromFormat(fpa, "Stack", output->format)) {
    249         psError(PS_ERR_UNKNOWN, false, "Unable to generate output FPA.");
    250         psFree(fpa);
     254    if (!pmFPAAddSourceFromFormat(outFPA, "Stack", output->format)) {
     255        psError(psErrorCodeLast(), false, "Unable to generate output FPA.");
    251256        return false;
    252257    }
     
    255260    pmFPAfile *outMask = pmFPAfileDefineOutput(config, output->fpa, "PPSTACK.OUTPUT.MASK");
    256261    if (!outMask) {
    257         psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT.MASK"));
     262        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.MASK"));
    258263        return false;
    259264    }
    260265    if (outMask->type != PM_FPA_FILE_MASK) {
    261         psError(PS_ERR_IO, true, "PPSTACK.OUTPUT.MASK is not of type MASK");
     266        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.MASK is not of type MASK");
    262267        return false;
    263268    }
     
    268273        pmFPAfile *outVariance = pmFPAfileDefineOutput(config, output->fpa, "PPSTACK.OUTPUT.VARIANCE");
    269274        if (!outVariance) {
    270             psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT.VARIANCE"));
     275            psError(psErrorCodeLast(), false, "Unable to generate output file from PPSTACK.OUTPUT.VARIANCE");
    271276            return false;
    272277        }
    273278        if (outVariance->type != PM_FPA_FILE_VARIANCE) {
    274             psError(PS_ERR_IO, true, "PPSTACK.OUTPUT.VARIANCE is not of type VARIANCE");
     279            psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.VARIANCE is not of type VARIANCE");
    275280            return false;
    276281        }
     
    278283    }
    279284
     285
     286    // Exposure image
     287    pmFPA *expFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
     288    if (!expFPA) {
     289        psError(psErrorCodeLast(), false, "Unable to construct an FPA from camera configuration.");
     290        return false;
     291    }
     292    pmFPAfile *exp = pmFPAfileDefineOutput(config, expFPA, "PPSTACK.OUTPUT.EXP");
     293    psFree(expFPA);                        // Drop reference
     294    if (!exp) {
     295        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.EXP"));
     296        return false;
     297    }
     298    if (exp->type != PM_FPA_FILE_IMAGE) {
     299        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.EXP is not of type IMAGE");
     300        return false;
     301    }
     302    exp->save = true;
     303
     304    if (!pmFPAAddSourceFromFormat(expFPA, "Stack", exp->format)) {
     305        psError(psErrorCodeLast(), false, "Unable to generate output FPA.");
     306        return false;
     307    }
     308
     309    // Exposure numbers
     310    pmFPAfile *expNum = pmFPAfileDefineOutput(config, exp->fpa, "PPSTACK.OUTPUT.EXPNUM");
     311    if (!expNum) {
     312        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.EXPNUM"));
     313        return false;
     314    }
     315    if (expNum->type != PM_FPA_FILE_MASK) {
     316        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.EXPNUM is not of type MASK");
     317        return false;
     318    }
     319    expNum->save = true;
     320
     321    // Weighted exposure
     322    pmFPAfile *expWt = pmFPAfileDefineOutput(config, exp->fpa, "PPSTACK.OUTPUT.EXPWT");
     323    if (!expWt) {
     324        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.EXPWT"));
     325        return false;
     326    }
     327    if (expWt->type != PM_FPA_FILE_VARIANCE) {
     328        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.EXPWT is not of type VARIANCE");
     329        return false;
     330    }
     331    expWt->save = true;
     332
     333
    280334    if (havePSFs) {
    281         pmFPAfile *targetPSF = pmFPAfileDefineOutput(config, output->fpa, "PPSTACK.TARGET.PSF");
     335        pmFPA *psfFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain PSF
     336        if (!psfFPA) {
     337            psError(psErrorCodeLast(), false, "Unable to construct an FPA from camera configuration.");
     338            return false;
     339        }
     340        pmFPAfile *targetPSF = pmFPAfileDefineOutput(config, psfFPA, "PPSTACK.TARGET.PSF");
    282341        if (!targetPSF) {
    283             psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.TARGET.PSF"));
    284             return false;
    285         }
     342            psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.TARGET.PSF"));
     343            return false;
     344        }
     345        psFree(psfFPA);
    286346        if (targetPSF->type != PM_FPA_FILE_PSF) {
    287             psError(PS_ERR_IO, true, "PPSTACK.TARGET.PSF is not of type PSF");
     347            psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.TARGET.PSF is not of type PSF");
    288348            return false;
    289349        }
    290350        targetPSF->save = true;
    291351    }
     352
     353    // Unconvolved stack
     354    pmFPA *unconvFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain unconvolved output
     355    if (!unconvFPA) {
     356        psError(psErrorCodeLast(), false, "Unable to construct an FPA from camera configuration.");
     357        return false;
     358    }
     359    pmFPAfile *unConv = pmFPAfileDefineOutput(config, unconvFPA, "PPSTACK.UNCONV");
     360    psFree(unconvFPA);                  // Drop reference
     361    if (!unConv) {
     362        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.UNCONV"));
     363        return false;
     364    }
     365    if (unConv->type != PM_FPA_FILE_IMAGE) {
     366        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV is not of type IMAGE");
     367        return false;
     368    }
     369    unConv->save = true;
     370
     371    if (!pmFPAAddSourceFromFormat(unconvFPA, "Stack", unConv->format)) {
     372        psError(psErrorCodeLast(), false, "Unable to generate output FPA.");
     373        return false;
     374    }
     375
     376    // Unconvolved mask
     377    pmFPAfile *unconvMask = pmFPAfileDefineOutput(config, unconvFPA, "PPSTACK.UNCONV.MASK");
     378    if (!unconvMask) {
     379        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.UNCONV.MASK"));
     380        return false;
     381    }
     382    if (unconvMask->type != PM_FPA_FILE_MASK) {
     383        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV.MASK is not of type MASK");
     384        return false;
     385    }
     386    unconvMask->save = true;
     387
     388    // Unconvolved variance
     389    if (haveVariances) {
     390        pmFPAfile *unconvVariance = pmFPAfileDefineOutput(config, unconvFPA, "PPSTACK.UNCONV.VARIANCE");
     391        if (!unconvVariance) {
     392            psError(psErrorCodeLast(), false, "Unable to generate output file from PPSTACK.UNCONV.VARIANCE");
     393            return false;
     394        }
     395        if (unconvVariance->type != PM_FPA_FILE_VARIANCE) {
     396            psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV.VARIANCE is not of type VARIANCE");
     397            return false;
     398        }
     399        unconvVariance->save = true;
     400    }
     401
     402
     403    // Exposure image
     404    pmFPA *unconvExpFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
     405    if (!unconvExpFPA) {
     406        psError(psErrorCodeLast(), false, "Unable to construct an FPA from camera configuration.");
     407        return false;
     408    }
     409    pmFPAfile *unconvExp = pmFPAfileDefineOutput(config, unconvExpFPA, "PPSTACK.UNCONV.EXP");
     410    psFree(unconvExpFPA);               // Drop reference
     411    if (!unconvExp) {
     412        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.UNCONV.EXP"));
     413        return false;
     414    }
     415    if (unconvExp->type != PM_FPA_FILE_IMAGE) {
     416        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV.EXP is not of type IMAGE");
     417        return false;
     418    }
     419    unconvExp->save = true;
     420
     421    if (!pmFPAAddSourceFromFormat(unconvExpFPA, "Stack", unconvExp->format)) {
     422        psError(psErrorCodeLast(), false, "Unable to generate output FPA.");
     423        return false;
     424    }
     425
     426    // Exposure numbers
     427    pmFPAfile *unconvExpNum = pmFPAfileDefineOutput(config, unconvExp->fpa, "PPSTACK.UNCONV.EXPNUM");
     428    if (!unconvExpNum) {
     429        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.UNCONV.MASK"));
     430        return false;
     431    }
     432    if (unconvExpNum->type != PM_FPA_FILE_MASK) {
     433        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV.EXPNUM is not of type MASK");
     434        return false;
     435    }
     436    unconvExpNum->save = true;
     437
     438    // Weighted exposure
     439    pmFPAfile *unconvExpWt = pmFPAfileDefineOutput(config, unconvExp->fpa, "PPSTACK.UNCONV.EXPWT");
     440    if (!unconvExpWt) {
     441        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.UNCONV.EXPWT"));
     442        return false;
     443    }
     444    if (unconvExpWt->type != PM_FPA_FILE_VARIANCE) {
     445        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.UNCONV.EXPWT is not of type VARIANCE");
     446        return false;
     447    }
     448    unconvExpWt->save = true;
    292449
    293450    // Output JPEGs
    294451    pmFPAfile *jpeg1 = pmFPAfileDefineOutput(config, NULL, "PPSTACK.OUTPUT.JPEG1");
    295452    if (!jpeg1) {
    296         psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT.JPEG1"));
     453        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.JPEG1"));
    297454        return false;
    298455    }
    299456    if (jpeg1->type != PM_FPA_FILE_JPEG) {
    300         psError(PS_ERR_IO, true, "PPSTACK.OUTPUT.JPEG1 is not of type JPEG");
     457        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.JPEG1 is not of type JPEG");
    301458        return false;
    302459    }
     
    304461    pmFPAfile *jpeg2 = pmFPAfileDefineOutput(config, NULL, "PPSTACK.OUTPUT.JPEG2");
    305462    if (!jpeg2) {
    306         psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT.JPEG2"));
     463        psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.JPEG2"));
    307464        return false;
    308465    }
    309466    if (jpeg2->type != PM_FPA_FILE_JPEG) {
    310         psError(PS_ERR_IO, true, "PPSTACK.OUTPUT.JPEG2 is not of type JPEG");
     467        psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.JPEG2 is not of type JPEG");
    311468        return false;
    312469    }
     
    319476        psMetadataLookupBool(&mdok, config->arguments, "-photometry"); // perform photometry
    320477    if (doPhotom) {
    321         // This file, PSPHOT.INPUT, is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
    322         // psphotDefineFiles
     478        // This pmFPAfile, PSPHOT.INPUT, is just used as a carrier; output files (eg,
     479        // PSPHOT.RESID) are defined by psphotDefineFiles
    323480        pmFPAfile *psphotInput = pmFPAfileDefineFromFPA(config, output->fpa, 1, 1, "PSPHOT.INPUT");
    324481        if (!psphotInput) {
    325             psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT"));
    326             return false;
    327         }
     482            psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT"));
     483            return false;
     484        }
     485        // specify the number of psphot input images
     486        psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1);
    328487
    329488        // Define associated psphot input/output files
    330489        if (!psphotDefineFiles(config, psphotInput)) {
    331             psError(PSPHOT_ERR_CONFIG, false,
     490            psError(psErrorCodeLast(), false,
    332491                    "Trouble defining the additional input/output files for psphot");
    333492            return false;
     
    337496        pmFPAfile *outPSF = pmFPAfileDefineOutputFromFile(config, output, "PSPHOT.PSF.SAVE");
    338497        if (!outPSF) {
    339             psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.PSF.SAVE"));
     498            psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.PSF.SAVE"));
    340499            return false;
    341500        }
    342501        if (outPSF->type != PM_FPA_FILE_PSF) {
    343             psError(PS_ERR_IO, true, "PSPHOT.PSF.SAVE is not of type PSF");
     502            psError(PPSTACK_ERR_CONFIG, true, "PSPHOT.PSF.SAVE is not of type PSF");
    344503            return false;
    345504        }
Note: See TracChangeset for help on using the changeset viewer.