IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 23, 2007, 12:41:52 PM (19 years ago)
Author:
Paul Price
Message:

Bug fixes and small improvements to get it working properly. Seems to work OK now, but hasn't been tested rigourously.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCamera.c

    r13464 r13489  
    104104
    105105    // Output image
    106     pmFPAfile *output = pmFPAfileDefineOutput(config, NULL, "PPSTACK.OUTPUT");
     106    pmFPA *fpa = pmFPAConstruct(config->camera); // FPA to contain the output
     107    if (!fpa) {
     108        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
     109        return false;
     110    }
     111    pmFPAfile *output = pmFPAfileDefineOutput(config, fpa, "PPSTACK.OUTPUT");
     112    psFree(fpa);                        // Drop reference
    107113    if (!output) {
    108114        psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.OUTPUT"));
     
    113119        return false;
    114120    }
     121
     122    // Generate the correct structure
     123    pmFPALevel phuLevel = pmFPAPHULevel(output->format); // Level at which PHU goes
     124    pmFPAview *view = pmFPAviewAlloc(0);// View for current level
     125    if (phuLevel == PM_FPA_LEVEL_FPA) {
     126        if (!pmFPAAddSourceFromView(fpa, "Stack", view, output->format)) {
     127            psError(PS_ERR_UNKNOWN, false, "Unable to add PHU to FPA.");
     128            psFree(fpa);
     129            psFree(view);
     130            return NULL;
     131        }
     132    } else {
     133        pmChip *chip;                       // Chip from FPA
     134        while ((chip = pmFPAviewNextChip(view, fpa, 1))) {
     135            if (phuLevel == PM_FPA_LEVEL_CHIP) {
     136                if (!pmFPAAddSourceFromView(fpa, "Stack", view, output->format)) {
     137                    psError(PS_ERR_UNKNOWN, false, "Unable to add PHU to FPA.");
     138                    psFree(fpa);
     139                    psFree(view);
     140                    return NULL;
     141                }
     142            } else {
     143                pmCell *cell;                   // Cell from chip
     144                while ((cell = pmFPAviewNextCell(view, fpa, 1))) {
     145                    if (phuLevel == PM_FPA_LEVEL_CELL) {
     146                        if (!pmFPAAddSourceFromView(fpa, "Stack", view, output->format)) {
     147                            psError(PS_ERR_UNKNOWN, false, "Unable to add PHU to FPA.");
     148                            psFree(fpa);
     149                            psFree(view);
     150                            return NULL;
     151                        }
     152                    }
     153                }
     154            }
     155        }
     156    }
     157    psFree(view);
    115158
    116159    // Output mask
Note: See TracChangeset for help on using the changeset viewer.