Encode WID2 data.
c----------------------------------------------------------------------
c
c Prepare a WID2 line from scratch
c
c The routine sets defaults for all variables set either to -1
c for integers, -1. for floats or 'NSP' (not specified) for characters
c If a component e.g. in the form LHZ is given hang and vang are
c determined automatically
c
c Reasonable values must be given for at least
c samprat: sampling rate (= 1./(sampling interval))
c nsamp: number of smaples
c station: station name
c
c Defaults are:
c year: 0
c month. 0
c day: 0
c hour: 0
c minute: 0
c second: 10.0
c comp: NSP
c auxid: NSP
c instyp: NSP
c calib: 1.
c calper: 1.
c hang: -1.
c vang: 90.
c
c Returns wid2line
c
c major changes:
c 22/11/96 T.F. changed format of calib to e10.2 as defined by GSE2.0
c
integer nsamp, year, month, day, hour, minute
character comp*(*), auxid*(*), station*(*), instyp*(*)
real samprat, second, calib, calper, hang, vang
character wid2line*(*)
c----------------------------------------------------------------------
99 wid2.nsamples= *nsamp;
100 wid2.dt = 1./(*samprat);
102 double dsecond=*second;
103 libtime::timeint isecond=
static_cast<libtime::timeint
>(std::floor(dsecond));
104 libtime::timeint milsec
105 =
static_cast<libtime::timeint
>(std::floor(1.e3*dsecond));
106 libtime::timeint micsec
107 =
static_cast<libtime::timeint
>(std::floor(1.e6*dsecond));
108 milsec -= 1000*isecond;
109 micsec -= 1000*(milsec+1000*isecond);
110 libtime::TAbsoluteTime date(*year, *month, *day, *hour, *minute,
111 isecond, milsec, micsec);
117 wid2.calper = *calper;
121 wid2c.encode(wid2line, wid2line_len);
This struct is used to pass WID2 line data within libfapidxx.
std::string stringfromfstring(char *fstring, ftnlen slen)
create a C++ string from a Fortran string