VDIFFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2011 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __VDIFFile_h
10 #define __VDIFFile_h
11 
12 #include "dsp/BlockFile.h"
13 
14 namespace dsp {
15 
17 
19  class VDIFFile : public BlockFile
20  {
21  public:
22 
24  VDIFFile (const char* filename=0, const char* headername=0);
25 
27  ~VDIFFile ();
28 
30  bool is_valid (const char* filename) const;
31 
33  bool contiguous (const File* that) const;
34 
36  std::string get_data_filename () const { return datafile; }
37 
38  protected:
39 
40  friend class VDIFUnpacker;
41 
43  void open_file (const char* filename);
44 
46 
47  uint64_t skip_extra ();
48 
50 
51  uint64_t get_next_frame_number ();
52 
53  void* stream;
54 
55  uint64_t reopen_seek;
56 
57 #define VDIF_MAX_FILENAME_LENGTH 256
58 
59  char datafile[VDIF_MAX_FILENAME_LENGTH];
60 
61  int current_frame_number;
62  int frames_per_second;
63 
64  };
65 
66 }
67 
68 #endif // !defined(__VDIFFile_h)
bool is_valid(const char *filename) const
Returns true if file starts with a valid VDIF packet header.
Definition: VDIFFile.C:46
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
virtual Observation * get_info()
Get the information about the data source.
Definition: Input.h:113
void open_file(const char *filename)
Open the file.
Definition: VDIFFile.C:121
VDIFFile(const char *filename=0, const char *headername=0)
Construct and open file
Definition: VDIFFile.C:34
Loads BitSeries data from file.
Definition: File.h:38
bool contiguous(const File *that) const
Return true this this is contiguous with that.
Definition: VDIFFile.C:355
Loads BitSeries data from a file organized in blocks.
Definition: BlockFile.h:25
uint64_t get_next_frame_number()
Return the number of the next frame.
Definition: VDIFFile.C:287
void set_required(std::string key, bool required=true)
Set/unset a required keyword.
Definition: ASCIIObservation.C:53
Loads BitSeries data from a VDIF file.
Definition: VDIFFile.h:24
uint64_t skip_extra()
Check that next packet follows the packet that was just read.
Definition: VDIFFile.C:319
std::string get_data_filename() const
For when the data file is not the current filename.
Definition: VDIFFile.h:46
~VDIFFile()
Destructor.
Definition: VDIFFile.C:42
void load(const char *header)
Read the ASCII header block.
Definition: ASCIIObservation.C:88
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
Parses Observation attributes from an ASCII header.
Definition: ASCIIObservation.h:29

Generated using doxygen 1.8.17