DATRW++ library: seismic data I/O with multiple formats
channeltranslation.h
Go to the documentation of this file.
1 /*! \file channeltranslation.h
2  * \brief translate TSOFT channel name (they are too long for SFF headers) (prototypes)
3  * \ingroup group_tsoft
4  *
5  * ----------------------------------------------------------------------------
6  *
7  * \author Thomas Forbriger
8  * \date 11/11/2009
9  *
10  * translate TSOFT channel name (they are too long for SFF headers) (prototypes)
11  *
12  * Copyright (c) 2009 by Thomas Forbriger (BFO Schiltach)
13  *
14  * ----
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28  * ----
29  *
30  * REVISIONS and CHANGES
31  * - 11/11/2009 V1.0 Thomas Forbriger
32  * - 10/01/2013 V1.1 add sensor data conversion codes for SG056
33  * extract full channel description on request
34  *
35  * ============================================================================
36  */
37 
38 #include<iostream>
39 #include<string>
40 
41 // include guard
42 #ifndef DATRW_CHANNELTRANSLATION_H_VERSION
43 
44 #define DATRW_CHANNELTRANSLATION_H_VERSION \
45  "DATRW_CHANNELTRANSLATION_H V1.1"
46 
47 namespace datrw {
48 
49  namespace tsoft {
50 
51  /*! \brief DDAS3 sensor data conversion codes
52  * \ingroup group_tsoft
53  * Sensor data conversion codes as defined in GWR document
54  * DDAS3_man_technical_ch5_UIPCsoftware_2010-07-16_BFO-Excerpt
55  */
56  enum Econversion {
57  SIDIODE, //!<
58  SIDIODE1, //!<
59  SIDIODE2, //!<
60  SIDIODE3, //!< Convert voltage across Standard Silicone Diode to Kelvins
61  SIDIODE4, //!< Convert voltage across Non-Magnetic Silicone Diode to Kelvins
62  MASFLO1, //!<
63  GEPLHe19, //!< Convert voltage across 19” AMI LHe sensor to % Helium
64  GEPLHe23, //!< Convert voltage across 23” AMI LHe sensor to % Helium
65  POWERV, //!< Convert Voltage to % Power where
66  PT100_K, //!<
67  PT100V_K, //!< Convert Voltage across Pt100 RTD to Kelvins
68  PT100, //!<
69  PT100V, //!<
70  PSI_1_1, //!< Convert Current from Dewar Pressure gauge to PSI
71  H2OFLO1, //!<
72  TDV, //!< Convert Voltage across Honeywell TD5 temperature sensor to degrees Celsius
73  TD, //!<
74  PSI_500, //!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI
75  PSI_2500, //!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI
76  PSI_3000, //!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI
77  PSI_3447, //!<
78  KPA_3447, //!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa
79  KPA_20684,//!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa
80  KPA_17236,//!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa
81  MPA_17236,//!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa
82  MPA_3447, //!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa
83  MPA_20684,//!< Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa
84  FAN16, //!< Convert Voltage to % Fan speed
85  C20P4, //!< Conversion factor 20.4 for Dewar Heater current
86  CNSP, //!< not specified
87  CNFD //!< not found in channel translation table
88  }; // enum Econversion
89 
90  /*----------------------------------------------------------------------*/
91 
92  /*! \brief struct to hold a pair of channel names
93  * \ingroup group_tsoft
94  */
95  struct Channel {
96  //! \brief channel description used in TSOFT
97  const char* TSOFTname;
98  //! \brief description to be used in SFF for this channel
99  const char* SFFname;
100  //! \brief conversion code for auxilliary channels
102  }; // struct Channel
103 
104  /*----------------------------------------------------------------------*/
105 
106  /*! \brief hold TSOFT channel description
107  * \ingroup group_tsoft
108  */
110  {
111  std::string location, instrument, datatype;
112  }; // struct TSOFTchannelid
113 
114  /*----------------------------------------------------------------------*/
115 
116  /*! \brief hold SFF channel description
117  * \ingroup group_tsoft
118  */
120  {
121  std::string station, channel, instrument, auxid;
122  }; // struct SFFchannelid
123 
124  /*----------------------------------------------------------------------*/
125 
126  /*! \brief hold channel description
127  * \ingroup group_tsoft
128  */
130  {
134  }; // struct ChannelDescription
135 
136  /*----------------------------------------------------------------------*/
137 
138  /*! \brief global variable: channel name translation table
139  * \ingroup group_tsoft
140  */
141  extern const Channel translationtable[];
142 
143  /*======================================================================*/
144  // functions
145 
146  /*! \brief split TSOFT channel description
147  * \ingroup group_tsoft
148  */
149  TSOFTchannelid tchannelid(const Channel& ci);
150 
151  /*----------------------------------------------------------------------*/
152 
153  /*! \brief split SFF channel description
154  * \ingroup group_tsoft
155  */
156  SFFchannelid schannelid(const Channel& ci);
157 
158  /*----------------------------------------------------------------------*/
159 
160  /*! \brief report translation table
161  * \ingroup group_tsoft
162  */
163  void reporttranslation(std::ostream& os);
164 
165  /*----------------------------------------------------------------------*/
166 
167  /*! \brief report comments from 1s files
168  * \ingroup group_tsoft
169  */
170  void reportdatacomments(std::ostream& os);
171 
172  /*----------------------------------------------------------------------*/
173 
174  /*! \brief check uniqueness of translation table
175  * \ingroup group_tsoft
176  */
177  bool translationisunique(const bool& verbose=true);
178 
179  /*----------------------------------------------------------------------*/
180 
181  /*! \brief return SFF channel ID for given TSOFT channel ID
182  * \ingroup group_tsoft
183  */
185 
186  /*----------------------------------------------------------------------*/
187 
188  /*! \brief return channel data for given SFF channel ID
189  * \ingroup group_tsoft
190  */
192 
193  } // namespace tsoft
194 
195 } // namespace datrw
196 
197 #endif // DATRW_CHANNELTRANSLATION_H_VERSION (includeguard)
198 
199 /* ----- END OF channeltranslation.h ----- */
ChannelDescription channel(const SFFchannelid &insid)
return channel data for given SFF channel ID
Econversion
DDAS3 sensor data conversion codesSensor data conversion codes as defined in GWR document DDAS3_man_t...
void reporttranslation(std::ostream &os)
report translation table
Convert Current from Dewar Pressure gauge to PSI.
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa.
const Econversion ConversionCode
conversion code for auxilliary channels
const char * SFFname
description to be used in SFF for this channel
const Channel translationtable[]
global variable: channel name translation tableThis table is specific for SG056 at BFO...
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI.
bool translationisunique(const bool &verbose)
check uniqueness of translation table
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa.
Convert voltage across 23” AMI LHe sensor to % Helium.
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa.
Convert Voltage to % Power where.
Convert Voltage across Honeywell TD5 temperature sensor to degrees Celsius.
Convert voltage across Non-Magnetic Silicone Diode to Kelvins.
Convert voltage across Standard Silicone Diode to Kelvins.
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa.
Root namespace of library.
Definition: aalibdatrwxx.cc:16
Convert Voltage to % Fan speed.
SFFchannelid translate(const TSOFTchannelid &ci)
return SFF channel ID for given TSOFT channel ID
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to KPa.
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI.
hold TSOFT channel description
struct to hold a pair of channel names
Convert Voltage across Pt100 RTD to Kelvins.
Conversion factor 20.4 for Dewar Heater current.
SFFchannelid schannelid(const Channel &ci)
split SFF channel description
const char * TSOFTname
channel description used in TSOFT
TSOFTchannelid tchannelid(const Channel &ci)
split TSOFT channel description
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to PSI.
Convert voltage across 19” AMI LHe sensor to % Helium.
not found in channel translation table
Convert Current from Gas Regulator and Helium Compressor Pressure gauge to MPa.
hold SFF channel description
void reportdatacomments(std::ostream &os)
report comments from 1s files