IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2010, 5:08:29 PM (16 years ago)
Author:
eugene
Message:

updates to support psphotStack

Location:
trunk/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src

    • Property svn:ignore
      •  

        old new  
        2121psphotForced
        2222psphotMakePSF
         23psphotStack
  • trunk/psphot/src/psphotStackImageLoop.c

    r27547 r27657  
    77}
    88
    9 bool psphotImageLoop (pmConfig *config) {
     9bool psphotStackImageLoop (pmConfig *config) {
    1010
    1111    bool status;
     
    1414    pmReadout *readout;
    1515
     16    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
     17    if (!status) {
     18        psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
     19        return false;
     20    }
     21
    1622    pmFPAview *view = pmFPAviewAlloc (0);
    1723
     
    1925    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot.");
    2026
    21     // XXX for now, we assume there is only a single chip in the PHU:
    22     psphotStackReadout (config, view);
     27    // for psphot, we force data to be read at the chip level
     28    while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
     29        psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
     30        if (! chip->process || ! chip->file_exists) { continue; }
     31        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphotStack.");
     32
     33        // there is now only a single chip (multiple readouts?). loop over it and process
     34        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
     35            psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     36            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Cell in psphotStack.");
     37
     38            // process each of the readouts
     39            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     40                psLogMsg ("psphot", 6, "Readout %d: %x %x\n", view->readout, cell->file_exists, cell->process);
     41                if (! readout->data_exists) { continue; }
     42
     43                // XXX for now, we assume there is only a single chip in the PHU:
     44                if (!psphotStackReadout (config, view)) {
     45                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     46                    psFree (view);
     47                    return false;
     48                }
     49
     50            }
     51            // drop all versions of the internal files
     52            status = true;
     53            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
     54            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
     55            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
     56            if (!status) {
     57                psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
     58                psFree (view);
     59                return false;
     60            }
     61        }
     62        // save output which is saved at the chip level
     63        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");
     64    }
     65    // save output which is saved at the fpa level
     66    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput for FPA in psphot.");
    2367
    2468    // fail if we failed to handle an error
     
    3276   the easiest way to implement this is to assume we can pre-load the full set of images up front.
    3377   with 5 filters and 6000^2 (image, mask, var = 10 byte per pixel), we need 1.8GB, which is not too bad.
    34  */
     78*/
    3579
Note: See TracChangeset for help on using the changeset viewer.