Skip to content

Instantly share code, notes, and snippets.

@shahpnmlab
Last active November 4, 2024 15:15
Show Gist options
  • Save shahpnmlab/743155e3bc0a907479fee1148a0a33bb to your computer and use it in GitHub Desktop.
Save shahpnmlab/743155e3bc0a907479fee1148a0a33bb to your computer and use it in GitHub Desktop.
Plot warp picked coords using IMOD
import numpy as np
import starfile
XDIM = 378
YDIM = 378
ZDIM = 228
df = starfile.read("gs07_ts_003_8.00Apx_emd_13474_clean.star")
xyz_headings = [f'rlnCoordinate{axis}' for axis in 'XYZ']
xyz_headings.append('rlnAutopickFigureOfMerit')
coords = df[xyz_headings].to_numpy()
coords[:,0] *= XDIM
coords[:,1] *= YDIM
coords[:,2] *= ZDIM
np.savetxt("in.txt", coords, fmt='%.3f', delimiter='\t')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment