This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vtkInterface | |
from vtkInterface import examples | |
# Load Grid | |
grid = vtkInterface.UnstructuredGrid(examples.hexbeamfile) | |
# scalar demo | |
plobj = vtkInterface.PlotClass() | |
plobj.AddMesh(grid, scalars=grid.points[:, 2], colormap='viridis') | |
plobj.AddScalarBar() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function | |
import numpy as np | |
from scipy.optimize import fsolve | |
def fun(X): | |
x, y, z = X | |
return [x**2 + y + z - 1, | |
x + y**2 + z - 1, | |
x + y + z**2 - 1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Create a 3D lattice of points for some lattice parameters | |
@author: Nicolas Guarin-Zapata | |
""" | |
from __future__ import division, print_function | |
import numpy as np | |
from numpy import sin, cos, sqrt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Dimensional reduction using non-linear methods present in scikit-learn | |
Based on an example by Jake Vanderplas | |
""" | |
from time import time | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
from PyQt5.QtWidgets import (QMainWindow, QApplication, QDockWidget, QWidget, | |
QGridLayout, QSlider) | |
from PyQt5.QtCore import Qt | |
import numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
C C | |
C Compute the values for the Bessel function of the first kind C | |
C and order 0 in the interval [XA,XB] with N points. C | |
C C | |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
C C | |
C AUTHOR: NICOLAS GUARIN Z. C | |
C GRUPO DE MECANICA APLICADA- UNIVERSIDAD EAFIT C | |
C LAST MOD: 25 JULY 2012 C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Fit an ellipse for a point cloud | |
@author: Nicolas Guarin-Zapata | |
""" | |
from __future__ import division, print_function | |
import numpy as np | |
from numpy import sin, cos, arctan2, mean | |
from numpy.linalg import norm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sine_plot.png : plot_data.py | |
python plot_data.py | |
plot_data.py: gen_sine_data | |
./gen_sine_data | |
gen_sine_data : gen_sine_data.c | |
cc -o gen_sine_data gen_sine_data.c -lm | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Erase all PNG files in a folder that do not end | |
with a certain pattern | |
@author: Nicolas Guarin-Zapata | |
""" | |
import os | |
files = os.listdir("./") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Plot a matrix with different labels in each cell as a series | |
of circles with colors that represent each label. | |
@author: Nicolas Guarin-Zapata | |
""" | |
from __future__ import division, print_function | |
import numpy as np | |
import matplotlib.pyplot as plt |