rsudp.c_write
(write data)¶
-
class
rsudp.c_write.
Write
(q, data_dir, testing=False, debug=False, cha='all')¶ A simple routine to write daily miniSEED data to
output_dir/data
.Parameters: - cha (str or list) – channel(s) to forward. others will be ignored.
- q (queue.Queue) – queue of data and messages sent by
rsudp.c_consumer.Consumer
- debug (bool) – whether or not to display messages when writing data to disk.
-
elapse
(new=False)¶ Ticks self variables over into a new day for file naming purposes.
Parameters: new (bool) – If False
, the program is starting. IfTrue
, the UTC date just elapsed.
-
getq
()¶ Reads data from the queue and updates the stream.
Return type: bool Returns: Returns True
if stream is updated, otherwiseFalse
.
-
run
()¶ Reads packets and coordinates write operations.
-
set_sps
()¶ Sets samples per second.
-
slicestream
()¶ Causes the stream to slice down to the time the last write operation was made.
-
write
(stream=False)¶ Writes a segment of the stream to disk as miniSEED, and appends it to the file in question. If there is no file (i.e. if the program is just starting or a new UTC day has just started, then this function writes to a new file).
Parameters: stream (obspy.core.stream.Stream or bool) – The stream segment to write. If False
, the program has just started.