Skip to content

Instantly share code, notes, and snippets.

Avatar

Abe Kazemzadeh abecode

View GitHub Profile
@abecode
abecode / envi2png_eg.py
Last active Apr 21, 2016
reading ENVI from header (hdr) and openflight (flt) files
View envi2png_eg.py
import matplotlib.pyplot as plt
import scipy.misc
import spectral.io.envi as envi
# in ftp.djamshidpour.com/SanFrancisco/d20160226T2055
img = envi.open('FBI_TET1_20160226T205533_20160226T205613_L1B_C_EL-02984_LWIR.hdr',
'FBI_TET1_20160226T205533_20160226T205613_L1B_C_EL-02984_LWIR.flt')
#show images in viewer
# plt.imshow(img.asarray().squeeze()) # color
View gist:e7f0c9ab4e284d3fc9b7
#!/usr/bin/env python
# imports and basic notebook setup
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
import sys
from IPython.display import clear_output, Image, display
from google.protobuf import text_format
View gist:ba31e14ff4d5915ff877
# needs zoo for "rollapply"
library(zoo)
# needs e1071 for Hamming window
library('e1071')
# load data
th <- read.csv2('app_status_report_hourly.csv', header=F, sep=',', col.names=c('time','count'))
# normalize the data by the maximum
View gist:4562764
# install and load additional packages
install.packages("zoo")
install.packages("chron")
library(zoo)
library(chron)
# read in data
dt <- read.delim("movieReports/20130109_to_20120113.tsv",header=TRUE,sep="\t",comment.char="",quote="",na.strings="",fileEncoding="UTF-8")
# convert the tweet column from a factor (default) to a character string
View gist:4289867
# Read in data
timeSeriesElectionData <- read.table("twitterElectionTimeline_tsvWithHeader.txt",header=TRUE)
# Attach columns of data as variables in R environment
attach(timeSeriesElectionData)
# open a pdf file for writing
pdf(file="electionTimeline.pdf",height=4,width=12)
# plot the sum of tweets about obama and romney, as a line, with no x-axis ticks, bla bla...
View quote from William Garden
Our yachts are toy boats, the glint on a lovely brief bubble of time. A boat's importance as an escape from reality, as a change of pace, as a theme for reflection and as an art form gives it worth or value.
--William Garden