PMDAQ_Observation.h
1 /***************************************************************************
2  *
3  * Copyright (C) 2002 by Matthew Bailes
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 #ifndef __PMDAQ_Observation_h
8 #define __PMDAQ_Observation_h
9 
10 #include "dsp/Observation.h"
11 #include "tostring.h"
12 
13 namespace dsp {
14 
16 
21  class PMDAQ_Observation : public Observation {
22 
23  public:
24 
26  PMDAQ_Observation (const char* header);
27 
29  bool has_two_filters(){ return freq2_channels > 0; }
30 
33 
35  double get_second_bandwidth(){ return second_bandwidth; }
36 
38  unsigned get_freq1_channels(){ return freq1_channels; }
39 
41  unsigned get_freq2_channels(){ return freq2_channels; }
42 
43  protected:
44 
47 
49  double second_bandwidth;
50 
52  unsigned freq1_channels;
53 
55  unsigned freq2_channels;
56 
58  template<class T>
59  T read_header(const char* header,unsigned startchar, unsigned nchars);
60 
61  };
62 
63 }
64 
66 template<class T>
67 T dsp::PMDAQ_Observation::read_header(const char* header,unsigned startchar, unsigned nchars){
68  std::string ss (header+startchar,header+startchar+nchars);
69  return fromstring<T>(ss);
70 }
71 
72 #endif
double get_second_bandwidth()
Inquire the second bandwidth.
Definition: PMDAQ_Observation.h:45
virtual void set_nbit(unsigned _nbit)
Set the number of bits per value.
Definition: Observation.h:93
virtual void set_bandwidth(double _bandwidth)
Set the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
Definition: Observation.h:145
bool dc_centred
Flag set when centre channel is centred on centre frequency.
Definition: Observation.h:386
double get_second_centre_frequency()
Inquire the second centre frequency.
Definition: PMDAQ_Observation.h:42
virtual uint64_t get_nsamples(uint64_t nbytes) const
Return the number of samples in nbytes bytes.
Definition: Observation.C:548
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
double second_bandwidth
If two bands are stored in one file this stores the second bandwidth.
Definition: PMDAQ_Observation.h:59
sky_coord coordinates
Coordinates of the source.
Definition: Observation.h:362
unsigned get_nbit() const
Return the number of bits per value.
Definition: Observation.h:95
virtual void set_machine(const std::string &_m)
Set the instrument used to record signal.
Definition: Observation.h:192
virtual void set_mode(const std::string &_mode)
Set the observation mode.
Definition: Observation.h:215
double get_rate() const
Return the sampling rate (time samples per second in Hz)
Definition: Observation.h:157
virtual void set_telescope(const std::string &name)
Set the telescope name.
Definition: Observation.h:110
virtual void set_npol(unsigned _npol)
Set the number of polarizations.
Definition: Observation.h:88
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
virtual void set_source(const std::string &name)
Set the source name.
Definition: Observation.h:120
double second_centre_frequency
If two bands are stored in one file this stores the second centre frequency.
Definition: PMDAQ_Observation.h:56
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
unsigned freq1_channels
Number of channels at the first centre frequency (including dummies)
Definition: PMDAQ_Observation.h:62
virtual void set_nchan(unsigned _nchan)
Set the number of channels into which the band is divided.
Definition: Observation.h:83
bool has_two_filters()
Returns true if two filters were used. e.g. both 10cm and 50cm bands.
Definition: PMDAQ_Observation.h:39
unsigned get_freq2_channels()
Inquire the number of channels at the second centre frequency.
Definition: PMDAQ_Observation.h:51
unsigned get_freq1_channels()
Inquire the number of channels at the first centre frequency.
Definition: PMDAQ_Observation.h:48
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
PMDAQ_Observation(const char *header)
Construct from a CPSR2 ASCII header block.
Definition: PMDAQ_Observation.C:16
virtual void set_rate(double _rate)
Set the sampling rate (time samples per second in Hz)
Definition: Observation.h:155
unsigned freq2_channels
Number of channels at the second centre frequency (including dummies)
Definition: PMDAQ_Observation.h:65
T read_header(const char *header, unsigned startchar, unsigned nchars)
Parses the C string.
Definition: PMDAQ_Observation.h:67
virtual void set_state(Signal::State _state)
Set the state of the signal.
Definition: Observation.C:103
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