LWAFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2014 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __LWAFile_h
10 #define __LWAFile_h
11 
12 #include "dsp/BlockFile.h"
13 
14 #define LWA_HEADER_BYTES 32
15 #define LWA_DATA_BYTES 4096
16 #define LWA_FRAME_BYTES (LWA_HEADER_BYTES+LWA_DATA_BYTES)
17 
18 namespace dsp {
19 
21 
24  class LWAFile : public BlockFile
25  {
26  public:
27 
29  LWAFile (const char* filename=0, const char* headername=0);
30 
32  ~LWAFile ();
33 
35  bool is_valid (const char* filename) const;
36 
37  protected:
38 
39  friend class LWAUnpacker;
40 
42  void open_file (const char* filename);
43 
45  void reopen ();
46 
47  //int64_t seek_bytes (uint64_t bytes);
48 
49  void* stream;
50 
51  uint64_t reopen_seek;
52 
53  char datafile[256];
54 
55  };
56 
57 }
58 
59 #endif // !defined(__LWAFile_h)
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
LWAFile(const char *filename=0, const char *headername=0)
Construct and open file
Definition: LWAFile.C:30
bool is_valid(const char *filename) const
Returns true if file starts with a valid LWA packet header.
Definition: LWAFile.C:41
Loads BitSeries data from a file organized in blocks.
Definition: BlockFile.h:25
void set_required(std::string key, bool required=true)
Set/unset a required keyword.
Definition: ASCIIObservation.C:53
void open_file(const char *filename)
Open the file.
Definition: LWAFile.C:78
~LWAFile()
Destructor.
Definition: LWAFile.C:37
void reopen()
Reopen the file.
Definition: LWAFile.C:190
Loads BitSeries data from a LWA DRX file.
Definition: LWAFile.h:24
void load(const char *header)
Read the ASCII header block.
Definition: ASCIIObservation.C:88
Parses Observation attributes from an ASCII header.
Definition: ASCIIObservation.h:29
Simple 4-bit complex to float unpacker for the LWA files.
Definition: LWAUnpacker.h:23

Generated using doxygen 1.8.17