BdsApi  2.2.2
This is the Blacknest BDS API.
BdsDataFileSeed.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * BdsDataFileSeed.h BDRS Data File Access
3  * T.Barnaby, BEAM Ltd, 2009-12-18
4  *******************************************************************************
5  */
6 #ifndef BdsDataFileSeed_H
7 #define BdsDataFileSeed_H
8 
9 #include <BdsDataFile.h>
10 #include <BdsSeedTypes.h>
11 #include <BMutex.h>
12 #include <libmseed-beam/libmseed.h>
13 #include <libmseed-beam/unpackdata.h>
14 
15 namespace Bds {
16 
18 class DataFileSeed : public DataFile{
19 public:
20  DataFileSeed();
21  ~DataFileSeed();
22 
23  BError close();
24 
26  int getFeatures();
28 
29  BError getInfo(DataInfo& dataInfo, DataFileOptions options, BList<DataError>& errors);
30  BError readData(BUInt32 channel, BUInt segment, BUInt32 blockNumber, DataBlock& data);
31 
32  BError setInfo(const DataInfo& dataInfo, const ChannelInfos& channelInfos, WriteOptionsList options = WriteOptionSensorData);
33  BError start(BUInt channel, BUInt segment);
35  BError end();
36 
37  void msrFileWrite(void* data, int len);
38 
39  static DataFormat getFormats();
40  static BError omsrErr;
41  static int onoLock;
42 
43 private:
44  BError processControl();
45  BError processBlockette();
46  BError processData(DataBlock& data, int addInfo);
47  BError setBlockSize(BUInt blockSize);
48  BError readBlockData(char* buf, BUInt numBytes);
49  BError readBlock(BUInt blockNumber, char& type, char& cont, BUInt& seq);
50  BError writeVolumeHeader(int rl);
51  BError writeTimeSpans();
52  BError writeBlockData(char type, const char* buf, BUInt numBytes);
53  BError writeFlush();
54  BString unitsConvert(BString units);
55  int getChannel(BString name);
56  void sortChannels();
57 
58  int addCode(BString str);
59  int addUnitCode(BString str);
60 
61  DataFileOptions oreadOptions;
62  DataInfo odataInfo;
63  ChannelInfos ochannelInfos;
64  double osampleRate;
65  BArray<BArray<DataBlockPos> > oblockPositions;
66 
67  BUInt32 oblockSize;
68  char* oblock;
69  BUInt oblockNumber;
70  BUInt opos;
71  BUInt oblocketteNumber;
72  BUInt ologNumber;
73 
74  // SEED information
75  BArray<BString> ocodes;
76  BArray<BString> ounitCodes;
77 
78  // SEED import information
79  BdsSeedType10 otype10;
80  BdsSeedType11 otype11;
81  BdsSeedType30 otype30;
82  BdsSeedType52 otype52;
83  BArray<BdsSeedType30> oseedDataFormats;
84  BArray<BdsSeedStation> oseedStations;
85  BArray<BdsSeedType52> oseedChannels;
86 
87  BArray<BString> odataChannels;
88  BArray<int> odataChannelFormats;
89 
90  // SEED export information
91  BArray<BInt32> odataInt32;
92  BArray<BFloat32> odataFloat32;
93 
94  BUInt odataChannel;
95  BUInt odataSegment;
96  BUInt odataTimeSpanBlock;
97  BDict<int> ostationBlockNumbers;
98  BArray<BArray<BUInt32> > odataStartBlocks;
99  BArray<BArray<BUInt32> > odataEndBlocks;
100 
101  static BMutex olock;
102  MSRecord* omsr;
103 };
104 
105 }
106 #endif
WriteOptionsList
Definition: BdsDataFile.h:45
static DataFormat getFormats()
Definition: BdsDataFileSeed.cpp:30
static BError omsrErr
MSR processing error.
Definition: BdsDataFileSeed.h:40
DataOrder
Definition: BdsDataFile.h:43
int getFeatures()
Get bitmask of supported features.
Definition: BdsDataFileSeed.cpp:159
BError start(BUInt channel, BUInt segment)
Start writing next segment of data.
Definition: BdsDataFileSeed.cpp:950
~DataFileSeed()
Definition: BdsDataFileSeed.cpp:128
BError setFormat(BString format)
Set the sub-format.
Definition: BdsDataFileSeed.cpp:167
BError end()
End write segment.
Definition: BdsDataFileSeed.cpp:1009
This class defines information on a set of data.
Definition: BdsD.h:570
This holds information on a seismic data format.
Definition: BdsD.h:826
This class provides the acual seismic data values contained within a single data block.
Definition: BdsD.h:637
BUInt32 format
Data file convertor for SEED file formats.
Definition: BdsDataFileSeed.h:18
BError close()
Close the file.
Definition: BdsDataFileSeed.cpp:140
Definition: BdsC.cc:8
This class provides metadata information on a set of channels.
Definition: BdsD.h:496
This class defines the interface for generic data file access that all of the BDS data conterors shar...
Definition: BdsDataFile.h:41
DataFileSeed()
Definition: BdsDataFileSeed.cpp:108
Definition: BdsDataFile.h:45
BUInt32 BUInt
uint32_t BUInt32
DataOrder getDataOrder()
Get the expected order of writing data, by sample or by channel.
Definition: BdsDataFileSeed.cpp:163
char data[8]
BError setInfo(const DataInfo &dataInfo, const ChannelInfos &channelInfos, WriteOptionsList options=WriteOptionSensorData)
Set information on data for write.
Definition: BdsDataFileSeed.cpp:392
BError getInfo(DataInfo &dataInfo, DataFileOptions options, BList< DataError > &errors)
Get info on data.
Definition: BdsDataFileSeed.cpp:175
BError writeData(const DataBlock &data)
Write a block of data.
Definition: BdsDataFileSeed.cpp:1036
void msrFileWrite(void *data, int len)
Definition: BdsDataFileSeed.cpp:934
This defines a list of BDS data convtor options.
Definition: BdsDataFile.h:30
static int onoLock
Disable libmseed locking.
Definition: BdsDataFileSeed.h:41
BError readData(BUInt32 channel, BUInt segment, BUInt32 blockNumber, DataBlock &data)
Read a block.
Definition: BdsDataFileSeed.cpp:305