Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Javier Quinteros
dastools
Commits
ad885016
Commit
ad885016
authored
Jan 17, 2020
by
Javier Quinteros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print metadata to stdout and in a nicer format
parent
e5ec372d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
dasscripts/dasconv.py
dasscripts/dasconv.py
+8
-2
No files found.
dasscripts/dasconv.py
View file @
ad885016
...
...
@@ -18,8 +18,10 @@
import
argparse
import
os
import
sys
import
logging
import
struct
import
pprint
import
datetime
import
numpy
as
np
from
math
import
floor
...
...
@@ -218,6 +220,8 @@ class TDMS(object):
def
readMetadata
(
self
):
# Metadata
logs
=
logging
.
getLogger
(
'Read Metadata'
)
handler
=
logging
.
StreamHandler
(
sys
.
stdout
)
logs
.
addHandler
(
handler
)
self
.
__fi
.
seek
(
self
.
__HEADERLEN
,
0
)
# Number of objects (unsigned int - 32b)
...
...
@@ -252,7 +256,6 @@ class TDMS(object):
except
:
pass
continue
elif
not
rawDataIdx
:
...
...
@@ -541,7 +544,10 @@ def main():
curstream
=
None
for
data
in
td
:
if
args
.
metadata
:
logs
.
info
(
data
)
if
isinstance
(
data
,
dict
):
pprint
.
pprint
(
data
)
else
:
print
(
data
)
else
:
if
curstream
!=
'%s.%s.%s.%s'
%
(
data
[
1
][
'network'
],
data
[
1
][
'station'
],
data
[
1
][
'location'
],
data
[
1
][
'channel'
]):
# Save the previous Stream completely
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment