LoadToFil.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2011 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Signal/General/dsp/LoadToFil.h
10 
11 #ifndef __dspsr_LoadToFil_h
12 #define __dspsr_LoadToFil_h
13 
14 #include "dsp/SingleThread.h"
15 #include "dsp/TimeSeries.h"
16 #include "dsp/Filterbank.h"
17 #include "dsp/FilterbankConfig.h"
18 #include "dsp/Dedispersion.h"
19 #include "dsp/OutputFile.h"
20 #include "dsp/TwoBitCorrectionConfig.h"
21 
22 namespace dsp {
23 
25  class LoadToFil : public SingleThread
26  {
27 
28  public:
29 
31  class Config;
32 
34  void set_configuration (Config*);
35 
37  LoadToFil (Config* config = 0);
38 
40  void construct ();
41 
43  void prepare ();
44 
45  private:
46 
47  friend class LoadToFilN;
48 
50  Reference::To<Config> config;
51 
53  Reference::To<Filterbank> filterbank;
54 
57 
59  Reference::To<OutputFile> outputFile;
60 
62  static bool verbose;
63 
64  };
65 
67  class LoadToFil::Config : public SingleThread::Config
68  {
69  public:
70 
71  // Sets default values
72  Config ();
73 
74  // input data block size in MB
75  double block_size;
76 
77  // order in which the unpacker will output time samples
79 
81  TwoBitCorrection::Config twobit_config;
82 
84  Filterbank::Config filterbank;
85 
88 
90  double dispersion_measure;
91 
93  bool dedisperse;
94 
96  bool coherent_dedisp;
97 
99  unsigned tscrunch_factor;
100 
102  unsigned fscrunch_factor;
103 
105  unsigned npol;
106 
108  int poln_select;
109 
111  double rescale_seconds;
112 
114  bool rescale_constant;
115 
117  float scale_fac;
118 
120  int nbits;
121 
123  std::string output_filename;
124 
126  virtual void set_quiet ();
127 
129  virtual void set_verbose();
130 
132  virtual void set_very_verbose();
133 
134  };
135 }
136 
137 #endif // !defined(__LoadToFil_h)
138 
139 
140 
141 
142 
void set_nbit(int)
Set the number of bits per sample.
Definition: SigProcDigitizer.C:19
Produces TimeSeries data by integrating an Input with an Unpacker.
Definition: IOManager.h:26
void set_output_state(Signal::State _state)
Set the state of the output data.
Definition: Detection.C:42
TwoBitCorrection::Config twobit_config
Configuration of 2-bit correction options.
Definition: LoadToFil.h:86
void set_scale(float _scale)
Set the manual scale factor.
Definition: SigProcDigitizer.h:45
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
Detects phase-coherent TimeSeries data.
Definition: Detection.h:38
void set_input(const In *input)
Set the container from which input data will be read.
Definition: Transformation.h:258
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
unsigned get_ndim() const
Return the dimension of each datum.
Definition: Observation.h:80
float scale_fac
manually-specified scale factor
Definition: LoadToFil.h:122
void set_ipol(int _ipol)
Select the poln index to keep.
Definition: PolnSelect.h:42
Order
Order of the dimensions.
Definition: TimeSeries.h:39
Rescale all channels and polaristions indepdenently to a zero mean and unit variance.
Definition: Rescale.h:29
bool rescale_constant
hold offset and scale constant after first update
Definition: LoadToFil.h:119
double get_rate() const
Return the sampling rate (time samples per second in Hz)
Definition: Observation.h:157
std::string output_filename
Name of the output file.
Definition: LoadToFil.h:128
Loads BitSeries data from a SigProc data file.
Definition: SigProcOutputFile.h:25
void set_interval_seconds(double seconds)
Set the rescaling interval in seconds.
Definition: Rescale.C:41
virtual void set_dispersion_measure(double dm)
Set the pulsar dispersion mesure.
Definition: Observation.h:202
Decimates a TimeSeries in the time domain.
Definition: TScrunch.h:28
PScrunch all channels and polarizations.
Definition: PScrunch.h:25
unsigned get_npol() const
Return the number of polarizations.
Definition: Observation.h:90
int poln_select
process only a single polarization
Definition: LoadToFil.h:113
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
Decimates a TimeSeries in the frequency domain.
Definition: FScrunch.h:23
Converts floating point values to N-bit sigproc filterbank format.
Definition: SigProcDigitizer.h:24
void use_digi_scales(bool _rescale)
Set whether or not to apply the nbit-depedent scalings.
Definition: SigProcDigitizer.h:48
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
Select only a single polarization from a TimeSeries.
Definition: PolnSelect.h:25
double get_bandwidth() const
Return the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:147
unsigned fscrunch_factor
integrate in frequency before digitization
Definition: LoadToFil.h:107
bool get_detected() const
Returns true if state is Detected, Coherence, or Stokes.
Definition: Observation.C:144
bool dedisperse
removed inter-channel dispersion delays
Definition: LoadToFil.h:98
std::string get_source() const
Return the source name.
Definition: Observation.h:122
double dispersion_measure
dispersion measure set in output file
Definition: LoadToFil.h:95
static bool verbose
Global verbosity flag.
Definition: Operation.h:48
A container for storing digitized (generally not floating point) data
Definition: BitSeries.h:35
Load, unpack, process and fold data into phase-averaged profile(s)
Definition: LoadToFil.h:72
virtual void set_very_verbose()
Set very verbose.
Definition: LoadToFil.C:118
void set_dispersion_measure(double dm)
Set the dispersion measure in .
Definition: Dedispersion.C:43
double get_centre_frequency() const
Return the centre frequency of the band-limited signal in MHz.
Definition: Observation.h:134
bool verbose
unsigned npol
Number of polarizations to output.
Definition: LoadToFil.h:110
Breaks a single-band TimeSeries into multiple frequency channels.
Definition: Filterbank.h:27
int nbits
number of bits used to re-digitize the floating point time series
Definition: LoadToFil.h:125
Filterbank::Config filterbank
Filterbank config options.
Definition: LoadToFil.h:89
void set_output(Out *output)
Set the container into which output data will be written.
Definition: Transformation.h:275
virtual void set_quiet()
Set quiet mode.
Definition: LoadToFil.C:106
void set_constant(bool constant_offset_scale)
After setting offset and scale, keep them constant.
Definition: Rescale.C:30
double rescale_seconds
time interval (in seconds) between offset and scale updates
Definition: LoadToFil.h:116
LoadToFil(Config *config=0)
Constructor.
Definition: LoadToFil.C:49
bool apply_FITS_scale_and_offset
when unpacking FITS data, denormalize using DAT_SCL and DAT_OFFS
Definition: LoadToFil.h:92
unsigned tscrunch_factor
integrate in time before digitization
Definition: LoadToFil.h:104
Breaks a single-band TimeSeries into multiple frequency channels.
Definition: TFPFilterbank.h:26
Discrete convolution filterbank step for CPU.
Definition: FilterbankEngineCPU.h:25
Phase-coherent dispersion removal frequency response function.
Definition: Dedispersion.h:25
bool coherent_dedisp
coherently dedisperse along with filterbank
Definition: LoadToFil.h:101
void construct()
Create the pipeline.
Definition: LoadToFil.C:124
void prepare()
Final preparations before running.
Definition: LoadToFil.C:436
void set_configuration(Config *)
Set the configuration to be used in prepare and run.
Definition: LoadToFil.C:62
void set_nchan(unsigned _nchan)
Set the number of channels into which the input will be divided.
Definition: Filterbank.h:61
@ OrderTFP
Time, Frequency, Polarization (better for many things)
Definition: TimeSeries.h:50
virtual void set_verbose()
Set verbose.
Definition: LoadToFil.C:112
unsigned get_nchan() const
Return the number of channels into which the band is divided.
Definition: Observation.h:85

Generated using doxygen 1.8.17