TScrunch.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __TScrunch_h
10 #define __TScrunch_h
11 
12 #include "dsp/Transformation.h"
13 #include "dsp/TimeSeries.h"
14 
15 namespace dsp {
16 
18 
23  class TScrunch : public Transformation <TimeSeries, TimeSeries>
24  {
25 
26  public:
27 
28  TScrunch (Behaviour place=anyplace);
29 
30  void set_factor ( unsigned samples );
31  unsigned get_factor () const;
32 
33  void set_time_resolution ( double microseconds );
34  double get_time_resolution () const;
35 
36  class Engine;
37 
38  void set_engine (Engine*);
39 
40  protected:
41 
43  void prepare ();
44 
46  void reserve ();
47 
49  void prepare_output ();
50 
52  void transformation ();
53  void tfp_tscrunch ();
54  void fpt_tscrunch ();
55 
56  mutable unsigned factor;
57  mutable double time_resolution;
58 
59  // If true, use the tres parameter, if false use the factor parameter
60  mutable bool use_tres;
61 
62  unsigned sfactor;
63  uint64_t output_ndat;
64  bool prepared;
65 
66  Reference::To<Engine> engine;
67  };
68 
69  class TScrunch::Engine : public OwnStream
70  {
71  public:
72 
73  virtual void fpt_tscrunch (const dsp::TimeSeries * in,
74  dsp::TimeSeries * out,
75  unsigned sfactor) = 0;
76 
77  };
78 }
79 
80 #endif // !defined(__TScrunch_h)
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
void reserve()
Reserve the maximum amount of output space required.
Definition: TScrunch.C:92
Behaviour
All Transformations must define their behaviour.
Definition: Transformation.h:47
Decimates a TimeSeries in the time domain.
Definition: TScrunch.h:28
void transformation()
Perform decimation.
Definition: TScrunch.C:126
void prepare()
Prepare all relevant attributes.
Definition: TScrunch.C:72
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
void prepare_output()
Prepare the output TimeSeries.
Definition: TScrunch.C:108
@ 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

Generated using doxygen 1.8.17