Skip to content

Instantly share code, notes, and snippets.

View QuLogic's full-sized avatar

Elliott Sales de Andrade QuLogic

View GitHub Profile
import numpy as np
def interp_coords(coords, tol):
'''
Interpolates extra coordinates when the euclidean distance between adjacent
points are larger than given tolerance.
The function tries to densify a list of coordinates based on a simple measure.
If two adjacent points in the input coordinate list are further away from each
other than the specified tolerance, the list will be densied between those two
points. Roughly speaking, a point will be inserted every `tol` between the
@QuLogic
QuLogic / 2.0.0-blue.png
Last active May 14, 2017 02:00
Cartopy image clipping
2.0.0-blue.png
--- libmseed.orig/test/Makefile 2016-10-08 01:42:04.339418308 -0400
+++ libmseed/test/Makefile 2016-10-08 01:48:56.889028948 -0400
@@ -41,13 +41,10 @@ $(BINS) : % : %.c
# Run test scripts, create %.test.out files and compare to %.test.ref references
$(TESTOUTS) : %.test.out : %.test $(BINS) FORCE
@$(eval TESTCOUNT=$(shell echo $$(($(TESTCOUNT)+1))))
- @$(shell ./$< > $@ 2>&1)
- @diff $<.ref $@ >/dev/null; \
- if [ $$? -eq 0 ]; \
- then printf '$(PASSED) Test $<\n'; \
==13954== Invalid write of size 8
==13954== at 0xE122BD6: dealloc_QWidget (sipQtGuiQWidget.cpp:9393)
==13954== by 0x13496FC8: forgetObject (siplib.c:11399)
==13954== by 0x13498448: sipWrapper_dealloc (siplib.c:10962)
==13954== by 0x4EF5558: subtype_dealloc (typeobject.c:1226)
==13954== by 0x134983B4: sipWrapper_clear (siplib.c:10947)
==13954== by 0x13498450: sipWrapper_dealloc (siplib.c:10964)
==13954== by 0x4EF5558: subtype_dealloc (typeobject.c:1226)
==13954== by 0x4ED7E16: free_keys_object (dictobject.c:354)
==13954== by 0x4EDB388: dict_tp_clear (dictobject.c:2551)
@QuLogic
QuLogic / gist:eea6d576866297a72f4a
Last active February 20, 2016 05:56
ObsPy test warnings
======================================================================
ERROR: test_remove_polynomial_response (obspy.core.tests.test_trace.TraceTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/elliott/code/obspy/obspy/core/tests/test_trace.py", line 1662, in test_remove_polynomial_response
tr.remove_response()
File "<decorator-gen-39>", line 2, in remove_response
File "/home/elliott/code/obspy/obspy/core/trace.py", line 231, in _add_processing_info
result = func(*args, **kwargs)
File "/home/elliott/code/obspy/obspy/core/trace.py", line 2586, in remove_response
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@QuLogic
QuLogic / Basic Stats in Python.ipynb
Last active December 17, 2015 21:45
Basic Stats in R/Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@QuLogic
QuLogic / Panda-fied R Introduction.ipynb
Last active December 17, 2015 21:44
R/Pandas Introduction
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@QuLogic
QuLogic / MWE.bib
Last active August 29, 2015 14:26 — forked from retorquere/MWE.tex
@online{zotero-1855286-1414,
title = {Patent Landscape analysis: sample from {S}40RTS},
url = {http://www.patanalyse.com/sample-analysis.html},
timestamp = {2014-10-18 17:04:22},
urldate = {2014-10-18},
file = {Patent Landscape analysis\: sample from PatAnalyse:/Users/jeff/Zotero_data/storage/AQRPC353/sample-analysis.html:text/html}
}
@QuLogic
QuLogic / PROJ.4 cleanup.md
Last active August 29, 2015 14:21
proj.4 repo cleanup

This gist includes scripts used to clean up the proj.4 git repository.

  • generate_comment_refs.py determines the tickets and comments that reference to SHA1 hashes.
  • refs is a list of (ticket number, comment ID, count, commit hash) from above.
  • proj4-clean.sh clones the original repo, flattens the structure, and removes extra commits. The hashes noted in the previous step are converted to the new commit hashes.
  • newrefs is a list of (ticket number, comment ID, count, old commit hash, new commit hash) from above.
  • update_comment_refs.py takes newrefs and updates the tickets on GitHub.