Digitizer.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/Digitizer.h
10 
11 
12 #ifndef __Digitizer_h
13 #define __Digitizer_h
14 
15 #include "dsp/Transformation.h"
16 #include "dsp/TimeSeries.h"
17 #include "dsp/BitSeries.h"
18 
19 namespace dsp {
20 
22  class Digitizer : public Transformation <TimeSeries, BitSeries>
23  {
24 
25  public:
26 
28  Digitizer (const char* name = "Digitizer");
29 
31  virtual void set_nbit (int);
32 
34  int get_nbit () const;
35 
37  virtual void prepare ();
38 
40  virtual void reserve ();
41 
42  protected:
43 
44  virtual void transformation ();
45 
47  virtual void pack () = 0;
48 
49  int nbit;
50 
51  };
52 
53 }
54 
55 #endif // !defined(__Digitizer_h)
virtual void open(const std::string &id)
Prepare the appropriate Input and Unpacker.
Definition: IOManager.C:38
Produces TimeSeries data by integrating an Input with an Unpacker.
Definition: IOManager.h:26
Bit unpacker that keeps a histogram and optimal statistics.
Definition: HistUnpacker.h:25
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
Defines the interface by which Transformations are performed on data.
Definition: Transformation.h:54
static File * create(const char *filename)
Return a pointer to a new instance of the appropriate sub-class.
Definition: File.C:67
static bool verbose
Verbosity flag.
Definition: Observation.h:39
void set_max_iterations(unsigned)
Set the maximum number of iterations before giving up.
Definition: LevelMonitor.C:155
int get_nbit() const
Get the number of bits per sample (FITS BITPIX convention)
Definition: Digitizer.C:31
unsigned get_nbit() const
Return the number of bits per value.
Definition: Observation.h:95
Argument * find(const std::string &name)
static bool verbose
Verbosity flag.
Definition: LevelMonitor.h:38
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to access this instance.
Definition: Observation.C:528
virtual void monitor()
Using input and converter, calculate sampling thresholds.
Definition: LevelMonitor.C:174
void set_input(IOManager *input)
Set the device to be used to plot/log the digitizer statistics.
Definition: LevelMonitor.C:63
double get_rate() const
Return the sampling rate (time samples per second in Hz)
Definition: Observation.h:157
virtual void set_help_header(const std::string &s)
virtual void reserve()
Resize the output.
Definition: Digitizer.C:36
const ScalarMath sqrt(const ScalarMath &x)
std::string name
Operation name.
Definition: Operation.h:153
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
virtual bool eod() const =0
End of data.
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
Load, unpack, filterbank, re-digitize, and write to FITS.
Definition: LoadToFITS.h:71
double get_bandwidth() const
Return the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:147
Writes BitSeries data to a single DADA File.
Definition: DADAOutputFile.h:28
virtual unsigned get_output_ichan(unsigned idig) const
Get the output frequency channel for the given digitizer;.
Definition: HistUnpacker.C:132
virtual unsigned get_output_ipol(unsigned idig) const
Get the output polarization for the given digitizer.
Definition: HistUnpacker.C:123
void set_swap_polarizations(bool swap)
Swap the polarizations.
Definition: LevelMonitor.C:160
void set_consecutive(bool swap)
Read data consecutively (do not seek to end on each iteration)
Definition: LevelMonitor.C:165
static bool verbose
Global verbosity flag.
Definition: Operation.h:48
A container for storing digitized (generally not floating point) data
Definition: BitSeries.h:35
virtual void add(Item *)
std::string get_library()
Load, unpack, process and fold data into phase-averaged profile(s)
Definition: LoadToFil.h:72
virtual void set_version(const std::string &s)
Plots the histograms maintained by HistUnpacker classes.
Definition: BitStatsPlotter.h:28
Multiple LoadToFil threads.
Definition: LoadToFilN.h:22
bool verbose
Multiple LoadToFITS threads.
Definition: LoadToFITSN.h:22
virtual void pack()=0
Perform the digitization.
virtual void set_cutoff_sigma(float cutoff_sigma)
Set the cut off power for impulsive interference excision.
Definition: ExcisionUnpacker.C:286
virtual void prepare()
Copy the input attributes to the output.
Definition: Digitizer.C:14
Abstract base class of Transformations that convert n-bit to float.
Definition: Unpacker.h:42
virtual void set_nbit(int)
Set the number of bits per sample (FITS BITPIX convention)
Definition: Digitizer.C:26
Digitizer(const char *name="Digitizer")
Constructor.
Definition: Digitizer.C:62
virtual unsigned get_ndig() const
Get the number of digitizers (histograms)
Definition: HistUnpacker.C:38
Iterator get_iterator(unsigned idig)
Return the iterator for the specified digitizer.
Definition: Unpacker.C:129
const float version
The baseband/dsp version number.
Definition: dsp.C:19
Decimates input time series.
Definition: LoadToQuantize.h:30
A single LoadToFITS thread.
Definition: LoadToFITS.h:29
virtual std::string help(bool show_default_values=false, bool show_header=false, const char *indent=0)
void set_between_iterations(double seconds)
Set the number of seconds to sleep between iterations.
Definition: LevelMonitor.C:108
Plots the histograms maintained by ExcisionUnpacker.
Definition: ExcisionStatsPlotter.h:26
const InputType * get_input() const
Return pointer to the appropriate InputType.
Definition: UnpackerSource.h:77
A single LoadToFil thread.
Definition: LoadToFil.h:30
Monitors digitizer levels and issues corrective commands.
Definition: LevelMonitor.h:32
const UnpackerType * get_unpacker() const
Return pointer to the appropriate UnpackerType.
Definition: UnpackerSource.h:242
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
Interface to Unpacker iterator implementations.
Definition: UnpackerIterator.h:24
virtual void transformation()
Initialize and resize the output before calling unpack.
Definition: Digitizer.C:46
Parses Observation attributes from an ASCII header.
Definition: ASCIIObservation.h:29
virtual void parse(int argc, char *const *argv)
Excises digitized data with statistics outside of acceptable limits.
Definition: ExcisionUnpacker.h:28
@ OrderFPT
Frequency, Polarization, Time (default before 3 October 2008)
Definition: TimeSeries.h:47
LoadToQuantize configuration.
Definition: LoadToQuantize.h:88

Generated using doxygen 1.8.17