Commit 5bdba895 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Fixed minor bug: computing endtime for earthworm tracebuf

git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@1397 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 3bc7baf0
......@@ -2,10 +2,11 @@
nmxptool Release History
#########################
* Release 2.1.0-rc1 (2012/02/07)
* Release 2.1.0-rc1 (2012/02/14)
- Added capability to specify the location code within the channel
pattern declaration (options -C, -n).
- Incremented value of NMXP_MAX_LENGTH_DATA_BUFFER.
- Fixed minor bug: computing endtime for earthworm tracebuf.
* Release 2.0.0 (2010/10/22)
- Improved saving of mini-SEED files, now data samples are saved using
......
......@@ -102,8 +102,13 @@ int nmxptool_ew_pd2ewring (NMXP_DATA_PROCESS *pd, SHM_INFO *pregionOut, MSG_LOGO
tbuf.trh2.starttime = pd->time;
tbuf.trh2.samprate = pd->sampRate;
tbuf.trh2.endtime = (tbuf.trh2.starttime +
if(pd->sampRate > 0) {
tbuf.trh2.endtime = (tbuf.trh2.starttime +
(((double) tbuf.trh2.nsamp - 1.0) / (double) tbuf.trh2.samprate));
} else {
/* Avoiding to divide by zero, try to invalidate the data in a safe way */
tbuf.trh2.endtime = tbuf.trh2.starttime;
}
strncpy(tbuf.trh2.net, pd->network, TRACE2_NET_LEN);
strncpy(tbuf.trh2.sta, pd->station, TRACE2_STA_LEN);
......@@ -136,8 +141,13 @@ int nmxptool_ew_pd2ewring (NMXP_DATA_PROCESS *pd, SHM_INFO *pregionOut, MSG_LOGO
tbuf.trh.starttime = pd->time;
tbuf.trh.samprate = pd->sampRate;
tbuf.trh.endtime = (tbuf.trh.starttime +
if(pd->sampRate > 0) {
tbuf.trh.endtime = (tbuf.trh.starttime +
(((double) tbuf.trh.nsamp - 1.0) / (double) tbuf.trh.samprate));
} else {
/* Avoiding to divide by zero, try to invalidate the data in a safe way */
tbuf.trh.endtime = tbuf.trh.starttime;
}
strncpy(tbuf.trh.net, pd->network, TRACE_NET_LEN);
strncpy(tbuf.trh.sta, pd->station, TRACE_STA_LEN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment