FloatUnpacker.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/FloatUnpacker.h
10 
11 #ifndef __FloatUnpacker_h
12 #define __FloatUnpacker_h
13 
14 #include "dsp/Unpacker.h"
15 
16 namespace dsp {
17 
19  class FloatUnpacker: public Unpacker
20  {
21 
22  public:
23 
25  FloatUnpacker (const char* name = "FloatUnpacker");
26 
28  void unpack ();
29 
31  bool matches (const Observation* observation);
32 
35 
38 
40  bool get_device_supported (Memory*) const;
41 
43  void set_device (Memory*);
44 
46  class Engine;
47 
49  void set_engine (Engine*);
50 
51  protected:
52 
55 
56  private:
57 
59  bool device_prepared;
60 
61  };
62 
63  class FloatUnpacker::Engine : public Reference::Able
64  {
65  public:
66 
67  virtual bool get_device_supported (Memory* memory) const = 0;
68 
69  virtual void setup () = 0;
70 
71  virtual void unpack(const BitSeries * input, TimeSeries * output) = 0;
72 
73  };
74 
75 }
76 
77 #endif
bool matches(const Observation *observation)
Return true if we can convert the Observation.
Definition: FloatUnpacker.C:34
virtual unsigned get_npol() const=0
virtual void set_bandwidth(double _bandwidth)
Set the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:145
void phase(Profile *input)
bool get_device_supported(Memory *) const
Return true if the unpacker can operate on the specified device.
Definition: FloatUnpacker.C:129
virtual void set_device(Memory *)
Set the device on which the unpacker will operate.
Definition: Unpacker.C:79
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
unsigned get_nbit() const
Return the number of bits per value.
Definition: Observation.h:95
double get_centre_frequency(unsigned ichan) const
Order
Order of the dimensions.
Definition: TimeSeries.h:39
virtual unsigned get_nsubint() const=0
void set_device(Memory *)
Set the device on which the unpacker will operate.
Definition: FloatUnpacker.C:143
Manages CUDA device memory allocation and destruction.
Definition: MemoryCUDA.h:32
std::string name
Operation name.
Definition: Operation.h:153
virtual void set_dispersion_measure(double dm)
Set the pulsar dispersion mesure.
Definition: Observation.h:202
void rotate_phase(double phase)
virtual unsigned get_nchan() const=0
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
virtual double get_centre_frequency() const=0
Integration * get_Integration(unsigned subint)
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
Profile * get_Profile(unsigned subint, unsigned pol, unsigned chan)
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 double get_bandwidth() const=0
Abstract base class of Transformations that convert n-bit to float.
Definition: Unpacker.h:42
void set_output_order(TimeSeries::Order)
Set the order of the dimensions in the output TimeSeries.
Definition: FloatUnpacker.C:48
void unpack()
The unpacking routine.
Definition: FloatUnpacker.C:54
bool get_order_supported(TimeSeries::Order) const
Return true if the output order is supported.
Definition: FloatUnpacker.C:42
FloatUnpacker(const char *name="FloatUnpacker")
Null constructor.
Definition: FloatUnpacker.C:27
virtual void set_centre_frequency(double cf)
Set the centre frequency of the band-limited signal in MHz.
Definition: Observation.h:132
Reference::To< Engine > engine
Interface to alternate processing engine (e.g. GPU)
Definition: FloatUnpacker.h:64
void set_engine(Engine *)
Set the Engine to be used.
Definition: FloatUnpacker.C:121
virtual void set_rate(double _rate)
Set the sampling rate (time samples per second in Hz)
Definition: Observation.h:155
virtual double get_folding_period() const=0
virtual double get_dispersion_measure() const=0
Pure virtual base class of objects that manage memory allocation and destruction.
Definition: Memory.h:23
static const double dm_dispersion
Conversion factor between dispersion measure, DM, and dispersion, D.
Definition: Dedispersion.h:31
std::string get_machine() const
Return the instrument used to record signal.
Definition: Observation.h:194
virtual bool get_device_supported(Memory *) const
Return true if the unpacker can operate on the specified device.
Definition: Unpacker.C:73
Reference::To< const BitSeries > input
Container from which input data will be read.
Definition: HasInput.h:49
@ OrderFPT
Frequency, Polarization, Time (default before 3 October 2008)
Definition: TimeSeries.h:47
@ OrderTFP
Time, Frequency, Polarization (better for many things)
Definition: TimeSeries.h:50
Reference::To< TimeSeries > output
Container into which output data will be written.
Definition: HasOutput.h:49

Generated using doxygen 1.8.17