import numpy as np import matplotlib.pyplot as plt import module # This simple tutorial aims to train you on the TCA. More functions will be implemented in the future. main_path = "" # Read files h, tot_file = module.bashload(main_path) # Calculate delx,y h, tot_vector = module.bashvector(h) # Calculate overlay h, tot_vec_overlay = module.bashoverlay(h) # Plot fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(h.tot_vec_overlay['ecc03_delx'], h.tot_vec_overlay['ecc03_dely'], '+') plt.show()
import matplotlib.cm as cm import matplotlib.colors as colors from matplotlib.colors import Normalize import json import os import matplotlib.colors as mcolors from matplotlib.transforms import Affine2D import matplotlib.patches as patches from mpl_toolkits.mplot3d import Axes3D main_path = "/media/zezhou/Seagate Expansion Drive/McGillResearch/2019Manuscript_Analysis/Analysis/datafterlinearshift/tplasmid/" cleanmode = 1 # 1-cleaned data. The roi.json and tot_file_clean.json files have been saved in ./data folder. # 0-raw data. Experimental data before shift to zero. # Read files handle1, tot_file = module.bashload(main_path) handle1, tot_vector = module.bashvector(handle1) handle1, tot_vec_overlay = module.bashoverlay(handle1) # Data clean if cleanmode == 0: handle1, roi = module.bashroi(handle1) # ROI selection handle1, tot_file_clean = module.bashclean( handle1) # Delete points ouside ROI and attach mask to handle1. handle1, tot_file_shift = module.allshift( handle1) # Shift data to zero according to YOYO-3 channel elif cleanmode == 1: os.chdir(main_path + '/data') tot_file_clean = json.load( open('tot_file_clean.json')) # data is saved in list format for filename in tot_file_clean: tot_file_clean[filename] = np.array(