This file contains 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 igl | |
import numpy as np | |
import polyscope as ps | |
import scipy | |
from sklearn.preprocessing import normalize | |
import robust_laplacian | |
from scipy.sparse import linalg as sla | |
path = "scan_007.obj" |
This file contains 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 matplotlib.pyplot as plt | |
import csv | |
import datetime | |
import pandas as pd | |
from matplotlib.colors import ListedColormap | |
# from lyft data download | |
ebikes_path = "lyft_bike_scooters.csv" | |
cars_path = "passenger_rides.csv" | |
# from strava data download |
This file contains 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 igl | |
import numpy as np | |
import polyscope as ps | |
import scipy | |
# https://www.cs.cmu.edu/~kmcrane/Projects/ModelRepository/spot.zip | |
path = "/Users/cbabraham/data/mesh/spot/spot_triangulated.obj" | |
verts,faces = igl.read_triangle_mesh(path) | |
ps.init() |
This file contains 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
# 3D Surface normals with JAX | |
import matplotlib.pyplot as plt | |
from jax import vmap, jacfwd, np | |
# Simple Torus surface parameterization f(u,v) -> (x,y,z) | |
# The multivariable analytic function to be differentiated | |
def _f(uv): | |
u,v = uv | |
x = (8 + 2 * np.cos(v)) * np.cos(u) |
This file contains 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 astroquery.jplhorizons import Horizons | |
pluto = 999 | |
jupiter = 599 | |
mu69 = 486958 | |
new_horizons = -98 | |
paths = [] | |
for body_name in [jupiter, pluto, new_horizons, mu69]: | |
obj = \ |
This file contains 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
# pip install requests | |
import requests | |
import json | |
url_template = 'https://api.foursquare.com/v2/users/self/checkins?limit=250&oauth_token={}&v=20131026&offset={}' | |
# to find your oauth token you need to visit the swarm webapp and inspect your network requests, it will be attached | |
# to XHR requests once you scroll and it starts fetching timeline activity. | |
# https://www.swarmapp.com/activity | |
oauth_token = "" |
This file contains 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
; | |
; Single target image series plan, created by chandler abraham on Wed, 28 Mar 2018 18:43:08 UTC | |
; Generated by iTelescope.Net Offline Plan Generator | |
; | |
#tiff | |
#count 2,2,2,3 | |
#interval 200,200,200,200 | |
#binning 1,1,1,1 | |
#filter Red,Green,Blue,Luminance | |
m83 13.6167 -29.867 |
This file contains 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 gpxpy | |
def load_gpx_file(path): | |
gpx = gpxpy.parse(open(path, 'r')) | |
points = [] | |
for track in gpx.tracks: | |
for segment in track.segments: | |
for point in segment.points: | |
points.append([point.longitude, point.latitude]) | |
return points |
This file contains 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
# Echo client program | |
import socket | |
HOST = '127.0.0.1' # The remote host | |
PORT = 50007 # The same port as used by the server | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
s.send('Hello, world') | |
data = s.recv(1024) | |
s.close() |
This file contains 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 numpy as np | |
import rasterio | |
original = rasterio.open("original.tif").read() | |
# cmd: | |
# convert -compress LZW -type TrueColor original.tif lossless.tif | |
lossless = rasterio.open("lossless.tif").read() | |
# cmd: |
NewerOlder