SubByteTwoBitCorrection.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/SubByteTwoBitCorrection.h
10 
11 #ifndef __SubByteTwoBitCorrection_h
12 #define __SubByteTwoBitCorrection_h
13 
14 #include "dsp/TwoBitCorrection.h"
15 #include "dsp/TwoBitMask.h"
16 #include "dsp/TwoBit1or2.h"
17 
18 namespace dsp {
19 
21 
24  class SubByteTwoBitCorrection: public TwoBitCorrection {
25 
26  public:
27 
29  SubByteTwoBitCorrection (const char* name = "SubByteTwoBitCorrection");
30 
33 
35  virtual unsigned get_ndig_per_byte () const;
36 
38  virtual unsigned get_input_offset (unsigned idig) const;
39 
41  virtual unsigned get_input_incr () const;
42 
44  virtual unsigned get_shift (unsigned idig, unsigned isamp) const;
45 
46  unsigned get_output_ipol (unsigned idig) const;
47  unsigned get_output_ichan (unsigned idig) const;
48  unsigned get_output_offset (unsigned idig) const;
49  unsigned get_output_incr () const;
50 
51  protected:
52 
54  void dig_unpack (const unsigned char* input_data,
55  float* output_data,
56  uint64_t ndat,
57  unsigned long* hist,
58  unsigned* weights = 0,
59  unsigned nweights = 0);
60 
61  TwoBitLookup* get_unpacker ();
62 
65 
68  };
69 
70 }
71 
72 #endif
void excision_unpack(U &unpack, Iterator &input, float *output_data, uint64_t ndat, unsigned long *hist, unsigned *weights, unsigned nweights)
Template method can be used to implement pure virtual dig_unpack.
An iterator through contiguous data.
Definition: StepIterator.h:16
unsigned get_output_incr() const
Definition: SubByteTwoBitCorrection.C:185
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
void dig_unpack(const unsigned char *input_data, float *output_data, uint64_t ndat, unsigned long *hist, unsigned *weights=0, unsigned nweights=0)
Default unpacking algorithm.
Definition: SubByteTwoBitCorrection.C:69
TwoBit< 2, ShiftMask< 2 > > unpack2
Used to unpack two 2-bit samples from each byte.
Definition: SubByteTwoBitCorrection.h:77
std::string name
Operation name.
Definition: Operation.h:153
TwoBit< 1, ShiftMask< 1 > > unpack1
Used to unpack one 2-bit sample from each byte.
Definition: SubByteTwoBitCorrection.h:74
Unpack one or two 2-bit samples per byte from an array of bytes.
Definition: TwoBit1or2.h:102
unsigned get_output_offset(unsigned idig) const
Definition: SubByteTwoBitCorrection.C:176
virtual unsigned get_ndig_per_byte() const
Get the number of digitizer outputs in one byte.
Definition: SubByteTwoBitCorrection.C:29
virtual unsigned get_input_offset(unsigned idig) const
Return the offset (number of bytes) into input for the given digitizer.
Definition: SubByteTwoBitCorrection.C:36
Converts BitSeries data from two-bit digitized to floating-point values.
Definition: TwoBitCorrection.h:39
Creates lookup table for 2-bit dynamic output level setting.
Definition: TwoBitLookup.h:23
~SubByteTwoBitCorrection()
Destructor.
Definition: SubByteTwoBitCorrection.C:24
virtual unsigned get_input_incr() const
Return the offset to the next byte of input data.
Definition: SubByteTwoBitCorrection.C:42
virtual unsigned get_shift(unsigned idig, unsigned isamp) const
Return the bit shift for the given digitizer and the given sample.
Definition: SubByteTwoBitCorrection.C:49
unsigned get_output_ipol(unsigned idig) const
Get the output polarization for the given digitizer.
Definition: SubByteTwoBitCorrection.C:133
SubByteTwoBitCorrection(const char *name="SubByteTwoBitCorrection")
Default constructor.
Definition: SubByteTwoBitCorrection.C:19
unsigned get_output_ichan(unsigned idig) const
Get the output frequency channel for the given digitizer;.
Definition: SubByteTwoBitCorrection.C:152

Generated using doxygen 1.8.17