IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33691


Ignore:
Timestamp:
Apr 3, 2012, 5:51:18 PM (14 years ago)
Author:
bills
Message:

Two files that I forgot for EXPNUM changes

Location:
trunk/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotImageLoop.c

    r32348 r33691  
    7575        pmFPAfileActivate (config->files, false, "PSPHOT.MASK");
    7676        pmFPAfileActivate (config->files, false, "PSPHOT.VARIANCE");
     77        // do not load the exposure number file yet file until we are done with the psphot analysis
     78        pmFPAfileActivate (config->files, false, "PSPHOT.EXPNUM");
    7779        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");
    7880
    7981        // re-activate files so they will be closed and freed below
    80         pmFPAfileActivate (config->files, true, NULL);
     82//        XXX: Defer this
     83//        pmFPAfileActivate (config->files, true, NULL);
    8184
    8285        // there is now only a single chip (multiple readouts?). loop over it and process
     
    150153            }
    151154        }
    152         // save output which is saved at the chip level
    153         if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");
     155        // Defer output and closing of files until we've (possibly) done the NFrames analysis below
     156        pmFPAfileActivate (config->files, false, NULL);
     157
     158        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for Chip in psphot.");
    154159    }
    155     // save output which is saved at the fpa level
     160    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for FPA in psphot.");
     161
     162    // activate the EXPNUM image, cause it to be read in (if it exists), use it to set N Frames for the sources
     163    // and finally iterate up to trigger writing of the output files
     164    pmFPAfileActivate (config->files, true, "PSPHOT.EXPNUM");
     165    while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
     166        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed attempting to load EXPNUM input for Chip in psphot.");
     167        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
     168            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     169                if (! readout->data_exists) { continue; }
     170                if (!psphotSetNFrames (config, view, "PSPHOT.INPUT")) ESCAPE ("failed to setNFrames.");
     171            }
     172        }
     173        // now activate all files to trigger the output
     174        pmFPAfileActivate (config->files, true, NULL);
     175        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed to iterate up Chip in psphot.");
     176    }
    156177    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput for FPA in psphot.");
    157178
  • trunk/psphot/src/psphotSetNFrames.c

    r33690 r33691  
    4242        return true;
    4343    }
     44    psLogMsg ("psphot", PS_LOG_INFO, "Found EXPNUM image for input %d", index);
    4445
    4546    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
Note: See TracChangeset for help on using the changeset viewer.