In [ ]:
%matplotlib inline

In [ ]:
from planet4 import io, markings

In [ ]:
db = io.DBManager()

In [ ]:
img_name = 'ESP_021605_0985'
data = db.get_image_name_markings(img_name)

In [ ]:
image_ids = data.image_id.unique()

In [ ]:
def show_image_id(i):
    p4id = markings.ImageID(image_ids[i])
    p4id.plot_all()

In [ ]:
from ipywidgets import interact

In [ ]:
interact(show_image_id, i=(0, len(image_ids)-1))

In [ ]:
img_id = image_ids[177]

In [ ]:
img_id

In [ ]:
blotchfname = '/Users/klay6683/Dropbox/data/planet4/inca_p4id_APF0000km4/'+img_id+'_blotches.hdf'

In [ ]:
pd.read_hdf(blotchfname)

In [ ]:
def get_blotch_list():
    return [markings.Blotch(row) for _,row in 
            pd.read_hdf(blotchfname).iterrows()]

In [ ]:
fanfname = '/Users/klay6683/Dropbox/data/planet4/inca_p4id_APF0000km4/'+img_id+'_fans.hdf'

In [ ]:
pd.read_hdf(fanfname)

In [ ]:
fnotchfname = '/Users/klay6683/Dropbox/data/planet4/inca_p4id_APF0000km4/'+img_id+"_fnotches.hdf"

In [ ]:
pd.read_hdf(fnotchfname)

In [ ]:
def get_fan_list():
    return [markings.Fan(row) for _, row in pd.read_hdf(fanfname).iterrows()]

In [ ]:
%matplotlib nbagg

In [ ]:
p4id.plot_blotches(blotches=get_blotch_list())
plt.savefig("/Users/klay6683/Desktop/blotches_clustered.pdf")
plt.xlim(0,190)
plt.ylim(650, 370)
plt.savefig("/Users/klay6683/Desktop/blotches_clustered_zoomed.pdf")

In [ ]:
p4id.plot_fans(fans=get_fan_list())
plt.savefig("/Users/klay6683/Desktop/fans_clustered.pdf")
plt.xlim(0,190)
plt.ylim(650, 370)
plt.savefig("/Users/klay6683/Desktop/fans_clustered_zoomed.pdf")

In [ ]:
fig, ax = plt.subplots()
p4id.plot_blotches(ax=ax, blotches=get_blotch_list())
p4id.plot_fans(ax=ax, fans=get_fan_list())
plt.savefig("/Users/klay6683/Desktop/combined_fnotched.pdf")
plt.xlim(0,190)
plt.ylim(650, 370)
plt.savefig("/Users/klay6683/Desktop/combined_fnotched_zoomed.pdf")

In [ ]:
a = (26.8, 412)

In [ ]:
b = np.array((24.2, 414.2))

In [ ]:
from numpy.linalg import norm

In [ ]:
norm(a-b)

In [ ]:
s = pd.read_clipboard(index_col=0, header=None, squeeze=True)

In [ ]:
b = markings.Blotch(s)

In [ ]:
b.p1

In [ ]: