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

Should Markers be in the lattice file? #1

Open
felix-andreas opened this issue Nov 10, 2019 · 6 comments · May be fixed by #59
Open

Should Markers be in the lattice file? #1

felix-andreas opened this issue Nov 10, 2019 · 6 comments · May be fixed by #59

Comments

@felix-andreas
Copy link
Member

No description provided.

@TMsangohan
Copy link
Collaborator

Hi Felix,

Would it be much work to implement markers, I need them quite urgently to convert my latest version of BII lattice to the json format.

Thanks
Tom

@TMsangohan
Copy link
Collaborator

@andreasfelix

Created a branch add-markers-tom
where I added markers. I also updated the tests a bit such that in test_convert testcases are compared with expected output.

Tom

@felix-andreas
Copy link
Member Author

felix-andreas commented May 26, 2020

@PaulGoslawski do you have an opinion on this?

Still not sure if Markers should be part of the lattice file. Because they are just an auxiliary tool and there is no physical equivalent, it feels not right implement them as separate Element. I understand that it is convenient, because there is a Marker element in MADX and elegant, but is this reason enough to include them in LatticeJSON?

Also depending on the task, everybody will set their markers at different positions and this could be quite annoying when exchanging lattice files.

Would there be a problem to define thm as array (position in meters) under the "tool" attribute?

{
  "version": "2.0",
  "title": "FODO Lattice",
  "info": "This is the simplest possible strong focusing lattice.",
  "root": "RING",
  "elements": {
    "D1": ["Drift", {"length": 0.55}],
    "Q1": ["Quadrupole", {"length": 0.2, "k1": 1.2}],
    "Q2": ["Quadrupole", {"length": 0.4, "k1": -1.2}],
    "B1": ["Dipole", {"length": 1.5, "angle": 0.392701, "e1": 0.1963505, "e2": 0.1963505}]
  },
  "lattices": {
    "CELL": ["Q1", "D1", "B1", "D1", "Q2", "D1", "B1", "D1", "Q1"],
    "RING": ["CELL", "CELL", "CELL", "CELL", "CELL", "CELL", "CELL", "CELL"]
  },
  "tool": {
    "markers": [0, 10, 20]
  }
}

@felix-andreas felix-andreas linked a pull request May 26, 2020 that will close this issue
@PaulGoslawski
Copy link
Collaborator

PaulGoslawski commented May 27, 2020

Ok, so what is the reason for markers - for what do we need markers? Why they are needed in MADx and elegant?
--> To save tracking data in a 'special' position. OK? Only tracking data?
In principle they are not part of the lattice such as BPMs for example... but elegant defines markers as zero lenght dirft space

I like Felix proposal, but it will make the realisation of this markers more difficult or not?
And how to translate json markers into madx or elegant and vice versa?

Please not comment only by 'thumb up' ....

@TMsangohan
Copy link
Collaborator

@PaulGoslawski
I disagree to markers not being part of the lattice.

Beamports, FOMs, insertion devices, ... are real physical devices placed in the ring, and are referenced by markers in most cases. I need mostly lattices with markers as most lattice questions directed at me are users asking for optical functions at these places and how they would change when some specific magnet current is changed. And as you can have several versions of lattices I do not really see the problem of having them in the lattices, you just have different versions.

On a related topic, I need a straightforward and easy way to access power supplies as I often also get the question how strengths of magnets in physics units change when the current is changed of specific power supplies (currently I use a database that holds the conversion factors, magnet name and power supply name, and I provide a simple function that calculates conversions in both directions).

Both remarks above are routine questions and should not cost me any effort if you want me to use latticejson as a standard storage for lattices, otherwise it is just another way of storing some lattices but not all the ones I need producing more overhead.

I hope I do not sound harsh but as long as I have no bpms, cavities, kickers and markers I can not use this for my daily work and I need to make progress fast. My old approach of mongodb is far from perfect but allows me to quickly do the above things.

@andreasfelix
Do not take this as negative comments, I support your latticejson project fully but I am also aware of and myself confronted with the limitations that prohibit me from using it as a standard tool. So, see it as a push to develop it further ;).

@tomerten
Copy link

tomerten commented Jul 3, 2020

Implemented an working for my lattices. (add-markers-tom)

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 a pull request may close this issue.

4 participants