def dashboardPanels(df, table, variable): p = [] time_sub = '' if 'depth' in df.columns: times = df['time'].sort_values().unique() time_sub = 'time: ' + str(times[0]) + ' -- ' + str(times[-1]) depth_sub = '' if 'depth' in df.columns: depth_sub = ', depth: %2.2f -- %2.2f' % (np.min( df.depth), np.max(df.depth)) + ' [m]' unit = ' [' + db.getVar(table, variable).iloc[0]['Unit'] + ']' subject = time_sub + depth_sub unit = ' [' + db.getVar(table, variable).iloc[0]['Unit'] + ']' plotHeat.heatMap(df, table, variable, unit) panel = timePanel(df, table, variable, unit, subject) if panel != None: p.append(panel) panel = latPanel(df, table, variable, unit, subject) if panel != None: p.append(panel) panel = lonPanel(df, table, variable, unit, subject) if panel != None: p.append(panel) panel = depthPanel(df, table, variable, unit, subject) if panel != None: p.append(panel) if len(p) > 0: if not jup.inline(): ## if jupyter is not the caller fname = 'dashboard' dirPath = 'embed/' if not os.path.exists(dirPath): os.makedirs(dirPath) output_file(dirPath + fname + ".html", title=variable + unit) show(column(p)) return p
tables = sys.argv[8].split( ',') # argument8: comma-separated list of varaible table names variables = sys.argv[9].split( ',') # argument9: comma-separated list of variable names spatialTolerance = float( sys.argv[10] ) # argument10: colocalizer spatial tolerance (+/- degrees) depth1 = 0 depth2 = 5 exportDataFlag = bool( int(sys.argv[11]) ) # argument11: < 1 > export the cruise trajectory and colocalized data on disk; < 0 > ignore loadedTrack = plotAlongTrack(tables, variables, cruise, resampTau, df, spatialTolerance, depth1, depth2, fname, exportDataFlag, marker='-', msize=30, clr='darkturquoise') mutualTrends(loadedTrack, tables, variables, cruise) inline = jup.inline() # check if jupyter is calling this script if __name__ == "__main__": main()