Skip to content

Instantly share code, notes, and snippets.

View nicoguaro's full-sized avatar

Nicolás Guarín-Zapata nicoguaro

View GitHub Profile
@nicoguaro
nicoguaro / fit_ellip.py
Created March 16, 2017 22:07
Fit an ellipse for a point cloud
# -*- 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
@nicoguaro
nicoguaro / Makefile
Last active October 3, 2016 19:31
Automate a pipeline to run a program and visualize the results using make
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
@nicoguaro
nicoguaro / clean_folder_png.py
Last active October 6, 2016 19:29
Python scripts for working with files.
# -*- 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("./")
@nicoguaro
nicoguaro / Matrix_labels_plot.py
Last active July 30, 2016 16:46
Plot a matrix with different labels in each cell as a series of circles with colors that represent each label.
# -*- 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
@nicoguaro
nicoguaro / neo_hookean_fit.py
Created June 9, 2016 23:07
Fitting experimental data to a Neo-Hookean solid.
# -*- coding: utf-8 -*-
"""
Compute the material parameters for a neo-hookean solid from
data obtained from a uniaxial stress test. The used expressions
are from _[1]
@author: Nicolas Guarin-Zapata
References
----------
@nicoguaro
nicoguaro / Batman curve.png
Last active April 18, 2018 16:48
Gist with some satiric plots
Batman curve.png
@nicoguaro
nicoguaro / Abaqus-Default.xml
Last active July 20, 2024 06:16
Zenburn color theme for Abaqus input files in Notepad++
<!--
File name: Abaqus-Default.xml
Style Name: Abaqus-Default
Description: Syntax highlighting for Abaqus in Notepad++. Derived
from the Abaqus template
present in:
http://docs.notepad-plus-plus.org/index.php?title=User_Defined_Language_Files
Supported languages: All the languages supported by release 6.2.3
Created by: Nicolas Guarin-Zapata (nicoguarin dot gmail dot com)
@nicoguaro
nicoguaro / README.md
Last active September 27, 2015 17:08
@nicoguaro
nicoguaro / index.html
Created August 28, 2015 20:59
Ashby chart showing Young Modulus vs density for some materials. It was done using D3
<!DOCTYPE html>
<meta charset="utf-8">
<!--
Example based on http://bl.ocks.org/weiglemc/6185069
-->
<style>
.circ {
fill: steelblue;
@nicoguaro
nicoguaro / data.tsv
Created August 28, 2015 19:24
Vertical barchart using D3 and reading data from a tab separated fiel.
name value
Locke 4
Reyes 8
Ford 12
Jarrah 16
Shephard 23
Kwon 42