LuMPFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2011, 2013 by James M Anderson (MPIfR)
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 
10 
11 #ifndef __LuMPFile_h
12 #define __LuMPFile_h
13 
14 #include "dsp/File.h"
15 #include "dsp/LuMPObservation.h"
16 
17 namespace dsp {
18 
20  class LuMPFile : public File
21  {
22 
23  public:
24 
26  LuMPFile (const char* filename=0);
27 
29  bool is_valid (const char* filename) const;
30 
32  virtual LuMPObservation* get_lump_info () { return dynamic_cast<LuMPObservation*>(get_info()); }
33 
35  virtual const LuMPObservation* get_lump_info () const { return dynamic_cast<const LuMPObservation*>(get_info()); }
36 
37  protected:
38 
39  friend class LuMPUnpacker;
40 
42  virtual void open_file (const char* filename);
43 
45  virtual int64_t load_bytes (unsigned char* buffer, uint64_t bytes);
46 
48  virtual int64_t seek_bytes (uint64_t bytes);
49 
51 
54  virtual int64_t fstat_file_ndat(uint64_t tailer_bytes=0);
55 
57  static std::string get_header (const char* filename);
58 
60 
62  int64_t file_data_position;
63  };
64 
65 }
66 
67 #endif // !defined(__LuMPFile_h)
68 
static std::string get_header(const char *filename)
Read the LuMP ascii header from filename.
Definition: LuMPFile.C:32
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
virtual int64_t fstat_file_ndat(uint64_t tailer_bytes=0)
Return ndat given the file and header sizes, nchan, npol, and ndim.
Definition: File.C:307
Loads BitSeries data from file.
Definition: File.h:38
int64_t file_data_position
Current data location in file, in units of bytes.
Definition: LuMPFile.h:72
virtual LuMPObservation * get_lump_info()
Get the information about the data source.
Definition: LuMPFile.h:42
Parses Observation attributes from a LuMP header.
Definition: LuMPObservation.h:55
virtual void open(const char *filename)
Open the file.
Definition: File.C:120
virtual int64_t seek_bytes(uint64_t bytes)
Adjust the file pointer.
Definition: LuMPFile.C:274
bool is_valid(const char *filename) const
Returns true if filename appears to name a valid LuMP file.
Definition: LuMPFile.C:47
virtual void open_file(const char *filename)
Open the file.
Definition: LuMPFile.C:73
static bool verbose
Global verbosity flag.
Definition: Operation.h:48
virtual int64_t fstat_file_ndat(uint64_t tailer_bytes=0)
Return ndat given the file and header sizes, nchan, npol, and ndim.
Definition: LuMPFile.C:374
virtual int64_t load_bytes(unsigned char *buffer, uint64_t bytes)
Load bytes from file.
Definition: LuMPFile.C:119
const float version
The baseband/dsp version number.
Definition: dsp.C:19
LuMPFile(const char *filename=0)
Construct and open file.
Definition: LuMPFile.C:22

Generated using doxygen 1.8.17