Comments (2)
Hello @lmalina ,
r_in
is a python object and is modified in place just as it is done in the underlying C code. This is not unexpected, however documentation could be improved.
In the short term to fix it you may use:
T = lattice_pass(SC.RING, Zin.copy(), nTurns, refOrds, keep_lattice=False)
On the longer term, we may add the flag as you suggest to use a copy of r_in
or not but changing the output format is strongly discouraged as it may impact other users codes and internal AT functions.
However, there is a need to refurbish the tracking function in my opinion right now it is a bit spread out between lattice_pass
, patpass
with variable outputs whether you activate losses or not, etc...
A good clean up would help and your request could be integrated.
@lfarv, what do you think? I would like to suggest introducing a new general tracking function (keep the old ones for backward compatibility) and integrate to the output a structured array as is done in get_optics
that would allow the function to evolve and integrate request as this one without changing its interface.
from at.
@lmalina and @swhite2401 : lattice_pass
is such for efficiency reason, and as @swhite2401 mentioned, we should not change its interface because it's the basic tracking function used in many places. The documentation clearly states that r_in
is modified in-place. This allows for instance to perform a long tracking by repeatedly calling lattice_pass
for one or a few turns: this way, you can monitor the tracking turn-by-turn, without needing a huge space for the output of the many turns. By putting refpts=[]
, you even suppress all output ! And this avoids any data copy.
But I agree that a new function on top of lattice_pass
could offer a more convenient interface, wile keeping lattice_pass
where performance is critical.
from at.
Related Issues (20)
- pyAT Distinguish between a sector bending magnet and a rectangular bending magnet HOT 2
- Reduce behaves differently in Matlab and python
- B0 added twice in exactkickrad HOT 2
- python: ringparam not well identified by lattice_load HOT 6
- bug is saving lattice HOT 4
- Bug: atwiggler HOT 13
- problem with display of correctly initialised VariableMultipole element HOT 1
- Change Legend Labels for plot_trajectory() function HOT 12
- fast_ring when having harmonic cavities in the lattice HOT 4
- AT_2_Elegant uses deprecated N_KICKS
- Factor 4 missing in Touschek scattering B2 expression HOT 5
- pyAT Error when calculating damping ring HOT 3
- Rotation of dipoles HOT 18
- matlab atlinopt4 check on 6d is disabled
- Severe bug introduced by #766 HOT 2
- Bug in Lattice.avlinopt HOT 7
- ring.get_lifetime fails if list of reference indexes has only one valid element HOT 1
- Compilation error when building from repository HOT 27
- VariableMultipole Usage HOT 7
- Inherited fields don't exist unless first explictly set HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from at.