DualFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 - 2023 by Willem van Straten and Andrew Jameson
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/dsp/DualFile.h
10 
11 #ifndef __dsp_Kernel_Classes_DualFile_h
12 #define __dsp_Kernel_Classes_DualFile_h
13 
14 #include "dsp/ParallelBitSeries.h"
15 #include "dsp/ParallelInput.h"
16 
17 namespace dsp {
18 
26  class DualFile : public ParallelInput {
27 
28  public:
29 
32 
34  ~DualFile ();
35 
37  bool matches (const std::string& descriptor) const override;
38 
40  void open (const std::string& descriptor) override;
41 
43  virtual void set_inputs (Input* first, Input* second);
44 
46  void load (ParallelBitSeries*) override;
47 
49  uint64_t get_block_size () const override;
51  void set_block_size (uint64_t _size) override;
52 
54  uint64_t get_overlap () const override;
56  void set_overlap (uint64_t _overlap) override;
57 
59  unsigned get_resolution () const override;
60 
61  protected:
62 
63  private:
64 
65  };
66 
67 }
68 
69 #endif // !defined(__dsp_Kernel_Classes_DualFile_h)
70 
virtual void set_bandwidth(double _bandwidth)
Set the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:145
virtual void set_source(Source *)=0
Set the Source from which data are obtained.
Pure virtual base class of all objects that can load BitSeries data.
Definition: Input.h:31
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
bool matches(const std::string &descriptor) const override
Return true if descriptor describes a parallel file that can be opened.
Definition: DualFile.C:72
virtual Observation * get_info()
Get the information about the data source.
Definition: Input.h:113
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
~DualFile()
Destructor.
Definition: DualFile.C:20
Signal::State get_state() const
Return the state of the signal.
Definition: Observation.h:70
virtual void set_inputs(Input *first, Input *second)
Set the pair of inputs.
Definition: DualFile.C:104
uint64_t get_block_size() const override
Return the number of time samples to load on each load_block.
Definition: DualFile.C:122
virtual void prepare()=0
Prepare to process.
virtual const Observation * get_info() const =0
Get the const Observation attributes that describe the source.
void open(const std::string &descriptor) override
Open the file.
Definition: DualFile.C:85
void copy_configuration(const Observation *copy)
Copy the configuration of another Observation (not the data)
Definition: ParallelBitSeries.C:58
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)
static bool record_time
Global flag enables stopwatch to record the time spent operating.
Definition: Operation.h:42
Type * get() const
virtual void set_dispersion_measure(double dm)
Set the pulsar dispersion mesure.
Definition: Observation.h:202
virtual void set_telescope(const std::string &name)
Set the telescope name.
Definition: Observation.h:110
virtual void construct()=0
Build the data reduction pipeline.
std::string get_name() const
Return the unique name of this operation.
Definition: Operation.h:95
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
std::string get_telescope() const
Return the telescope name.
Definition: Observation.h:112
virtual void set_source(const std::string &name)
Set the source name.
Definition: Observation.h:120
double get_bandwidth() const
Return the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:147
Abstract base class of data reduction pipelines.
Definition: Pipeline.h:28
virtual void load(ParallelBitSeries *)
Load BitSeries data.
Definition: ParallelInput.C:105
unsigned get_resolution() const override
Get the time sample resolution of the data source.
Definition: DualFile.C:170
virtual void set_start_time(MJD _start_time)
Set the start time of the leading edge of the first time sample.
Definition: Observation.h:150
A single LoadToFold thread.
Definition: LoadToFold1.h:54
Multiple LoadToFold threads.
Definition: LoadToFoldN.h:24
uint64_t get_overlap() const override
Return the number of time samples by which consecutive blocks overlap.
Definition: DualFile.C:160
void load(ParallelBitSeries *) override
Load BitSeries data.
Definition: DualFile.C:113
bool get_detected() const
Returns true if state is Detected, Coherence, or Stokes.
Definition: Observation.C:144
std::string get_source() const
Return the source name.
Definition: Observation.h:122
virtual void add(Item *)
std::string get_library()
virtual void set_version(const std::string &s)
double get_centre_frequency() const
Return the centre frequency of the band-limited signal in MHz.
Definition: Observation.h:134
void set_block_size(uint64_t _size) override
Set the number of time samples to load on each load_block.
Definition: DualFile.C:127
DualFile()
Constructor.
Definition: DualFile.C:18
Loads multiple parallel BitSeries data from multiple files.
Definition: ParallelInput.h:30
const float version
The baseband/dsp version number.
Definition: dsp.C:19
virtual void set_centre_frequency(double cf)
Set the centre frequency of the band-limited signal in MHz.
Definition: Observation.h:132
Load, unpack, process and fold data into phase-averaged profile(s)
Definition: LoadToFoldConfig.h:30
virtual void set_rate(double _rate)
Set the sampling rate (time samples per second in Hz)
Definition: Observation.h:155
Manages an array of BitSeries to be process in parallel.
Definition: ParallelBitSeries.h:24
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
Abstract interface to sources of TimeSeries data.
Definition: Source.h:22
virtual void parse(int argc, char *const *argv)
void set_overlap(uint64_t _overlap) override
Set the number of time samples by which consecutive blocks overlap.
Definition: DualFile.C:165
BitSeries * at(unsigned i)
Get the ith BitSeries instance.
Definition: ParallelBitSeries.h:45
unsigned nthread

Generated using doxygen 1.8.17