OneBitCorrection.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __OneBitCorrection_h
10 #define __OneBitCorrection_h
11 
12 class OneBitCorrection;
13 
14 #include <vector>
15 
16 #include "dsp/Unpacker.h"
17 #include "dsp/TimeSeries.h"
18 #include "dsp/BitSeries.h"
19 
20 #include "environ.h"
21 
22 namespace dsp {
23 
26  class OneBitCorrection: public Unpacker {
27 
28  public:
29 
31  static bool keep_histogram;
32 
34  OneBitCorrection (const char* name = "OneBitCorrection");
35 
37  virtual ~OneBitCorrection ();
38 
40  unsigned get_ndig () const;
41 
43  unsigned get_first_chan(){ return first_chan; }
46  void set_first_chan(unsigned _first_chan){ first_chan = _first_chan; }
47 
49  unsigned get_end_chan(){ return end_chan; }
52  void set_end_chan(unsigned _end_chan){ end_chan = _end_chan; }
53 
54 
55 
56  protected:
57 
59  unsigned first_chan;
61  unsigned end_chan;
62 
64  virtual void transformation ();
65 
67  virtual void unpack ();
68 
70  virtual bool matches (const Observation* observation);
71 
72 
73 
74  private:
75 
77  void generate_lookup();
78 
80  float lookup[256*8];
81 
82  };
83 
84 }
85 
86 
87 #endif
unsigned get_first_chan()
Inquire the first on-disk channel to load [0].
Definition: OneBitCorrection.h:43
Converts a TimeSeries from one-bit digitized to floating-point values Note that algorithm 1 loses nda...
Definition: OneBitCorrection.h:26
virtual void transformation()
Perform the bit conversion transformation on the input TimeSeries.
Definition: OneBitCorrection.C:49
OneBitCorrection(const char *name="OneBitCorrection")
Null constructor.
Definition: OneBitCorrection.C:13
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
unsigned end_chan
Stop loading on-disk channels at this channel (i.e. load one before this channel but not this one) [9...
Definition: OneBitCorrection.h:61
void set_end_chan(unsigned _end_chan)
Set the the on-disk channel at which to stop loading (e.g.
Definition: OneBitCorrection.h:52
unsigned get_nbit() const
Return the number of bits per value.
Definition: Observation.h:95
virtual ~OneBitCorrection()
Virtual destructor.
Definition: OneBitCorrection.C:41
std::string name
Operation name.
Definition: Operation.h:153
void set_first_chan(unsigned _first_chan)
Set the the first on-disk channel to load (0 or 256 at present for two filter observations) [0] 18 Se...
Definition: OneBitCorrection.h:46
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
static bool keep_histogram
Maintain a diagnostic histogram of digitizer statistics.
Definition: OneBitCorrection.h:31
Abstract base class of Transformations that convert n-bit to float.
Definition: Unpacker.h:42
unsigned get_ndig() const
Get the number of independent digitizers.
Definition: OneBitCorrection.C:43
virtual bool matches(const Observation *observation)
Return true if OneBitCorrection can convert the Observation.
Definition: OneBitCorrection.C:280
virtual void unpack()
Unpacking algorithm may be re-defined by sub-classes.
Definition: OneBitCorrection.C:89
unsigned first_chan
First on-disk channel to load in [0].
Definition: OneBitCorrection.h:59
std::string get_machine() const
Return the instrument used to record signal.
Definition: Observation.h:194
unsigned get_end_chan()
Inquire the on-disk channel at which to stop loading [99999].
Definition: OneBitCorrection.h:49

Generated using doxygen 1.8.17