Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ckMseed
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
ckMseed
Commits
6d763a6b
Commit
6d763a6b
authored
5 months ago
by
Destiny Kuehn
Committed by
Omid Hosseini
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix for issue 11: Update support for mseeds with variable record
parent
f8f00ab9
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
Fix for issue 11: Update support for mseeds with variable record
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ckMseed/ckMseed.py
+57
-17
57 additions, 17 deletions
ckMseed/ckMseed.py
with
57 additions
and
17 deletions
ckMseed/ckMseed.py
+
57
−
17
View file @
6d763a6b
...
...
@@ -951,7 +951,23 @@ class MainWindow(QWidget):
if
msfile
.
isMseed
():
try
:
# simple test to determine if correct size file
numblocks
=
msfile
.
numblocks
# numblocks = msfile.numblocks
filesize
=
msfile
.
filesize
blksize
=
msfile
.
blksize
(
numblocks
,
odd_size
)
=
divmod
(
filesize
,
blksize
)
if
odd_size
:
warn
=
(
"
WARNING: File size is not an
"
"
integer number of block size (4096).
"
)
warn
+=
"
Start/End times cannot be displayed.
"
warn
+=
"
To fix variable record length, use fixhdr.
"
warn1
=
"
\t
File:
"
+
fullname
self
.
write_error
(
warn
,
"
Size
"
,
"
red
"
)
self
.
write_error
(
warn1
,
"
Size
"
)
self
.
add_to_dict
(
self
.
error_dict
,
"
Size
"
,
directory
,
_file
)
self
.
num_errors
=
self
.
num_errors
+
1
except
Exception
:
err
=
(
"
ERROR: Cannot determine file and
"
"
block sizes.
"
)
...
...
@@ -980,12 +996,27 @@ class MainWindow(QWidget):
if
not
self
.
scan_type
:
filelist
=
[
_file
]
else
:
(
startepoch
,
endepoch
)
=
msfile
.
FirstLastTime
()
endepoch
+=
1
start
=
lstrftime
(
'
%Y:%j:%H:%M:%S
'
,
lgmtime
(
startepoch
))
end
=
lstrftime
(
'
%Y:%j:%H:%M:%S
'
,
lgmtime
(
endepoch
))
if
odd_size
:
start
,
end
,
startepoch
,
endepoch
=
(
''
,
''
,
''
,
''
)
else
:
try
:
(
startepoch
,
endepoch
)
=
msfile
.
FirstLastTime
()
except
Exception
as
e
:
err
=
(
"
ERROR: Cannot determine start and
"
"
end times.
"
)
err1
=
"
\t
File:
"
+
fullname
self
.
write_error
(
err
,
"
Read/Write
"
,
"
red
"
)
self
.
write_error
(
err1
,
"
Read/Write
"
)
self
.
add_to_dict
(
self
.
error_dict
,
"
Read/Write
"
,
directory
,
_file
)
self
.
num_errors
=
self
.
num_errors
+
1
continue
endepoch
+=
1
start
=
lstrftime
(
'
%Y:%j:%H:%M:%S
'
,
lgmtime
(
startepoch
))
end
=
lstrftime
(
'
%Y:%j:%H:%M:%S
'
,
lgmtime
(
endepoch
))
if
self
.
scan_type
==
1
:
filelist
=
[
_file
,
start
,
end
]
else
:
...
...
@@ -999,14 +1030,18 @@ class MainWindow(QWidget):
if
not
self
.
scan_type
:
self
.
stat_chan_loc_dict
[
fileid
]
=
[]
else
:
try
:
if
startepoch
<
self
.
stat_chan_loc_dict
[
fileid
][
0
][
0
]:
self
.
stat_chan_loc_dict
[
fileid
][
0
][
0
]
=
startepoch
if
endepoch
>
self
.
stat_chan_loc_dict
[
fileid
][
0
][
1
]:
self
.
stat_chan_loc_dict
[
fileid
][
0
][
1
]
=
endepoch
except
KeyError
:
if
odd_size
:
self
.
stat_chan_loc_dict
[
fileid
]
=
[]
self
.
stat_chan_loc_dict
[
fileid
].
append
([
startepoch
,
endepoch
])
else
:
try
:
if
startepoch
<
self
.
stat_chan_loc_dict
[
fileid
][
0
][
0
]:
self
.
stat_chan_loc_dict
[
fileid
][
0
][
0
]
=
startepoch
if
endepoch
>
self
.
stat_chan_loc_dict
[
fileid
][
0
][
1
]:
self
.
stat_chan_loc_dict
[
fileid
][
0
][
1
]
=
endepoch
except
KeyError
:
self
.
stat_chan_loc_dict
[
fileid
]
=
[]
self
.
stat_chan_loc_dict
[
fileid
].
append
([
startepoch
,
endepoch
])
# build endian lists
if
msfile
.
byteorder
==
"
big
"
:
...
...
@@ -1083,10 +1118,15 @@ class MainWindow(QWidget):
if
not
self
.
scan_type
:
pass
else
:
start
=
time
.
strftime
(
'
%Y:%j:%H:%M:%S
'
,
time
.
gmtime
(
self
.
stat_chan_loc_dict
[
key
][
0
][
0
]))
end
=
time
.
strftime
(
'
%Y:%j:%H:%M:%S
'
,
time
.
gmtime
(
self
.
stat_chan_loc_dict
[
key
][
0
][
1
]))
# variable record length
start
,
end
=
(
''
,
''
)
try
:
start
=
time
.
strftime
(
'
%Y:%j:%H:%M:%S
'
,
time
.
gmtime
(
self
.
stat_chan_loc_dict
[
key
][
0
][
0
]))
end
=
time
.
strftime
(
'
%Y:%j:%H:%M:%S
'
,
time
.
gmtime
(
self
.
stat_chan_loc_dict
[
key
][
0
][
1
]))
except
Exception
as
e
:
pass
scan_info
.
append
(
start
)
scan_info
.
append
(
end
)
# templist = list(map(str, (start, end)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment