IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27269


Ignore:
Timestamp:
Mar 12, 2010, 9:38:14 AM (16 years ago)
Author:
eugene
Message:

redo apis slightly to allow efficiency to work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225/psphot/src/psphotFitSourcesLinear.c

    r26894 r27269  
    1717    bool status = true;
    1818
     19    // select the appropriate recipe information
     20    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     21    assert (recipe);
     22
    1923    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    2024    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     
    2226    // loop over the available readouts
    2327    for (int i = 0; i < num; i++) {
    24         if (!psphotFitSourcesLinearReadout (config, view, "PSPHOT.INPUT", i, final)) {
     28
     29        // find the currently selected readout
     30        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     31        psAssert (file, "missing file?");
     32
     33        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     34        psAssert (readout, "missing readout?");
     35
     36        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     37        psAssert (detections, "missing detections?");
     38
     39        psArray *sources = detections->allSources;
     40        psAssert (sources, "missing sources?");
     41
     42        pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     43        psAssert (psf, "missing psf?");
     44
     45        if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final)) {
    2546            psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for PSPHOT.INPUT entry %d", i);
    2647            return false;
     
    3051}
    3152
    32 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, bool final) {
     53bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final) {
    3354
    3455    bool status;
     
    3657    float y;
    3758    float f;
    38     // float r;
    39 
    40     // select the appropriate recipe information
    41     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    42     assert (recipe);
    43 
    44     // find the currently selected readout
    45     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    46     psAssert (file, "missing file?");
    47 
    48     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    49     psAssert (readout, "missing readout?");
    50 
    51     pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    52     psAssert (detections, "missing detections?");
    53 
    54     psArray *sources = detections->allSources;
    55     psAssert (sources, "missing sources?");
    5659
    5760    if (!sources->n) {
     
    5962        return true;
    6063    }
    61 
    62     pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    63     psAssert (sources, "missing psf?");
    6464
    6565    psTimerStart ("psphot.linear");
Note: See TracChangeset for help on using the changeset viewer.