Skip to content

Conversation

@amereghe
Copy link
Member

@amereghe amereghe commented Aug 24, 2023

This PR is a follow up of PR #58
Some functions are follow ups of what developed in https://github.com/amereghe/GuessBeam

Major changes:

  • adding a function showing main optics functions at an element during a scan;
  • possibility to read .tfs tables listing currents in scans and survivors/lost particles by MADX/PTC tracking engines;
  • adding functions to read/write MADX/PTC starting conditions;
  • adding a function to convert bin centres to edges;
  • plotting sinograms (also with a 3D visualisation of the the histograms ensamble); spectra can be show as 3D sinograms;
  • possibility to compare multiple sets of spectra one by one;
  • adding a function to convert .xlsx files for QA into .tfs tables;
  • possibility to create elliptical or rectangular contours to phase space plots, either based on optics functions / parameters or statistical analysis of the beam enemble;
  • adding a function to sample a beam population and another one for normalising coordinates;
  • adding functions to compute beam statistics and showing it;
  • considering also CO in stat analisis of a beam sample;
  • When solving system of linear equations to get beam size or position, no longer use linsolve but lsqminnorm, such that (in case of non-unique solutions) the solution with min module is chosen.

Minor changes:

  • CompareOptics.m: phase advances can be compared;
  • DisplayBeamProfiles.m: when showing spectra, the user decides wether to use energy or range or IDs of profiles as independent variable;
  • PlotLattice.m: the function auto-detects if s-coordinate is given at the centre of the elements or at the end;
  • PlotLossMap.m: indices can be omitted from interface;
  • ScatterPlot.m: indices can be omitted from interface and possibility to receive data as a cell array or as a matrix;
  • ShowLossMap.m: indices can be omitted from interface.

amereghe and others added 28 commits May 31, 2023 14:08
… no longer use linsolve but lsqminnorm, such that (in case of non-unique solution) the solution with min module is chosen
* `MADX-optics/CompareOptics.m`: using a switch MatLab statement instead of a chain of if-elseif-else statements
* `MADX-optics/ParseTfsTableHeader.m`: smarter parsing of .tfs file header
* `MADX-tracking/PlotLossMap.m` and `MADX-tracking/ShowLossMap.m`: indices are used only when needed
* `MADX-tracking/ReadLosses.m`: smarter handling of optional arguments to function interface + file format determined by `GetColumnsAndMappingTFS`
* `MADX-tracking/ScatterPlot.m`: arrangement of plots determined by `GetNrowsNcols`, column names and columns to be plotted determined by `GetColumnsAndMappingTFS`, indices as used only when needed;
* `general/Plot2DHistograms.m`: start showing 3D histograms as 2D color maps;
…e / max single part emittance) are computed only in case of hor/ver phase spaces
* autoranging x-axis based on the leftmost and rightmost non-zero bin;
* decreasing thickness of histogram in each plot;
* dedicated plot with legend only created only if we have more than 6 plots;
* plot titles can be passed through the function interface;
…end + first data set is taken as ref in black solid
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.

1 participant