IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24776


Ignore:
Timestamp:
Jul 12, 2009, 3:19:50 PM (17 years ago)
Author:
eugene
Message:

move fpa parsing to after chip parsing so we can apply values interpretted in chip parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStats/src/ppStatsLoop.c

    r18168 r24776  
    1919    psMetadata *newResults = psMetadataAlloc();
    2020
    21     // Iterate through the FPA
     21    // check if we can legitimately iterate to the chip level
     22    psArray *chips = fpa->chips;        // Array of chips
     23    if (view->chip >= chips->n) {
     24        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Desired chip view (%d) doesn't match "
     25                "number of chips (%ld)\n", view->chip, chips->n);
     26        return NULL;
     27    }
     28
     29    // Iterate over chips (if view->chip is set, skip all others)
     30    for (int i = 0; i < chips->n; i++) {
     31        if ((view->chip >= 0) && (i != view->chip)) continue;
     32        pmChip *chip = chips->data[i];  // Chip of interest
     33        *result = ppStatsChip(newResults, chip, fits, view, data, config);
     34        if (*result != PS_EXIT_SUCCESS) {
     35            psError(PS_ERR_UNKNOWN, false, "trouble with stats for chip %d\n", i);
     36            psFree (view);
     37            psFree (newResults);
     38            return NULL;
     39        }
     40    }
     41
     42    // Iterate through the FPA -- Do this after the chip since we in the SPLIT cases, we
     43    // only populate the FPA concepts after chips have been read.
    2244    if (psListLength(data->headers) > 0 && fpa->hdu) {
    2345        if (fits && !pmFPAReadHeader(fpa, fits, config)) {
     
    4365    }
    4466
    45     // check if we can legitimately iterate to the chip level
    46     psArray *chips = fpa->chips;        // Array of chips
    47     if (view->chip >= chips->n) {
    48         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Desired chip view (%d) doesn't match "
    49                 "number of chips (%ld)\n", view->chip, chips->n);
    50         return NULL;
    51     }
    52 
    53     // Iterate over chips (if view->chip is set, skip all others)
    54     for (int i = 0; i < chips->n; i++) {
    55         if ((view->chip >= 0) && (i != view->chip)) continue;
    56         pmChip *chip = chips->data[i];  // Chip of interest
    57         *result = ppStatsChip(newResults, chip, fits, view, data, config);
    58         if (*result != PS_EXIT_SUCCESS) {
    59             psError(PS_ERR_UNKNOWN, false, "trouble with stats for chip %d\n", i);
    60             psFree (view);
    61             psFree (newResults);
    62             return NULL;
    63         }
    64     }
    65 
    6667    if (fits) {
    6768        pmFPAFreeData(fpa);
Note: See TracChangeset for help on using the changeset viewer.