コード例 #1
0
def openVideo(path):
    # code = """\
    # %%HTML
    # <video width="640" height="480" controls>
    # <source src="{}" type="video/mp4">
    # </video>""".format(path)
    # ip = get_ipython()
    # ip.set_next_input(code)

    # # ipython = get_ipython()
    # # ipython.magic("HTML")
    # vid = io.open(path, 'r+b').read()
    # encoded = base64.b64encode(vid)
    # i = HTML(data='''<video alt="test" controls>
    #                 <source src='./video/Fe.mp4' type="video/mp4">
    #             </video>'''.format(encoded.decode('ascii')))

    if jup.jupytered():
        import IPython
        vObj = IPython.display.Video(path, width=640, height=480)
        IPython.display.display(vObj)
    else:
        path = 'file://' + os.path.realpath(path)
        webbrowser.open(path, new=2)
    return
コード例 #2
0
def openHTML(path):
    if jup.jupytered():
        import IPython
        vObj = IPython.display.IFrame(path, width=800, height=400)
        IPython.display.display(vObj)
    else:
        path = 'file://' + os.path.realpath(path)
        webbrowser.open(path, new=2)
    return
コード例 #3
0
import db
import subset
from dashboard import dashboardPanels
import export
import common as com
from datetime import datetime, timedelta
import time
from math import pi
from bokeh.plotting import figure, show, output_file
from bokeh.layouts import column
from bokeh.palettes import all_palettes
from bokeh.models import HoverTool, LinearColorMapper, BasicTicker, ColorBar, DatetimeTickFormatter
from bokeh.models.annotations import Title
from bokeh.embed import components
import jupyterInline as jup
if jup.jupytered():
    from tqdm import tqdm_notebook as tqdm
else:
    from tqdm import tqdm


def structuredMap(df, table, variable, data, lats, lons, subs, frameTables,
                  frameVars):
    times = df[df.columns[0]].unique()
    lat = df.lat.unique()
    lon = df.lon.unique()
    shape = (len(lat), len(lon))

    depths, hours = [None], [None]
    if 'depth' in df.columns:
        depths = df.depth.unique()