In [1]:
%pylab inline

import csv, os
from glob import glob

import pandas as pd

import shapely.affinity as af
import shapely.geometry as sh

from equivalent_ellipse import *
from scaled_figures import *

pylab.rcParams['savefig.dpi'] = 254


Populating the interactive namespace from numpy and matplotlib

In [2]:
images = sort(glob('../figures/straightened/single/*'))

In [3]:
j = 0

for i in range(len(images)//2):
    
    a = imread(images[2*i])
    b = imread(images[2*i + 1])

    c = concatenate((a,b),axis=0)
    
    stringj = "%03d" %(j)
    
    imsave('../figures/straightened/joined/'+stringj+'.png',c, dpi=254)
    
    j += 1
    
if mod(len(images),2) == 1:
    
    i += 1
    a = imread(images[2*i])
    b = zeros(shape(a))
    
    c = concatenate((a,b),axis=0)
    
    stringj = "%03d" %(j)
    
    imsave('../figures/straightened/joined/'+stringj+'.png',c, dpi=254)

In [4]:
# See if this can be automated

# OPEN IMAGES IN GIMP "AS LAYER"
# SAVE IMAGES TO GIF "AS ANIMATION" 

# Run imagemagick on resulting file:
# convert -units PixelsPerInch input.gif -density 254 output.pdf

In [64]: