FACT++  1.0
void factfits::StageRow ( size_t  row,
char *  dest 
)
inlineprivatevirtual

Reimplemented from zfits.

Definition at line 44 of file factfits.h.

References fits::Table::bytes_per_row, data, fits::fBufferRow, fNumRoi, fOffsetCalibration, fOffsetData, fOffsetStartCellData, fits::fTable, and zfits::StageRow().

45  {
46  zfits::StageRow(row, dest);
47 
48  // This file does not contain fact data or no calibration to be applied
49  if (fOffsetCalibration.empty())
50  return;
51 
52  //re-get the pointer to the data to access the offsets
53  const uint8_t offset = (row*fTable.bytes_per_row)%4;
54 
55  int16_t *startCell = reinterpret_cast<int16_t*>(fBufferRow.data() + offset + fOffsetStartCellData);
56  int16_t *data = reinterpret_cast<int16_t*>(fBufferRow.data() + offset + fOffsetData);
57 
58  /*
59  for (uint32_t i=0; i<1440*1024; i+=1024, startCell++)
60  {
61  if (*startCell < 0)
62  {
63  data += fNumRoi;
64  continue;
65  }
66  for (uint32_t j=0; j<fNumRoi; j++, data++)
67  *data += fOffsetCalibration[i + (*startCell+j)%1024];
68  }
69  */
70 
71  // This version is faster because the compilers optimization
72  // is not biased by the evaluation of %1024
73  for (int ch=0; ch<1440; ch++)
74  {
75  if (startCell[ch]<0)
76  {
77  data += fNumRoi;
78  continue;
79  }
80 
81  const int16_t modStart = startCell[ch] % 1024;
82  const int16_t *off = fOffsetCalibration.data() + ch*1024;
83 
84  const int16_t *cal = off+modStart;
85  const int16_t *end_stride = data+fNumRoi;
86 
87  if (modStart+fNumRoi>1024)
88  {
89  while (cal<off+1024)
90  *data++ += *cal++;
91 
92  cal = off;
93  }
94  while (data<end_stride)
95  *data++ += *cal++;
96  }
97 
98  }
size_t bytes_per_row
Definition: fits.h:96
size_t fOffsetStartCellData
Definition: factfits.h:199
Table fTable
Definition: fits.h:502
std::vector< int16_t > fOffsetCalibration
integer values of the drs calibration used for compression
Definition: factfits.h:197
std::vector< char > fBufferRow
Definition: fits.h:511
float data[4 *1440]
size_t fOffsetData
Definition: factfits.h:200
virtual void StageRow(size_t row, char *dest)
Definition: zfits.h:71
uint16_t fNumRoi
Definition: factfits.h:202

+ Here is the call graph for this function: