In [ ]:
from planet4.plotting import plot_image_id_pipeline
from planet4 import catalog_production as cp
from planet4 import plotting as p4plot

In [ ]:
%store -r

In [ ]:
ids = combined  # coming in from the %store

In [ ]:
ids

In [ ]:
from planet4.markings import Fan

In [ ]:
%matplotlib inline

In [ ]:
rm = cp.ReleaseManager('v1.0b4')

In [ ]:
rm.savefolder

In [ ]:
p4plot.plot_finals('br5', datapath=rm.savefolder)

In [ ]:
fans = rm.read_fan_file()

In [ ]:
obsdata = fans[fans.image_name=='ESP_012079_0945']

In [ ]:
for ind in obsdata.groupby('image_id').angle.std().sort_values(ascending=False).head(10).index:
    p4plot.plot_finals(ind, datapath=rm.savefolder);
    plt.gca().set_title(ind);

In [ ]:
p4plot.plot_finals('cpv', datapath=rm.savefolder)
plt.gcf().savefig('cpv.png', dpi=150)

In [ ]:
p4plot.plot_finals('cnt', datapath=rm.savefolder)
plt.gcf().savefig('cnt.png', dpi=150)

In [ ]:
fan = Fan(s)

fan.plot(color='green')

In [ ]:
meta = pd.read_csv(rm.metadata_path)

In [ ]:
meta

In [ ]:
%matplotlib nbagg
import seaborn as sns
sns.set_context('notebook')

In [ ]:
from nbtools.logging import setup_live_logging
import logging
logger = setup_live_logging('planet4.plotting', logging.DEBUG)

In [ ]:
dir_ = 'without_large_fan_fnotch_on_p4_coords'

In [ ]:
kwargs = dict(datapath=dir_,
              saveroot='plots/'+dir_,
              savetitle='withLarge_hirise_coords',
              save=True)

In [ ]:
for id_ in ids:
    print(id_)
    plot_image_id_pipeline(id_, **kwargs)
    plt.close('all')

plot cluster results with noise


In [ ]:
from planet4.dbscan import DBScanner
from planet4 import markings, plotting, catalog_production

In [ ]:
dbscan = DBScanner()

In [ ]:
dbscan.cluster_and_plot('1cl', kind='fan')

In [ ]:
data = dbscan.p4id.filter_data('fan')

In [ ]:
fan_noise = data.loc[dbscan.noise[0]]

In [ ]:
xy = fan_noise[['x','y']].values

In [ ]:
rm = catalog_production.ReleaseManager('v1.0')

In [ ]:
%matplotlib ipympl

In [ ]:
plt.close('all')

In [ ]:
fig, ax = plt.subplots(ncols=2, figsize=(8,3))
plotting.plot_raw_fans('1cl', ax=ax[0])
plotting.plot_clustered_markings('1cl', 'fan', datapath=rm.savefolder, ax=ax[1])
ax[1].plot(xy[:,0], xy[:,1], 'o', 
           markerfacecolor='white',
           markeredgecolor='black', 
           markeredgewidth=0.2,
           markersize=3)
for axis in ax:
    axis.set_aspect('equal')
ax[0].set_title("Raw markings before clustering")
ax[1].set_title("Clustered and noise markings")
fig.savefig("/Users/klay6683/Dropbox/src/p4_paper1/figures/fans_clustered.png",
            dpi=150)

In [ ]:
import seaborn as sns
sns.set_context('paper')

In [ ]:
fig, axes = plt.subplots(ncols=2)
markings.ImageID('1cl').show_subframe(ax=axes[0])
plotting.plot_raw_fans('1cl', ax=axes[1])
id_ = 'APF00001cl'
axes[0].set_title(f"{id_}, original input")
axes[1].set_title(f"{id_}, Planet Four fan markings")
for ax in axes:
    ax.set_aspect('equal')
fig.tight_layout()
fig.savefig("/Users/klay6683/Dropbox/src/p4_paper1/figures/fan_markings.png",
            dpi=150)

In [ ]:
p4id = markings.ImageID('1cl')

In [ ]:
p4id.n_marked_classifications

In [ ]:
plotting.plot_image_id_pipeline('1cl', datapath=rm.savefolder,
                                figsize=(8,4))
plt.savefig("/Users/klay6683/Dropbox/src/p4_paper1/figures/P4_pipeline.png",
            dpi=150)

In [ ]:
import matplotlib as mpl

In [ ]:
time = np.arange('2005-02-01', '2005-02-02', dtype='datetime64[h]')

plt.plot(time)

In [ ]:
time.shape

In [ ]: