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

DIST block for PySixDesk #49

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

michuschenk
Copy link

Includes following main changes

  • utils.sandwich function to merge contents of files into other files (here used to paste mad-x output into fort.3, for example).
  • Modified fort.3 and config.py templates now making use of DIST and SIMU blocks (this breaks backwards compatibility at the moment!), removing need for one-turn jobs
  • Python scripts that are called to generate cartesian or polar distributions in amplitude space
  • Adapted .mask template file to illustrate usage of scan parameters
  • Minor additions to the README file to clarify some points

@michuschenk
Copy link
Author

michuschenk commented Aug 24, 2020

Here an example of the particle initialization for both polar and cartesian grids. Amplitudes are set to be scanned from 5 to 15 sigma (incl.). At energy 450 GeV and assuming normalized emittance eps_norm = 3.5 um.rad this translates into: eps_geom = 7.3 nm. Given 2J = eps_geom, amplitudes (2J) should be extending from 36.5 nm to 109.5 nm, which is in agreement with output from the singletrackfile at turn 0 (distributions, and grey lines, plot below). For the polar grid, the number of angles was chosen to be 10 (excl. angles 0 deg and 90 deg).
cart_vs_plar

Copy link
Contributor

@amereghe amereghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @michuschenk ,
many thanks for the PR. I have added some punctual comments, nothing major.

The only major point is the break of the backward compatibility. Am I right in saying that the breakage is due to the replacement of the TRAC/INIT blocks with the SIMU block? I am wondering if we should modify slightly your PR, and if we request the one turn jobs, we use the TRAC/INIT blocks, erroring in case the user requests a non-polar mesh, what do you think?

Cheers,

}

self.madx = self.find_patterns(self.mask_path)
self.sixtrack = self.find_patterns(self.fort_path,
mandatory=['chrom_eps', 'CHROM'])
self.sixtrack['dist_type'] = 'None'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you want to use really None?

@@ -117,6 +117,10 @@ def oneturn(self):
sixtrack['toggle_coll/'] = '/'
return sixtrack

@staticmethod
def da_angles(start=0, end=pi/2, n=7):
return linspace(start, end, n + 2)[1: -1] # exclusive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a more verbose comment, saying that we don't take 0 and pi/2

z.update(y)
return z
def linspace(a, b, n):
'''Numpyless linear spacing function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you want a numpyless function for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is my doing, the main reason was simply to not have to add numpy as a dependency solely for its linspace method.

Comment on lines +48 to +51
/ Beam block is actually already in the fort.3.mad file
/ BEAM
/ %bunch_charge %emit_norm_x %emit_norm_y %sig_z %sig_e 1 %ibtype 1 0
/ NEXT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove these lines, then

Comment on lines -84 to -89
%toggle_coll/LIMI
%toggle_coll// DEBUG
%toggle_coll// PREC 0.001
%toggle_coll// PRIN ape_dump.dat
%toggle_coll/LOAD fort3.limi
%toggle_coll/NEXT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing these lines?

@@ -0,0 +1,643 @@
! Links definitions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a (very short) description of which machine/configuration you are running with MADX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants