IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2010, 3:23:07 PM (16 years ago)
Author:
Paul Price
Message:

Merging development branch branches/pap_stack/ (exposure maps and their compression).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppStack/src/ppStackCamera.c

    r27402 r27417  
    283283    }
    284284
     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
    285334    if (havePSFs) {
    286335        pmFPA *psfFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain PSF
     
    302351    }
    303352
    304 #if 1
    305353    // Unconvolved stack
    306354    pmFPA *unconvFPA = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain unconvolved output
     
    351399        unconvVariance->save = true;
    352400    }
    353 #endif
     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;
    354449
    355450    // Output JPEGs
Note: See TracChangeset for help on using the changeset viewer.