IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 19, 2014, 3:22:46 PM (12 years ago)
Author:
bills
Message:

have psastro output a mask for each chip ASTROM_CHIPS. It has
the value 1 << chip_num if sucessfull otherwise zero
ppStatsFromMetadata ors them all together and then
add to camProcessedExp.
If all 60 gpc1 chips get an astronomical fit the value is 1152921504606846975

File:
1 edited

Legend:

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

    r23989 r36914  
    11# include "ppStatsInternal.h"
     2
     3static void computeBitwiseOr(ppStatsEntry *entry);
    24
    35// calculate the stats for the non-constant entries (already calculated)
     
    1113        // XXX skip or warn on missing stats?
    1214        if (!entry->vector) continue;
     15
     16        if (!strcasecmp (entry->statistic, "bitwiseor")) {
     17            computeBitwiseOr(entry);
     18            continue;
     19        }
    1320
    1421        psStatsOptions option;
     
    6875    return true;
    6976}
     77
     78static void computeBitwiseOr(ppStatsEntry *entry)
     79{
     80    psU64 result = 0;
     81    psVector *vector = entry->vector;
     82    for (int j = 0; j < vector->n; j++) {
     83        // XXX: should we handle other types
     84        if (entry->type == PS_DATA_U64) {
     85            result |= vector->data.U64[j];
     86        } else if (entry->type == PS_DATA_U32) {
     87            result |= vector->data.U32[j];
     88        } else {
     89            return;
     90        }
     91    }
     92
     93    if (entry->type == PS_DATA_U64) {
     94        entry->value = psMetadataItemAllocU64(entry->keyword, entry->statistic, result);
     95    } else {
     96        entry->value = psMetadataItemAllocU32(entry->keyword, entry->statistic, result);
     97    }
     98
     99    return;
     100}
     101
Note: See TracChangeset for help on using the changeset viewer.