xtrack 0.70.0__tar.gz → 0.70.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xtrack-0.70.0/xtrack.egg-info → xtrack-0.70.2}/PKG-INFO +1 -1
- xtrack-0.70.2/tests/test_h6_sps_beamline.py +73 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_lhc_match_phase_15.py +4 -4
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_madnginterface.py +3 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_new_madloader.py +4 -4
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_trajectory_correcton.py +2 -1
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/__init__.py +1 -0
- xtrack-0.70.2/xtrack/_version.py +1 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/environment.py +31 -3
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/line.py +2 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_parser/loader.py +18 -4
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_writer.py +2 -1
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/twiss.py +51 -1
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/twissplot.py +2 -1
- {xtrack-0.70.0 → xtrack-0.70.2/xtrack.egg-info}/PKG-INFO +1 -1
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack.egg-info/SOURCES.txt +1 -0
- xtrack-0.70.0/xtrack/_version.py +0 -1
- {xtrack-0.70.0 → xtrack-0.70.2}/LICENSE +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/MANIFEST.in +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/README.md +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/base_classes.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/BB6D.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/beambeam.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/boost.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/qgauss.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/slicing.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/be_beamfields/spacecharge.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/elements.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/line.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/mathlibs.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/particles.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/ducktrack/temp_pyparticles.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/pyproject.toml +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/setup.cfg +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/setup.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_acceleration.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_amplitude_detuning.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_apertures.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_attr_replicas_and_slices.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_cavity_absolute_time.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_chromatic_functions_vs_madx.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_coasting.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_collective_tracker.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_collimation.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_element_characterization_functions.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_element_internal_record.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_elements.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_elements_classflags.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_elements_thick.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_environment.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_fcc_ee_solenoid_correction.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_footprint.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_freeze_longitudinal.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_full_rings.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_hvkick.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_ions.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_line.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_lumi.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_mad_writer.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_madloader.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_and_track_from_element.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_coupling_knob.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_nested.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_optics_and_ip_knob.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_orbit_bump.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_match_tune_chroma_cminus.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_multiline.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_multisetter.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_multispecies.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_particles_api.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_periodic_symmetric_twiss_and_match.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_pipeline.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_prebuild_kernels.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_ps_against_ptc.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_ps_multiturn_twiss.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_psb_chicane.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_pyht_interface.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_radial_steering.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_radiation.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_radiation_equilibrium_emittances.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_random_gen.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_random_gen_exp.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_random_gen_gauss.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_random_gen_ruth.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_rbend_rbarc.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_rf_track.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_rotation_signs.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_second_order_taylor_map.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_seeds.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_slice_and_insert_with_replicas.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_slice_elements.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_slicing.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_spacecharge_in_ring.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_sps_thick.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_survey.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_tapering.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_thick_lhc.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_tilt_shifts.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_tracker.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_twiss.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_twiss_vs_madx_psb.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_vs_madx.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/tests/test_xmask_orbit_correction.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/lhc_match/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/_temp/lhc_match/var_limits.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/base_element.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/beam_interaction.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/cavity.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_elem.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/elens.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/exciter.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/multipole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/octupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/solenoid.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/srotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_drift.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thick_slice_solenoid.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_multipolar_components.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_multipole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_quadrupole.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_solenoid.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/wedge.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/wire.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/exciter.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/rft_element.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/slice_elements.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/beam_elements/slice_elements_thick.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/footprint.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/general.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/headers/atomicadd.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/headers/checks.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/headers/constants.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/headers/particle_states.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/headers/synrad_spectrum.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/internal_record.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/json_utils.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/linear_normal_form.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/loss_location_refinement/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/lumi.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_loader.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_parser/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_parser/env_writer.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/mad_parser/parse.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/madng_interface.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/match.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_position_monitor.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_position_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_profile_monitor.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_profile_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_size_monitor.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/beam_size_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/last_turns_monitor.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/last_turns_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/particles_monitor.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/monitors/particles_monitor.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/multiline/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/multiline/multiline.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/multiline/shared_knobs.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/multisetter/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/multisetter/multisetter.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/particles/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/particles/constants.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/particles/particles.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/particles/rng_src/base_rng.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/particles/rng_src/particles_rng.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/pipeline/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/pipeline/core.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/pipeline/manager.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/pipeline/multitracker.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/progress_indicator.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/__init__.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_generators.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/exponential.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/normal.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/rutherford.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/uniform.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/random/random_src/uniform_accurate.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/slicing.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/survey.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/synctime.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/tapering.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/targets.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/tracker.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/tracker_data.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/tracker_src/tracker.h +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack/trajectory_correction.py +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack.egg-info/dependency_links.txt +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack.egg-info/requires.txt +0 -0
- {xtrack-0.70.0 → xtrack-0.70.2}/xtrack.egg-info/top_level.txt +0 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
import pathlib
|
2
|
+
from cpymad.madx import Madx
|
3
|
+
import numpy as np
|
4
|
+
import xtrack as xt
|
5
|
+
import xobjects as xo
|
6
|
+
|
7
|
+
test_data_folder = pathlib.Path(
|
8
|
+
__file__).parent.joinpath('../test_data').absolute()
|
9
|
+
|
10
|
+
def test_h6_sps_beamline():
|
11
|
+
|
12
|
+
'''
|
13
|
+
This checks the parsing of a sequence defined in madx with refer=exit
|
14
|
+
and the TwissTable.get_R_matrix_table() method
|
15
|
+
'''
|
16
|
+
|
17
|
+
lattice_path = test_data_folder / 'h6_experimental_line/h6-fm.str'
|
18
|
+
sequence_path = test_data_folder / 'h6_experimental_line/h6fm04.seq'
|
19
|
+
|
20
|
+
mad = Madx()
|
21
|
+
mad.call(str(lattice_path))
|
22
|
+
mad.call(str(sequence_path))
|
23
|
+
|
24
|
+
mad.input('''
|
25
|
+
beam, particle=proton, sequence=H6, PC=120.0,
|
26
|
+
ex = 2e-07,
|
27
|
+
ey = 5e-08;
|
28
|
+
|
29
|
+
use, sequence=H6;
|
30
|
+
twiss, chrom=true, rmatrix=true, betx=10, alfx=0, bety=10, alfy=0;
|
31
|
+
''')
|
32
|
+
tw_mad = xt.Table(mad.table.twiss)
|
33
|
+
|
34
|
+
env = xt.load_madx_lattice(sequence_path)
|
35
|
+
env.vars.load_madx(lattice_path)
|
36
|
+
line = env['h6']
|
37
|
+
line.particle_ref = xt.Particles(p0c=120e9, mass0=xt.PROTON_MASS_EV)
|
38
|
+
tt = line.get_table(attr=True)
|
39
|
+
line.configure_bend_model(edge='full')
|
40
|
+
|
41
|
+
tw = line.twiss(betx=10, bety=10)
|
42
|
+
|
43
|
+
check_at = [
|
44
|
+
't4..centre',
|
45
|
+
'vxsv.x0410104',
|
46
|
+
'begin.vac',
|
47
|
+
'xwca.x0410404',
|
48
|
+
'xsci.x0410475',
|
49
|
+
'xemc.x0410476',
|
50
|
+
'xdwc.x0410488',
|
51
|
+
'h6a',
|
52
|
+
'h6b',
|
53
|
+
'h6c']
|
54
|
+
|
55
|
+
tw_check = tw.rows[check_at]
|
56
|
+
tw_mad_check = tw_mad.rows[[nn+':1' for nn in check_at]]
|
57
|
+
|
58
|
+
xo.assert_allclose(tw_check.betx, tw_mad_check.betx, rtol=2e-5, atol=0)
|
59
|
+
xo.assert_allclose(tw_check.bety, tw_mad_check.bety, rtol=2e-5, atol=0)
|
60
|
+
xo.assert_allclose(tw_check.dx, tw_mad_check.dx, rtol=2e-5, atol=1e-4)
|
61
|
+
xo.assert_allclose(tw_check.dy, tw_mad_check.dy, rtol=2e-5, atol=1e-4)
|
62
|
+
|
63
|
+
trm = tw.get_R_matrix_table()
|
64
|
+
trm_check = trm.rows[check_at]
|
65
|
+
|
66
|
+
for ii in range(6):
|
67
|
+
for jj in range(6):
|
68
|
+
rterm_mad = tw_mad_check[f're{ii+1}{jj+1}']
|
69
|
+
rterm_xs = trm_check[f'r{ii+1}{jj+1}']
|
70
|
+
atol=1e-4*np.max(np.abs(rterm_mad))
|
71
|
+
if atol<1e-14:
|
72
|
+
atol=1e-14
|
73
|
+
xo.assert_allclose(rterm_xs, rterm_mad, rtol=2e-5, atol=atol)
|
@@ -559,10 +559,10 @@ def test_lhc_match_phase_15(test_context, config):
|
|
559
559
|
xt.VaryList(['kqtf.b1', 'kqtd.b1', 'ksf.b1', 'ksd.b1'], step=1e-7),
|
560
560
|
xt.VaryList(['kqtf.b2', 'kqtd.b2', 'ksf.b2', 'ksd.b2'], step=1e-7)],
|
561
561
|
targets = [
|
562
|
-
xt.TargetSet(line='lhcb1', qx=62.315, qy=60.325, tol=1e-
|
563
|
-
xt.TargetSet(line='lhcb1', dqx=10.0, dqy=12.0, tol=1e-
|
564
|
-
xt.TargetSet(line='lhcb2', qx=62.316, qy=60.324, tol=1e-
|
565
|
-
xt.TargetSet(line='lhcb2', dqx=9.0, dqy=11.0, tol=1e-
|
562
|
+
xt.TargetSet(line='lhcb1', qx=62.315, qy=60.325, tol=1e-6),
|
563
|
+
xt.TargetSet(line='lhcb1', dqx=10.0, dqy=12.0, tol=1e-4),
|
564
|
+
xt.TargetSet(line='lhcb2', qx=62.316, qy=60.324, tol=1e-6),
|
565
|
+
xt.TargetSet(line='lhcb2', dqx=9.0, dqy=11.0, tol=1e-4)])
|
566
566
|
opt.solve()
|
567
567
|
|
568
568
|
# Transfer knobs to madx model and check matched values
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import pytest
|
1
2
|
import xtrack as xt
|
2
3
|
import xobjects as xo
|
3
4
|
import pathlib
|
@@ -6,6 +7,7 @@ import numpy as np
|
|
6
7
|
test_data_folder = pathlib.Path(
|
7
8
|
__file__).parent.joinpath('../test_data').absolute()
|
8
9
|
|
10
|
+
@pytest.mark.xfail(strict=False) # sometimes madng fails to start the process (to be investigated)
|
9
11
|
def test_madng_twiss():
|
10
12
|
rdts = ["f4000", "f3100", "f2020", "f1120", 'f1001']
|
11
13
|
|
@@ -44,6 +46,7 @@ def test_madng_twiss():
|
|
44
46
|
assert np.abs(tw_rdt.f2020).max() > 0
|
45
47
|
assert np.abs(tw_rdt.f1120).max() > 0
|
46
48
|
|
49
|
+
@pytest.mark.xfail(strict=False) # sometimes madng fails to start the process (to be investigated)
|
47
50
|
def test_madng_interface_with_multipole_errors_and_misalignments():
|
48
51
|
line = xt.Line.from_json(test_data_folder /
|
49
52
|
'hllhc15_thick/lhc_thick_with_knobs.json')
|
@@ -237,7 +237,7 @@ def test_vkick(example_sequence):
|
|
237
237
|
assert vk1.length == 2
|
238
238
|
assert vk1.knl[0] == 0
|
239
239
|
assert vk1.ksl[0] == 3
|
240
|
-
|
240
|
+
xo.assert_allclose(vk1.rot_s_rad, -1)
|
241
241
|
|
242
242
|
|
243
243
|
def test_hkick(example_sequence):
|
@@ -259,7 +259,7 @@ def test_kick(example_sequence):
|
|
259
259
|
assert ki1.length == 2
|
260
260
|
assert ki1.knl[0] == -4
|
261
261
|
assert ki1.ksl[0] == 3
|
262
|
-
|
262
|
+
xo.assert_allclose(ki1.rot_s_rad, 1)
|
263
263
|
|
264
264
|
|
265
265
|
def test_tkick(example_sequence):
|
@@ -482,7 +482,7 @@ def test_reversed_vkick(example_sequence):
|
|
482
482
|
assert ivk1.length == 2
|
483
483
|
assert ivk1.knl[0] == 0
|
484
484
|
assert ivk1.ksl[0] == -3
|
485
|
-
|
485
|
+
xo.assert_allclose(ivk1.rot_s_rad, 1)
|
486
486
|
|
487
487
|
|
488
488
|
def test_reversed_hkick(example_sequence):
|
@@ -504,7 +504,7 @@ def test_reversed_kick(example_sequence):
|
|
504
504
|
assert ki1.length == 2
|
505
505
|
assert ki1.knl[0] == -4
|
506
506
|
assert ki1.ksl[0] == -3
|
507
|
-
|
507
|
+
xo.assert_allclose(ki1.rot_s_rad, -1)
|
508
508
|
|
509
509
|
|
510
510
|
def test_reversed_tkick(example_sequence):
|
@@ -22,7 +22,8 @@ def test_orbit_correction_basics(test_context):
|
|
22
22
|
|
23
23
|
# Define elements to be used as monitors for orbit correction
|
24
24
|
# (for LHC all element names starting by "bpm" and not ending by "_entry" or "_exit")
|
25
|
-
tt_monitors = tt.rows['bpm.*'].rows['.*(?<!_entry)$'].rows['.*(?<!_exit)$']
|
25
|
+
#tt_monitors = tt.rows['bpm.*'].rows['.*(?<!_entry)$'].rows['.*(?<!_exit)$']
|
26
|
+
tt_monitors = tt.rows['bpm.*','.*(?<!_entry)$','.*(?<!_exit)$']
|
26
27
|
line.steering_monitors_x = tt_monitors.name
|
27
28
|
line.steering_monitors_y = tt_monitors.name
|
28
29
|
|
@@ -44,6 +44,7 @@ from .line import _lines_equal, _apertures_equal
|
|
44
44
|
from .slicing import Strategy, Uniform, Teapot
|
45
45
|
from .loss_location_refinement import _skip_in_loss_location_refinement
|
46
46
|
from .trajectory_correction import TrajectoryCorrection
|
47
|
+
from .mad_parser.loader import load_madx_lattice
|
47
48
|
|
48
49
|
from xdeps import Table, FunctionPieceWiseLinear
|
49
50
|
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.70.2'
|
@@ -26,14 +26,18 @@ def _argsort(seq, tol=10e-10):
|
|
26
26
|
|
27
27
|
|
28
28
|
def _flatten_components(components, refer: ReferType = 'centre'):
|
29
|
-
if refer not in {'entry', 'centre'}:
|
29
|
+
if refer not in {'entry', 'centre', 'exit'}:
|
30
30
|
raise ValueError(
|
31
|
-
f'Allowed values for refer are "entry" and "
|
31
|
+
f'Allowed values for refer are "entry", "centre" and "exit". Got "{refer}".'
|
32
32
|
)
|
33
33
|
|
34
34
|
flatt_components = []
|
35
35
|
for nn in components:
|
36
36
|
if isinstance(nn, Place) and isinstance(nn.name, xt.Line):
|
37
|
+
if refer == 'exit':
|
38
|
+
raise NotImplementedError(
|
39
|
+
'Refer "exit" is not yet implemented for lines.'
|
40
|
+
)
|
37
41
|
line = nn.name
|
38
42
|
if not line.element_names:
|
39
43
|
continue
|
@@ -465,6 +469,7 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
465
469
|
|
466
470
|
s_center_for_place = {}
|
467
471
|
s_entry_for_place = {} # entry positions calculated assuming at is also pointing to entry
|
472
|
+
s_exit_for_place = {} # exit positions calculated assuming at is also pointing to exit
|
468
473
|
place_for_name = {}
|
469
474
|
n_resolved = 0
|
470
475
|
n_resolved_prev = -1
|
@@ -475,6 +480,7 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
475
480
|
# In case we want to allow for the length to be an expression
|
476
481
|
s_center_for_place[seq_all_places[0]] = aux_tt['length', seq_all_places[0].name] / 2
|
477
482
|
s_entry_for_place[seq_all_places[0]] = 0
|
483
|
+
s_exit_for_place[seq_all_places[0]] = aux_tt['length', seq_all_places[0].name]
|
478
484
|
place_for_name[seq_all_places[0].name] = seq_all_places[0]
|
479
485
|
n_resolved += 1
|
480
486
|
|
@@ -495,6 +501,8 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
495
501
|
+ aux_tt['length', ss.name] / 2)
|
496
502
|
s_entry_for_place[ss] = (s_entry_for_place[ss_prev]
|
497
503
|
+ aux_tt['length', ss_prev.name])
|
504
|
+
s_exit_for_place[ss] = (s_exit_for_place[ss_prev]
|
505
|
+
+ aux_tt['length', ss.name])
|
498
506
|
place_for_name[ss.name] = ss
|
499
507
|
n_resolved += 1
|
500
508
|
elif ss.at is None and ss._before:
|
@@ -509,6 +517,8 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
509
517
|
- aux_tt['length', ss.name] / 2)
|
510
518
|
s_entry_for_place[ss] = (s_entry_for_place[ss_next]
|
511
519
|
- aux_tt['length', ss.name])
|
520
|
+
s_exit_for_place[ss] = (s_exit_for_place[ss_next]
|
521
|
+
- aux_tt['length', ss_next.name])
|
512
522
|
place_for_name[ss.name] = ss
|
513
523
|
n_resolved += 1
|
514
524
|
else:
|
@@ -520,6 +530,7 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
520
530
|
if ss.from_ is None:
|
521
531
|
s_center_for_place[ss] = at
|
522
532
|
s_entry_for_place[ss] = at
|
533
|
+
s_exit_for_place[ss] = at
|
523
534
|
place_for_name[ss.name] = ss
|
524
535
|
n_resolved += 1
|
525
536
|
elif ss.from_ in place_for_name:
|
@@ -528,11 +539,12 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
528
539
|
f'Cannot resolve from_ for {ss.name} as {ss.from_} is duplicated')
|
529
540
|
s_center_for_place[ss] = s_center_for_place[place_for_name[ss.from_]] + at
|
530
541
|
s_entry_for_place[ss] = s_entry_for_place[place_for_name[ss.from_]] + at
|
542
|
+
s_exit_for_place[ss] = s_exit_for_place[place_for_name[ss.from_]] + at
|
531
543
|
place_for_name[ss.name] = ss
|
532
544
|
n_resolved += 1
|
533
545
|
|
534
546
|
if n_resolved != len(seq_all_places):
|
535
|
-
unresolved_pos = set(seq_all_places) - set(
|
547
|
+
unresolved_pos = set(seq_all_places) - set(s_center_for_place.keys())
|
536
548
|
raise ValueError(f'Could not resolve all s positions: {unresolved_pos}')
|
537
549
|
|
538
550
|
if n_resolved != len(seq_all_places):
|
@@ -541,8 +553,10 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
541
553
|
|
542
554
|
aux_s_center_expr = np.array([s_center_for_place[ss] for ss in seq_all_places])
|
543
555
|
aux_s_entry_expr = np.array([s_entry_for_place[ss] for ss in seq_all_places])
|
556
|
+
aux_s_exit_expr = np.array([s_exit_for_place[ss] for ss in seq_all_places])
|
544
557
|
aux_s_center = [ss._value if is_ref(ss) else ss for ss in aux_s_center_expr]
|
545
558
|
aux_s_entry = [ss._value if is_ref(ss) else ss for ss in aux_s_entry_expr]
|
559
|
+
aux_s_exit = [ss._value if is_ref(ss) else ss for ss in aux_s_exit_expr]
|
546
560
|
|
547
561
|
if refer == 'centre':
|
548
562
|
aux_tt['s_center'] = np.concatenate([aux_s_center, [0]])
|
@@ -572,6 +586,20 @@ def _resolve_s_positions(seq_all_places, env, refer: ReferType = 'center'):
|
|
572
586
|
tt_sorted['s_center'] = tt_sorted['s_entry'] + tt_sorted['length'] / 2
|
573
587
|
tt_sorted['s_exit'] = tt_sorted['s_entry'] + tt_sorted['length']
|
574
588
|
anchor_pos_dct = s_entry_for_place
|
589
|
+
elif refer == 'exit':
|
590
|
+
aux_tt['s_exit'] = np.concatenate([aux_s_exit, [0]])
|
591
|
+
|
592
|
+
i_sorted = _argsort(aux_s_exit)
|
593
|
+
|
594
|
+
name_sorted = [str(aux_tt.name[ii]) for ii in i_sorted]
|
595
|
+
|
596
|
+
# Temporary, should be replaced by aux_tt.rows[i_sorted], when table is fixed
|
597
|
+
data_sorted = {kk: aux_tt[kk][i_sorted] for kk in aux_tt._col_names}
|
598
|
+
tt_sorted = xt.Table(data_sorted)
|
599
|
+
|
600
|
+
tt_sorted['s_center'] = tt_sorted['s_exit'] - tt_sorted['length'] / 2
|
601
|
+
tt_sorted['s_entry'] = tt_sorted['s_exit'] - tt_sorted['length']
|
602
|
+
anchor_pos_dct = s_entry_for_place
|
575
603
|
else:
|
576
604
|
raise ValueError(f'Unknown refer value: {refer}')
|
577
605
|
|
@@ -4993,6 +4993,8 @@ class LineVars:
|
|
4993
4993
|
def load_madx_optics_file(self, filename, mad_stdout=False):
|
4994
4994
|
self.set_from_madx_file(filename, mad_stdout=mad_stdout)
|
4995
4995
|
|
4996
|
+
load_madx = load_madx_optics_file
|
4997
|
+
|
4996
4998
|
def load_json(self, filename):
|
4997
4999
|
|
4998
5000
|
with open(filename, 'r') as fid:
|
@@ -126,6 +126,8 @@ class MadxLoader:
|
|
126
126
|
self._new_builtin("ecollimator", "Drift")
|
127
127
|
self._new_builtin("instrument", "Drift")
|
128
128
|
self._new_builtin("monitor", "Drift")
|
129
|
+
self._new_builtin("hmonitor", "Drift")
|
130
|
+
self._new_builtin("vmonitor", "Drift")
|
129
131
|
self._new_builtin("placeholder", "Drift")
|
130
132
|
self._new_builtin("sbend", "Bend") # no rbarc since we don't have an angle
|
131
133
|
self._new_builtin("rbend", "Bend", rbend=True)
|
@@ -304,7 +306,11 @@ class MadxLoader:
|
|
304
306
|
name = self.env.new_line([drift_name, name, drift_name])
|
305
307
|
builder.place(name, at=at, from_=from_)
|
306
308
|
else:
|
307
|
-
|
309
|
+
if name == parent:
|
310
|
+
el_params.pop('extra', None)
|
311
|
+
builder.place(name, **el_params)
|
312
|
+
else:
|
313
|
+
builder.new(name, parent, **el_params)
|
308
314
|
|
309
315
|
def _set_element(self, name, builder, **kwargs):
|
310
316
|
self._parameter_cache[name].update(kwargs)
|
@@ -430,9 +436,11 @@ class MadxLoader:
|
|
430
436
|
# should be taken as is, and hope no one relies on it being < 0.
|
431
437
|
|
432
438
|
if params.pop('aperture', None):
|
433
|
-
|
434
|
-
|
435
|
-
|
439
|
+
pass
|
440
|
+
# Avoid flooding the user with warnings
|
441
|
+
# _warn(f'Ignoring aperture parameter for element `{name}` for now. '
|
442
|
+
# f'Only apertures on markers and standalone aperture elements '
|
443
|
+
# f'are supported for now.')
|
436
444
|
|
437
445
|
return params
|
438
446
|
|
@@ -626,3 +634,9 @@ class MadxLoader:
|
|
626
634
|
)
|
627
635
|
|
628
636
|
return element_name
|
637
|
+
|
638
|
+
def load_madx_lattice(file):
|
639
|
+
loader = MadxLoader()
|
640
|
+
loader.load_file(file)
|
641
|
+
env = loader.env
|
642
|
+
return env
|
@@ -315,7 +315,8 @@ def to_madx_sequence(line, name='seq', mode='sequence'):
|
|
315
315
|
if el_str is None:
|
316
316
|
continue
|
317
317
|
|
318
|
-
|
318
|
+
nn_mad = nn.replace(':', '__') # : not supported in madx names
|
319
|
+
seq_str += f"{nn_mad}: {el_str}, at={s_dict[nn]};\n"
|
319
320
|
seq_str += 'endsequence;'
|
320
321
|
machine_str = seq_str
|
321
322
|
|
@@ -3162,6 +3162,41 @@ class TwissTable(Table):
|
|
3162
3162
|
|
3163
3163
|
return R_matrix
|
3164
3164
|
|
3165
|
+
def get_R_matrix_table(self):
|
3166
|
+
|
3167
|
+
Rot = np.zeros(shape=(len(self.s), 6, 6), dtype=np.float64)
|
3168
|
+
|
3169
|
+
cos_phix = np.cos(self.phix - self.phix[0])
|
3170
|
+
sin_phix = np.sin(self.phix - self.phix[0])
|
3171
|
+
cos_phiy = np.cos(self.phiy - self.phiy[0])
|
3172
|
+
sin_phiy = np.sin(self.phiy - self.phiy[0])
|
3173
|
+
cos_phizeta = np.cos(self.phizeta - self.phizeta[0])
|
3174
|
+
sin_phizeta = np.sin(self.phizeta - self.phizeta[0])
|
3175
|
+
|
3176
|
+
Rot[:, 0, 0] = cos_phix
|
3177
|
+
Rot[:, 0, 1] = sin_phix
|
3178
|
+
Rot[:, 1, 0] = -sin_phix
|
3179
|
+
Rot[:, 1, 1] = cos_phix
|
3180
|
+
Rot[:, 2, 2] = cos_phiy
|
3181
|
+
Rot[:, 2, 3] = sin_phiy
|
3182
|
+
Rot[:, 3, 2] = -sin_phiy
|
3183
|
+
Rot[:, 3, 3] = cos_phiy
|
3184
|
+
Rot[:, 4, 4] = cos_phizeta
|
3185
|
+
Rot[:, 4, 5] = sin_phizeta
|
3186
|
+
Rot[:, 5, 4] = -sin_phizeta
|
3187
|
+
Rot[:, 5, 5] = cos_phizeta
|
3188
|
+
|
3189
|
+
# Compute W @ Rot @ W_inv slice by slice
|
3190
|
+
WW = self.W_matrix
|
3191
|
+
R_matrix_ebe = np.einsum('ijk,ikl->ijl', WW, Rot) @ np.linalg.inv(WW[0, :, :])
|
3192
|
+
|
3193
|
+
out_dct = {'s': self.s, 'name': self.name, 'R_matrix': R_matrix_ebe}
|
3194
|
+
for ii in range(6):
|
3195
|
+
for jj in range(6):
|
3196
|
+
out_dct[f'r{ii+1}{jj+1}'] = R_matrix_ebe[:, ii, jj]
|
3197
|
+
|
3198
|
+
return Table(out_dct)
|
3199
|
+
|
3165
3200
|
def get_normalized_coordinates(self, particles, nemitt_x=None, nemitt_y=None,
|
3166
3201
|
nemitt_zeta=None, _force_at_element=None):
|
3167
3202
|
|
@@ -3443,7 +3478,9 @@ class TwissTable(Table):
|
|
3443
3478
|
axleft=None,
|
3444
3479
|
axright=None,
|
3445
3480
|
axlattice=None,
|
3446
|
-
hover=False
|
3481
|
+
hover=False,
|
3482
|
+
figsize=(6.4*1.2, 4.8),
|
3483
|
+
lattice_only=False
|
3447
3484
|
):
|
3448
3485
|
"""
|
3449
3486
|
Plot columns of the TwissTable
|
@@ -3494,6 +3531,10 @@ class TwissTable(Table):
|
|
3494
3531
|
|
3495
3532
|
self._is_s_begin=True
|
3496
3533
|
|
3534
|
+
if lattice_only:
|
3535
|
+
yl = ''
|
3536
|
+
yr = ''
|
3537
|
+
|
3497
3538
|
pl=TwissPlot(self,
|
3498
3539
|
x=x,
|
3499
3540
|
yl=yl,
|
@@ -3507,6 +3548,7 @@ class TwissTable(Table):
|
|
3507
3548
|
axright=axright,
|
3508
3549
|
axlattice=axlattice,
|
3509
3550
|
hover=hover,
|
3551
|
+
figsize=figsize,
|
3510
3552
|
)
|
3511
3553
|
|
3512
3554
|
if labels is not None:
|
@@ -3514,6 +3556,14 @@ class TwissTable(Table):
|
|
3514
3556
|
labels=self[self._index][mask]
|
3515
3557
|
xs=self[x][mask]
|
3516
3558
|
pl.left.set_xticks(xs,labels)
|
3559
|
+
|
3560
|
+
if lattice_only:
|
3561
|
+
ax1 = pl.lattice.twinx()
|
3562
|
+
ax1.yaxis.set_label_position("left")
|
3563
|
+
ax1.yaxis.set_ticks_position("left")
|
3564
|
+
ax1.set_autoscale_on(True)
|
3565
|
+
pl.left = ax1
|
3566
|
+
|
3517
3567
|
return pl
|
3518
3568
|
|
3519
3569
|
|
@@ -84,6 +84,7 @@ class TwissPlot(object):
|
|
84
84
|
axright=None,
|
85
85
|
axlattice=None,
|
86
86
|
hover=False,
|
87
|
+
figsize=(6.4*1.2, 4.8)
|
87
88
|
):
|
88
89
|
|
89
90
|
import matplotlib.pyplot as plt
|
@@ -108,7 +109,7 @@ class TwissPlot(object):
|
|
108
109
|
if ax is not None:
|
109
110
|
self.figure = ax.figure
|
110
111
|
elif figure is None:
|
111
|
-
self.figure = plt.figure(num=figlabel, figsize=
|
112
|
+
self.figure = plt.figure(num=figlabel, figsize=figsize)
|
112
113
|
if figlabel is not None:
|
113
114
|
self.figure.clf()
|
114
115
|
for i in self.yl + self.yr:
|
@@ -41,6 +41,7 @@ tests/test_fcc_ee_solenoid_correction_new_optimize_api.py
|
|
41
41
|
tests/test_footprint.py
|
42
42
|
tests/test_freeze_longitudinal.py
|
43
43
|
tests/test_full_rings.py
|
44
|
+
tests/test_h6_sps_beamline.py
|
44
45
|
tests/test_hvkick.py
|
45
46
|
tests/test_ions.py
|
46
47
|
tests/test_lhc_match_phase_15.py
|
xtrack-0.70.0/xtrack/_version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.70.0'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|