Skip to content

Instantly share code, notes, and snippets.

@shahpnmlab
Created June 24, 2022 12:50
Show Gist options
  • Save shahpnmlab/46175b860cd421b514a72aae6564697d to your computer and use it in GitHub Desktop.
Save shahpnmlab/46175b860cd421b514a72aae6564697d to your computer and use it in GitHub Desktop.
plotFSCwrp.py
import starfile
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
FSC='warp_fsc.star'
STEP=15
fsc = starfile.read(FSC)
freq_reso = 1/fsc['wrpResolution'].to_numpy()
masked_fsc = fsc['wrpFSCMasked'].to_numpy()
unmasked_fsc = fsc['wrpFSCUnmasked'].to_numpy()
xaxis = np.round(fsc['wrpResolution'].to_numpy()[::STEP],0)
xaxis[0]=0
plt.xticks(freq_reso[::STEP], xaxis)
plt.plot(freq_reso, masked_fsc, label="Masked")
plt.plot(freq_reso, unmasked_fsc,label="Unmasked")
plt.axhline(y=0.5, color='k', linestyle='--')
plt.axhline(y=0.143, color='k', linestyle='--')
plt.legend()
plt.savefig("wrp_fsc.png")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment