Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get freqmap #756

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Add get freqmap #756

wants to merge 2 commits into from

Conversation

oscarxblanco
Copy link
Contributor

Dear all,
this is a Work-In-Progress branch open to address the limitations on the frequency map analysis found by @TeresiaOlsson and mentioned here #755.

No need to review yet.

@oscarxblanco oscarxblanco added the WIP work in progress label Apr 17, 2024
@oscarxblanco
Copy link
Contributor Author

Dear @TeresiaOlsson ,

here is a script you could use to start the test on the function get_freqmap. Please, try it with a ring you have.
This function runs well on the axes ['x','y']. It also works on ['x','dp'] but I have not checked if the results make sense.

Best regards,
o

''' 
This file is used to test the new function get_freqmap
oblanco 2024apr16
'''
import at
import numpy
from matplotlib import pyplot as plt

print(f'{at.__version__}=')

ring = at.load_mat('testring.mat')
# ring.disable_6d()
print(f'{ring.get_tune()=}')

fmaout = at.get_freqmap(ring,
                     ['x','y'],
                     numpy.array([200,200]),
                     numpy.array([10e-3,10e-3]),
                     bounds=[[-1,1],[0,1]],
                     verbose=True,
                     )

fmadata = fmaout[0][0]

print('Plot')
# plot diffusion map
fig = plt.figure()
sc = plt.scatter(1e3*fmadata[:,0],1e3*fmadata[:,1],c=fmadata[:,6],s=1)
plt.grid()
plt.xlabel(r'x (mm)')
plt.ylabel(r'y (mm)')
plt.xlim(-10,10)
plt.ylim(-5,5)
clb = plt.colorbar(sc)
clb.ax.set_title(r'$\log_{10} \sqrt{(\Delta\nu_x^2 + \Delta\nu_y^2)/turn}$')
plt.savefig('diffussionmap.pdf')


# plot frequency map
fig = plt.figure()
sc = plt.scatter(fmadata[:,2],fmadata[:,3],c=fmadata[:,6],s=1)
plt.grid()
plt.xlim(0,0.5)
plt.ylim(0,0.5)
plt.xlabel(r'$\nu_x$')
plt.ylabel(r'$\nu_y$')
clb = plt.colorbar(sc)
clb.ax.set_title(r'$\log_{10} \sqrt{(\Delta\nu_x^2 + \Delta\nu_y^2)/turn}$')
plt.savefig('fmap.pdf')

@oscarxblanco oscarxblanco added the Python For python AT code label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python For python AT code WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants