Skip to content

Commit

Permalink
Merge remote-tracking branch 'krischer/seg2_fix' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
megies committed Feb 27, 2014
2 parents 1051267 + 90bcc3a commit 1b2fc97
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
24 changes: 23 additions & 1 deletion obspy/seg2/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,26 @@
'sep': 9,
'oct': 10,
'nov': 11,
'dec': 12}
'dec': 12,
'1': 1,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
'7': 7,
'8': 8,
'9': 9,
'10': 10,
'11': 11,
'12': 12,
'01': 1,
'02': 2,
'03': 3,
'04': 4,
'05': 5,
'06': 6,
'07': 7,
'08': 8,
'09': 9
}
7 changes: 6 additions & 1 deletion obspy/seg2/seg2.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ def parseFreeForm(self, free_form_str, attrib_dict):
# 'random offset byte'
# Therefore every string has to be at least 3 bytes wide to be
# acceptable after being split at the string terminator.
strings = [_i for _i in strings if len(_i) >= 3]

def is_good_char(c):
return c in ('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN'
'OPQRSTUVWXYZ!"#$%&\'()*+,-./:; <=>?@[\\]^_`{|}~ ')

strings = [filter(is_good_char,_i) for _i in strings if len(_i) >= 3]
# Every string has the structure OPTION<SPACE>VALUE. Write to
# stream.stats attribute.
for string in strings:
Expand Down

0 comments on commit 1b2fc97

Please sign in to comment.