Following code can be used to test whether the created netcdf file is valid.


In [1]:
import numpy as np
from clawpack import pyclaw
from clawpack.pyclaw.fileio import netcdf

%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt

In [2]:
# Create a solution object
claw = pyclaw.Controller()
claw.solution = pyclaw.Solution()

In [3]:
# Use pyclaw.fileio.netcdf.read function to read in data from claw0000.nc file
netcdf.read(claw.solution,1,path='./',file_prefix='claw')

In [4]:
# Plot the solution
plt.plot(claw.solution.states[0].q)


Out[4]:
[<matplotlib.lines.Line2D at 0x109bceed0>]

In [ ]: