@@ -321,9 +321,11 @@ def __init__(self,fgno=None,outdir='.',output_format=None,
321
321
self .qmap = {'h' :1 , 'hu' :2 , 'hv' :3 , 'hm' :4 , 'pb' :5 , 'hchi' :6 ,
322
322
'bdif' :7 , 'eta' :8 , 'B' :9 }
323
323
else :
324
- raise InputError ('Invalid qmap: %s' % qmap )
324
+ raise ValueError ('Invalid qmap: %s' % qmap )
325
325
326
326
# GeoClaw input values:
327
+ # Many of these should be read from fgout_grids.data
328
+ # using read_fgout_grids_data before using read_frame
327
329
self .id = '' # identifier, optional
328
330
self .point_style = 2 # only option currently supported
329
331
self .npts = None
@@ -335,7 +337,10 @@ def __init__(self,fgno=None,outdir='.',output_format=None,
335
337
self .nout = None
336
338
self .fgno = fgno
337
339
self .outdir = outdir
340
+
341
+ # Note output_format will be reset by read_fgout_grids_data:
338
342
self .output_format = output_format
343
+
339
344
self .q_out_vars = [1 ,2 ,3 ,4 ] # list of which components to print
340
345
# default: h,hu,hv,eta (5=topo)
341
346
self .nqout = None # number of vars to print out
@@ -517,8 +522,13 @@ def read_fgout_grids_data(self, fgno=None, data_file='fgout_grids.data'):
517
522
lineno += 1
518
523
if output_format == 1 :
519
524
self .output_format = 'ascii'
525
+ elif output_format == 2 :
526
+ self .output_format = 'binary32'
520
527
elif output_format == 3 :
521
528
self .output_format = 'binary'
529
+ else :
530
+ raise NotImplementedError ("fgout not implemented for " \
531
+ + "output_format %i" % output_format )
522
532
print ('Reading input for fgno=%i, point_style = %i ' \
523
533
% (self .fgno , self .point_style ))
524
534
if point_style == 2 :
0 commit comments