In [ ]:
import logging
logger = logging.getLogger()
for hdlr in logger.handlers:
logger.removeHandler(hdlr)
logging.basicConfig()
from bokeh.plotting import output_notebook
from rtpipe import interactive, nbpipeline
from ipywidgets import Button, Output, VBox
from IPython.display import display
# following needed for classifier
import os
import activegit
import numpy as np
In [ ]:
output_notebook()
In [ ]:
candsfile, noisefile, fileroot = interactive.initializenb()
statedir = fileroot+'.ipynb-state'
state = nbpipeline.state(statedir)
In [ ]:
loc, prop, d = interactive.read_candidates(candsfile, returnstate=True)
data = interactive.readdata(d=d, cands=(loc, prop))
In [ ]:
try:
agdir = os.environ['agdir']
except KeyError:
home = os.environ['HOME']
agdir = os.path.join(home, 'code', 'alnotebook')
if agdir:
data['score'] = interactive.addclassifications(agdir, prop)
else:
print('No agdir defined, so no score calculated.')
In [ ]:
plinds = {'cir': [], 'cro': [], 'edg': []} # initialize plot symbols
state.setFloat('threshold', default=15, min=5, max=20, description='Threshold to find bad times')
state.setText('ignorestr', default='', description='Times to ignore (comma-delimited)')
In [ ]:
interactive.filterdata(data=data, plinds=plinds, d=d, threshold=state.load('threshold'),
ignorestr=state.load('ignorestr'), thresh0=6., thresh1=7.)
In [ ]:
state.setDropdown('scaling', default='snrs_3', options=['snrs_3', 'snrs_5', 'score_5', 'score_7'],
description='Symbol size scaling ("source_powerlaw")')
state.setDropdown('plottype', default='all', options=['all', 'dmt', 'norm', 'loc', 'stat'],
description='Type of plot to make')
In [ ]:
interactive.displayplot(data, plinds, state.load('plottype'), state.load('scaling'), fileroot,
url_path='http://www.aoc.nrao.edu/~claw/plots')
In [ ]:
noiseplot = interactive.plotnoise(noisefile, candsfile, plot_width=900, plot_height=450)
In [ ]:
state.setText('comments')
In [ ]:
state.objects
In [ ]: