print("Please set first argument to be 'shape' or 'nematic'.") exit(1) oname = "" if len(sys.argv) == 4: oname = sys.argv[3] print("Output name is", sys.argv[3]) ################################################## # Track defects window_size = 100 charge = 0.5 avg = 4 ar = archive.loadarchive(sys.argv[2]) # https://stackoverflow.com/questions/46657423/rotated-image-coordinates-after-scipy-ndimage-interpolation-rotate def rot(image, xy, angle, crop): # shift, rotate, and shift org_center = (np.array(image.shape[:2][::-1]) - 1) / 2. im_rot = shift(image, -xy + org_center, mode='wrap') im_rot = rotate(im_rot, np.rad2deg(angle), mode='wrap', reshape=False) im_rot = shift(im_rot, -org_center + 2 * [crop / 2], mode='wrap') # crop to window size return im_rot[0:crop, 0:crop] c = 0 Q00_tot = np.zeros((window_size, window_size))
from math import sqrt # import local libs sys.path.insert(0, "../plot/") import plot import archive ################################################## # Init if len(sys.argv) == 1: print("Please provide an input file.") exit(1) # load archive from file ar = archive.loadarchive(sys.argv[1]) ################################################## # plot simple animation of phases ll = ar._nframes + 1 ar = archive.loadarchive(sys.argv[1]) bend = np.zeros(ll) splay = np.zeros(ll) c = 0 for i in range(0, ll): frame = ar.read_frame(i) print("{}/{}".format(i, ar._nframes), ) Qxx, Qxy = plot.get_Qtensor(frame.phi, frame.Q00, frame.Q01, size=24)