%pylab inline

"""
Explanation: <img src="images/csdms_logo.jpg">
Example 1
Read and explore the output from Example 1 -- a vector parameter study that evaluates an objective function over the Rosenbrock function.
Use pylab magic:
End of explanation
"""


dat_file = '../examples/1-rosenbrock/dakota.dat'
data = numpy.loadtxt(dat_file, skiprows=1, unpack=True, usecols=[0,2,3,4])
data

"""
Explanation: Read the Dakota tabular data file.
End of explanation
"""


plot(data[1,], data[2,], 'ro')
xlim((-2, 2))
ylim((-2, 2))
xlabel('$x_1$')
ylabel('$x_2$')
title('Planview of parameter study locations')

"""
Explanation: Plot the path taken in the vector parameter study.
End of explanation
"""


plot(data[-1,], 'bo')
xlabel('index')
ylabel('Rosenbrock fuction value')
title('Rosenbrock function values at study locations')

"""
Explanation: Plot the values of the Rosenbrock function at the study locations.
End of explanation
"""


min(data[-1,:])

"""
Explanation: What's the minimum value of the function over the study locations?
End of explanation
"""


