Skip to content

Commit 2441edf

Browse files
committed
dev
1 parent c22ede0 commit 2441edf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cf/read_write/um/umread.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,7 +3529,7 @@ def is_um_file(self, filename):
35293529
"""
35303530
try:
35313531
self.file_open(filename)
3532-
except Exception:
3532+
except Exception as error:
35333533
self.file_close()
35343534
return False
35353535
else:
@@ -3568,7 +3568,6 @@ def file_open(self, filename):
35683568
byte_ordering=g.get("byte_ordering"),
35693569
word_size=g.get("word_size"),
35703570
fmt=g.get("fmt"),
3571-
parse=True,
35723571
)
35733572

35743573

cf/umread_lib/umfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
class UMFileException(Exception):
1111
pass
1212

13+
# Integer header pointers
14+
LBLREC = 14
15+
LBPACK = 20
16+
LBEGIN = 28
1317

1418
class File:
1519
"""A class for a UM file that gives a view of the file including
@@ -322,7 +326,7 @@ def from_file_and_offsets(
322326

323327
if data_offset is None:
324328
# Calculate the data offset from the integer header
325-
if PP:
329+
if file.fmt == "PP":
326330
# We only support 64-word headers, so the data starts
327331
# 66 words after the header_offset, i.e. 64 words of the
328332
# header, plus 2 block control words.

0 commit comments

Comments
 (0)