Mark4File.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Craig West
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Formats/mark4/dsp/Mark4File.h
10 
11 #ifndef __Mark4File_h
12 #define __Mark4File_h
13 
14 #include "dsp/File.h"
15 
16 int decode_bcd(char in[4]);
17 
18 namespace dsp {
19 
20  enum Modes { Standard,
21  VLBA
22  };
23 
25  class Mark4File : public File
26  {
27  public:
28 
30  Mark4File (const char* filename = 0);
31 
33  ~Mark4File ();
34 
36  bool is_valid (const char *filename) const;
37 
38 
39  protected:
40 
42  void open_file (const char* filename);
43 
45  uint64_t find_sync (int file_descriptor, uint64_t from = 0) const;
46 
48  void initalise ();
49 
51  int count_channels (int file_descriptor) const;
52 
54  MJD decode_date(uint64_t from = 0);
55 
57  unsigned int channels;
58 
61 
63  Modes mode;
64 
65  private:
66 
69  char timestamp[17];
70 
72  bool VLBA_mode;
73 
74 
75  };
76 }
77 
78 
79 #endif // __Mark4File_h
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
int count_channels(int file_descriptor) const
Evaluates how many channels of data are present - assumes file open.
Definition: Mark4File.C:147
void initalise()
Initalises the data stream.
Definition: Mark4File.C:140
Loads TimeSeries data from a Mark4 data file.
Definition: Mark4File.h:25
Loads BitSeries data from file.
Definition: File.h:38
char SYNC_pattern
Defines the SYNC pattern to search for.
Definition: Mark4File.h:60
bool is_valid(const char *filename) const
Return true if filename contains data in the recognized format.
Definition: Mark4File.C:34
~Mark4File()
Destructor.
Definition: Mark4File.C:29
Mark4File(const char *filename=0)
Construct and open file.
Definition: Mark4File.C:21
MJD decode_date(uint64_t from=0)
Returns the MJD date of the next header.
Definition: Mark4File.C:222
unsigned int channels
Defines the number of data channels.
Definition: Mark4File.h:57
Modes mode
Defines the mode the data was recorded in.
Definition: Mark4File.h:63
void open_file(const char *filename)
Open the file.
Definition: Mark4File.C:50
uint64_t find_sync(int file_descriptor, uint64_t from=0) const
Locates the next SYNC pulse, relative to the 'from' position.
Definition: Mark4File.C:179

Generated using doxygen 1.8.17