1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#!/usr/bin/env python
import openturns as ot
import persalys
myStudy = persalys.Study("myStudy")
# mesh points are on the first line
meshModel = persalys.GridMeshModel(
[persalys.Variable("t", "date")], ot.Interval([1], [12]), [12])
print(meshModel.getMesh().getVertices())
model = persalys.DataFieldModel("myModel", meshModel)
model.importProcessSample("elNino.csv", persalys.Tools.Columns)
myStudy.add(model)
# check that the processSample can be properly converted (used for gui init)
print(model.getProcessSampleAsSample())
analysis1 = persalys.FieldKarhunenLoeveAnalysis("myAnalysis", model)
analysis1.run()
print(analysis1)
myStudy.add(analysis1)
result1 = analysis1.getResult()
print(result1)
# script
script = myStudy.getPythonScript()
print(script)
exec(script)
|