34 #define TF_WID2CONTAINER_CC_VERSION \ 35 "TF_WID2CONTAINER_CC V1.0 " 56 std::istringstream is(line);
83 "WID2container::setwid2: string is too short");
85 std::memcpy(ws, fstring, w2size);
150 "WID2container::encode: struct is too large");
151 std::memcpy(fstring, &ws, w2size);
182 strncpy(this->
ID, WID2container::WID2struct::encodeID,
idlen);
183 strncpy(this->
station, wid2.station.c_str(),
slen);
184 strncpy(this->
channel, wid2.channel.c_str(),
clen);
185 strncpy(this->
auxid, wid2.auxid.c_str(),
alen);
186 strncpy(this->
instype, wid2.instype.c_str(),
ilen);
191 this->
hour=wid2.date.hour();
192 this->
minute=wid2.date.minute();
193 this->
second=wid2.date.second();
194 this->
milsec=wid2.date.milsec();
195 this->
micsec=wid2.date.micsec();
196 this->
year=wid2.date.year();
197 this->
month=wid2.date.month();
198 this->
day=wid2.date.day();
199 this->
calib=wid2.calib;
203 this->
vang=wid2.vang;
204 this->
hang=wid2.hang;
212 libtime::TAbsoluteTime date(this->year, this->month, this->day,
213 this->hour, this->minute, this->second,
214 this->milsec, this->micsec);
216 retval.station=std::string(this->station);
217 retval.channel=std::string(this->channel);
218 retval.auxid=std::string(this->auxid);
219 retval.instype=std::string(this->instype);
221 retval.nsamples=this->nsamples;
222 retval.hang=this->hang;
223 retval.vang=this->vang;
224 retval.calib=this->calib;
225 retval.calper=this->calper;
void encodeascii(char *fstring, ftnlen slen) const
encode data into a standard SFF character string
static const unsigned short ilen
char channel[clen+1]
FDSN channel code.
char instype[ilen+1]
instrument type
double dt
sampling interval (sec)
double calib
calibration factor
libtime::timeint micsec
time of first sample (microsecond)
void setwid2(const std::string &line)
fill data fields from a conventional WID2 line
libtime::timeint month
date of first sample (month value)
libtime::timeint day
date of first sample (day value)
double vang
veritcal orientation
container for WID2 data (prototypes)
static const char * encodeID
ID indicating the WID2 is encoded in binary form in the WID2 line.
libtime::timeint year
date of first sample (year value)
void fillfstring(const std::string &s, char *fstring, ftnlen slen)
fill a Fortran string with a C++ string
exceptions and error handling macros (prototypes)
void encodebinary(char *fstring, ftnlen slen) const
encode data into a binary character string
::sff::WID2 get() const
return values to WID2
static const unsigned short slen
bool wasascii
true, if original data was ASCII encoded
char auxid[alen+1]
Auxiliary identification code.
int nsamples
number of samples
static const unsigned short clen
static const unsigned short alen
#define FAPIDXX_assert(C, M)
Check an assertion and report by throwing an exception.
libtime::timeint hour
time of first sample (hour)
libtime::timeint minute
time of first sample (minute)
long int ftnlen
Fortran string size type.
double calper
calibration reference period
double hang
horizontal orientation
std::string stringfromfstring(char *fstring, ftnlen slen)
create a C++ string from a Fortran string
char station[slen+1]
Station code.
void encode(char *fstring, ftnlen slen) const
encode data into a character string depending on wasascii flag
This struct ist used by fapidxx::WID2container to store WID2 line data.
void set(const ::sff::WID2 &wid2)
set values from WID2
libtime::timeint milsec
time of first sample (millisecond)
libtime::timeint second
time of first sample (second)
some helper functions (prototypes)
static const unsigned short idlen