In [1]:
# At the beginning of the notebook
import logging
import sys
logger = logging.getLogger('planet4')
ch = logging.StreamHandler(sys.stderr)
# fmt = logging.Formatter('%(name)s - %(message)s')
fmt = logging.Formatter('%(message)s')
ch.setFormatter(fmt)
logger.addHandler(ch)

In [3]:
logger.setLevel(logging.DEBUG)

In [2]:
# setup
%matplotlib nbagg
import seaborn as sns
sns.set_context('notebook')
from planet4 import plotting, io, markings, clustering
from pathlib import Path

In [21]:
id_ = 'bnb'
# id_ = 'c0b'
# id_ = 'c0q'

In [12]:
io.PathManager('br5').obsid


Out[12]:
'ESP_012076_0945'

In [22]:
plotting.plot_raw_fans(id_)



In [23]:
plotting.plot_raw_blotches(id_)



In [24]:
plotting.plot_clustered_blotches(id_)


Out[24]:
8

In [9]:
plotting.plot_clustered_fans(id_)


Out[9]:
2

In [9]:
plotting.blotches_all(id_)


Entering markings.plot_objects
Received 106 objects to plot.
Plotting background image.
Found image in cache.
Entering obsid setting.
Obsid found: ESP_012858_0855
Entering markings.plot_objects
Received 9 objects to plot.
Plotting background image.
Found image in cache.

In [10]:
plotting.fans_all(id_)


Entering markings.plot_objects
Received 230 objects to plot.
Plotting background image.
Found image in cache.
Entering obsid setting.
Obsid found: ESP_012858_0855
Entering markings.plot_objects
Received 28 objects to plot.
Plotting background image.
Found image in cache.

In [22]:
db = io.DBManager()

In [24]:
image_names = io.get_image_names_from_db(db.dbname)

In [25]:
len(image_names)


Out[25]:
221

In [20]:
plotting.plot_finals('bnb')



In [18]:
pm = io.PathManager('bz7')

In [19]:
pm.path_so_far


Entering obsid setting.
Obsid found: ESP_012858_0855
Out[19]:
PosixPath('/Users/klay6683/Dropbox/data/planet4/clustering/ESP_012858_0855')

In [22]:
pm2 = io.PathManager('bz7', datapath=pm.path_so_far.parent)

In [23]:
pm2.path_so_far


Entering obsid setting.
Obsid found: ESP_012858_0855
Out[23]:
PosixPath('/Users/klay6683/Dropbox/data/planet4/clustering/ESP_012858_0855')

In [20]:
plotting.plot_image_id_pipeline(id_, save=True)


Entering obsid setting.
Obsid found: ESP_013113_0985
Entering obsid setting.
Obsid found: ESP_013113_0985
Found image in cache.
Found image in cache.
Found image in cache.
Found image in cache.
Found image in cache.
Found image in cache.
Entering markings.plot_objects
Received 161 objects to plot.
Plotting background image.
Found image in cache.
Entering markings.plot_objects
Received 77 objects to plot.
Plotting background image.
Found image in cache.
Entering obsid setting.
Obsid found: ESP_013113_0985
Entering markings.plot_objects
Received 8 objects to plot.
Plotting background image.
Found image in cache.
Entering obsid setting.
Obsid found: ESP_013113_0985
Entering markings.plot_objects
Received 5 objects to plot.
Plotting background image.
Found image in cache.
Entering obsid setting.
Obsid found: ESP_013113_0985
Entering markings.plot_objects
Received 6 objects to plot.
Plotting background image.
Found image in cache.
Entering markings.plot_objects
Received 4 objects to plot.
Plotting background image.
Found image in cache.

In [8]:
a1 = np.array([252.3, 243.9])
a1.shape = (1,2)
a2 = np.array([267.3, 249.4])
a2.shape = (1,2)

In [9]:
from scipy.spatial.distance import cdist

In [10]:
cdist(a1, a2)


Out[10]:
array([[ 15.97654531]])

In [ ]:
plotting.plot_raw_blotches(id_)

In [ ]:
plotting.plot_clustered_fans(id_)

In [ ]:
plotting.plot_clustered_blotches(id_)

In [ ]:
plotting.plot_finals(id_)