PMDAQFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 by Matthew Bailes
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __PMDAQFile_h
10 #define __PMDAQFile_h
11 
12 #include "environ.h"
13 
14 #include "dsp/BlockFile.h"
15 
16 namespace dsp {
17 
18  class PMDAQ_Observation;
19 
21  class PMDAQFile : public BlockFile
22  {
23  public:
24 
26  PMDAQFile (const char* filename=0);
27 
29  virtual ~PMDAQFile();
30 
32  bool is_valid (const char* filename) const;
33 
35  static bool using_second_band;
36 
37  protected:
38 
40  virtual int64_t pad_bytes(unsigned char* buffer, int64_t bytes);
41 
43  void open_file (const char* filename);
44 
46  int get_header (char* pmdaq_header, const char* filename);
47 
48  void set_chan_begin(unsigned _chan_begin){ chan_begin = _chan_begin; }
49  unsigned get_chan_begin() const { return chan_begin; }
50  void set_chan_end(unsigned _chan_end){ chan_end = _chan_end; }
51  unsigned get_chan_end() const { return chan_end; }
52 
53  private:
54 
56  void modify_info(PMDAQ_Observation* data);
57 
58  // Helper functions for load_bytes():
59 
60  int chan_begin;
61  int chan_end;
62  };
63 
64 }
65 
66 #endif // !defined(__PMDAQFile_h)
67 
double get_second_bandwidth()
Inquire the second bandwidth.
Definition: PMDAQ_Observation.h:45
double get_second_centre_frequency()
Inquire the second centre frequency.
Definition: PMDAQ_Observation.h:42
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
uint64_t block_bytes
Total number of bytes in each block (header + data + tailer)
Definition: BlockFile.h:47
Loads BitSeries data from a file organized in blocks.
Definition: BlockFile.h:25
virtual void open(const char *filename)
Open the file.
Definition: File.C:120
Loads BitSeries data from a PMDAQ data file.
Definition: PMDAQFile.h:26
General means of constructing Observation attributes from PMDAQ data.
Definition: PMDAQ_Observation.h:26
virtual int64_t pad_bytes(unsigned char *buffer, int64_t bytes)
Over-ride this function to pad data via HoleyFile.
Definition: File.C:334
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
PMDAQFile(const char *filename=0)
Construct and open file.
Definition: PMDAQFile.C:32
bool is_valid(const char *filename) const
Returns true if filename appears to name a valid PMDAQ file.
Definition: PMDAQFile.C:103
unsigned get_freq1_channels()
Inquire the number of channels at the first centre frequency.
Definition: PMDAQ_Observation.h:48
virtual int64_t pad_bytes(unsigned char *buffer, int64_t bytes)
Pads gaps in data.
Definition: PMDAQFile.C:172
uint64_t block_tailer_bytes
Number of bytes in tailer of each block.
Definition: BlockFile.h:53
static bool using_second_band
Which band the bandwidth/centre frequency will be extracted from.
Definition: PMDAQFile.h:40
void open_file(const char *filename)
Open the file.
Definition: PMDAQFile.C:148
uint64_t block_header_bytes
Number of bytes in header of each block.
Definition: BlockFile.h:50
int get_header(char *pmdaq_header, const char *filename)
Initialises 'pmdaq_header' with the header info.
Definition: PMDAQFile.C:46
virtual ~PMDAQFile()
Destructor.
Definition: PMDAQFile.C:30

Generated using doxygen 1.8.17