TFPOffset.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2024 by Jesmigel Cantos
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __dsp_TFPOffset_h
10 #define __dsp_TFPOffset_h
11 
12 #include "dsp/TimeSeries.h"
13 
14 namespace dsp {
15 
17  class TFPOffset
18  {
19  unsigned nchan = 0;
20  unsigned npol = 0;
21  unsigned ndim = 0;
22 
23  public:
24 
25  TFPOffset(const TimeSeries* data)
26  {
27  nchan = data->get_nchan();
28  npol = data->get_npol();
29  ndim = data->get_ndim();
30  }
31 
32  uint64_t operator() (uint64_t idat, unsigned ichan, unsigned ipol)
33  {
34  return idat * (nchan * npol * ndim) + ichan * (npol * ndim) + ipol * ndim;
35  }
36 
37  };
38 
39 } // namespace dsp
40 
41 #endif // __dsp_TFPOffset_h
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
unsigned get_ndim() const
Return the dimension of each datum.
Definition: Observation.h:80
unsigned get_npol() const
Return the number of polarizations.
Definition: Observation.h:90
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
Computes array offset into TFP-ordered TimeSeries.
Definition: TFPOffset.h:22
unsigned get_nchan() const
Return the number of channels into which the band is divided.
Definition: Observation.h:85

Generated using doxygen 1.8.17