Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This code implies that we may be able to reduce this time significantly with a "single pass" calibration (I believe Mikhail currently does two passes through the data with numpy: one for pedestals and one for gains):

Code Block
(ps-4.5.24) drp-neh-cmp015:lcls2$ more junk.cc
#include <stdint.h>
#include <stdio.h>

#define RAW_SIZE 2000000
#define NIMG 100
uint16_t raw[NIMG][RAW_SIZE];
float result[RAW_SIZE];
uint16_t peds[RAW_SIZE];
float gains[7][RAW_SIZE];

int main() {
    for (unsigned count=0; count<NIMG; count++) {
        for (unsigned i=0; i<RAW_SIZE; i++) {
            unsigned val = raw[count][i];
            unsigned range = val&0x7000;
            result[i] = (val-peds[i])*gains[range][i];
        }
    }
}

...