pyOPALTools issueshttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues2019-04-06T15:27:00+02:00https://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/21Add AMR dataset to general interface2019-04-06T15:27:00+02:00frey_mAdd AMR dataset to general interfacefrey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/20Remove duplicated code in datasets2019-04-06T15:27:00+02:00frey_mRemove duplicated code in datasetsSeveral datasets are based on the SDDS format. We should use a base class in order to get rid of duplicated code.Several datasets are based on the SDDS format. We should use a base class in order to get rid of duplicated code.https://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/19Dataset Information2019-04-06T15:27:00+02:00frey_mDataset InformationAs discussed with @snuverink_j we should add a function like ```summary``` to the dataset classes that prints the available variables etc.
- [x] DatasetBase.py
- [x] H5Dataset.py
- [x] MemoryDataset.py
- [x] PeakDataset.py
- [x] SolverD...As discussed with @snuverink_j we should add a function like ```summary``` to the dataset classes that prints the available variables etc.
- [x] DatasetBase.py
- [x] H5Dataset.py
- [x] MemoryDataset.py
- [x] PeakDataset.py
- [x] SolverDataset.py
- [x] TrackOrbitDataset.py
- [x] OptimizerDataset.py
- [x] ProbeHistDataset.py
- [x] StatDataset.py
- [x] GridDataset.py
- [x] LBalDataset.py
- [x] OutputDataset.py
- [x] SamplerDataset.py
- [x] TimeDataset.py
frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/18Logger2019-07-04T11:30:59+02:00frey_mLoggerInstall a logging system for pyOPALTools. Started with b232ef78b82f07b6ab7b1db82b3868b544a68363. Before I did the commit, I created a [tag](https://gitlab.psi.ch/OPAL/pyOPALTools/tags/pyOPALTools-0.0.1). So, the users can still have the ...Install a logging system for pyOPALTools. Started with b232ef78b82f07b6ab7b1db82b3868b544a68363. Before I did the commit, I created a [tag](https://gitlab.psi.ch/OPAL/pyOPALTools/tags/pyOPALTools-0.0.1). So, the users can still have the old behaviour.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/17JSON format change in Optimizer and Sampler2018-12-05T22:10:26+01:00frey_mJSON format change in Optimizer and SamplerThere's a JSON format change due to issue https://gitlab.psi.ch/OPAL/src/issues/259. We need therefore to adapt parsers. The new format contains a version tag such that we can still handle the deprecated data files.There's a JSON format change due to issue https://gitlab.psi.ch/OPAL/src/issues/259. We need therefore to adapt parsers. The new format contains a version tag such that we can still handle the deprecated data files.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/16Do not call plt.figure inside plotting functions2019-04-06T15:27:00+02:00frey_mDo not call plt.figure inside plotting functionsI think we shouldn't call
```python
plt.figure()
```
inside a plotting function. Otherwise we can't overlay multiple datasets.
Another solution could be of course to give a list of datasets to the plotting functions, thus, it would iter...I think we shouldn't call
```python
plt.figure()
```
inside a plotting function. Otherwise we can't overlay multiple datasets.
Another solution could be of course to give a list of datasets to the plotting functions, thus, it would iterate through them and call
```python
plt.figure()
```
only once.
It's really a design question. @snuverink_j What do you think?https://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/15Plotting Recommendation2020-04-07T11:00:46+02:00ext-roussel_rPlotting RecommendationThe plotting modules could be improved by using the object oriented approach to the matplotlib API. Functions returning matplotlib.pyplot.Figure or matplotlib.pyplot.Axes objects are far easier to work with when customizing plots. See fr...The plotting modules could be improved by using the object oriented approach to the matplotlib API. Functions returning matplotlib.pyplot.Figure or matplotlib.pyplot.Axes objects are far easier to work with when customizing plots. See from https://matplotlib.org/api/pyplot_summary.html
> Most of these functions also exist as methods in the matplotlib.axes.Axes class. You can use them with the “Object Oriented” approach to Matplotlib.
While it is easy to quickly generate plots with the matplotlib.pyplot module, we recommend using the object-oriented approach for more control and customization of your plots. See the methods in the matplotlib.axes.Axes() class for many of the same plotting functions. For examples of the OO approach to Matplotlib, see the API Examples.
I suggest having a kwargs argument that takes an matplotlib.pyplot.Axes object that determines if the function creates a new figure or not, ie.
```python
def plot(x,y,ax=''):
if not ax:
fig,ax = plt.subplots()
ax.plot(x,y)
return ax
```
This works well for a user who creates an array of plots and wants to fill each axis with a particular plot.ext-roussel_rext-roussel_rhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/14load_dataset not working as expected2019-04-06T15:27:00+02:00ext-roussel_rload_dataset not working as expectedHey guys, I like the new pyOPALTools, Nicole gave you a nice shoutout.
Issue: load_dataset('directory_name') doesn't return .stat file in directory_name/. Returns empty list.
RyanHey guys, I like the new pyOPALTools, Nicole gave you a nice shoutout.
Issue: load_dataset('directory_name') doesn't return .stat file in directory_name/. Returns empty list.
Ryanext-roussel_rext-roussel_rhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/13Parsing and Plotting of probe and peak file data.2019-01-30T16:25:42+01:00frey_mParsing and Plotting of probe and peak file data.After a discussion with @snuverink_j we decided to add plotting and parsing tools of probe and peak file data.After a discussion with @snuverink_j we decided to add plotting and parsing tools of probe and peak file data.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/12Removal of deprecated timing class.2018-04-14T20:08:27+02:00frey_mRemoval of deprecated timing class.The plots of ```pyOPALTools/timing/TimePlot.py``` got replaced by [opal/visualization/timing/plots.py](https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/opal/visualization/timing/plots.py). Therefore, I remove the old class and all the ...The plots of ```pyOPALTools/timing/TimePlot.py``` got replaced by [opal/visualization/timing/plots.py](https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/opal/visualization/timing/plots.py). Therefore, I remove the old class and all the tests.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/11plot_density slow for large number of particles2018-04-11T13:40:21+02:00snuverink_jjochem.snuverink@psi.chplot_density slow for large number of particlesIn the notebook RingCyclotron.ipynb the plot_density function is very slow for the example. I think it would be much faster and less memory-hungry if a histogram is made instead of scatter plot with colours.
e.g.
```python
plt.hist2d(xd...In the notebook RingCyclotron.ipynb the plot_density function is very slow for the example. I think it would be much faster and less memory-hungry if a histogram is made instead of scatter plot with colours.
e.g.
```python
plt.hist2d(xdata, ydata, (50, 50), cmap=plt.cm.jet)
```
gives within a second:
![image](/uploads/8c4ccb93cde6bbd5c4f25faff0a9772d/image.png)
@frey_m : I can add this if you'd agree.https://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/10cleanup root directory2019-01-30T16:25:42+01:00adelmanncleanup root directoryI think we should delete all *.py und notebooks on the root level.
Do you need any of these files?I think we should delete all *.py und notebooks on the root level.
Do you need any of these files?frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/9Implementation of envelope plot2018-03-27T13:58:58+02:00frey_mImplementation of envelope plotThe envelope plot is a nice view of the beamline for OPAL-T.
Please fill the gaps in
[LatticeParser.py](https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/utilities/LatticeParser.py)
and
[plot_envelope function](https://gitlab.psi.ch...The envelope plot is a nice view of the beamline for OPAL-T.
Please fill the gaps in
[LatticeParser.py](https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/utilities/LatticeParser.py)
and
[plot_envelope function](https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/opal/visualization/plots.py#L155)ganz_pganz_phttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/8Statistics Plot - Single Bunch vs. Multi Bunches2019-03-26T16:07:11+01:00frey_mStatistics Plot - Single Bunch vs. Multi BunchesDevelop some statistics plotting methods for single and multi bunch simulations.Develop some statistics plotting methods for single and multi bunch simulations.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/7Timing: Parse problem size2018-01-25T12:20:11+01:00frey_mTiming: Parse problem sizeMentioned in https://gitlab.psi.ch/OPAL/src/issues/181#note_4222.Mentioned in https://gitlab.psi.ch/OPAL/src/issues/181#note_4222.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/6timing plots2017-11-22T08:41:30+01:00adelmanntiming plotsThe max/min (tplot.summary_plot(fname=fn4, grid=True, first=7)) of the timing plots is wrong.
![image](/uploads/6cec84199f7a659949f9163eb75ba0e4/image.png)
SelfField total..... 128 178.8 178.8 146 145.9 163.5 ...The max/min (tplot.summary_plot(fname=fn4, grid=True, first=7)) of the timing plots is wrong.
![image](/uploads/6cec84199f7a659949f9163eb75ba0e4/image.png)
SelfField total..... 128 178.8 178.8 146 145.9 163.5 163.6frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/5Format timing information2017-11-14T09:42:44+01:00adelmannFormat timing informationWe should use the timing.dat data and not the std out.
```
num Nodes CPU tot Wall tot
===============================================
mainTimer........... 512 1260 1269
num Nodes C...We should use the timing.dat data and not the std out.
```
num Nodes CPU tot Wall tot
===============================================
mainTimer........... 512 1260 1269
num Nodes CPU max Wall max CPU min Wall min CPU avg Wall avg
=======================================================================================
mainTimer........... 512 1260 1269 1246 1269 1253 1269
Binaryrepart........ 512 0.61 0.596 0.58 0.5907 0.5931 0.5933
Boundingbox......... 512 133.7 133.5 130.6 130.8 132 132
Compute Statistics.. 512 32.91 32.6 29.88 29.98 31.71 31.71
ComputePotential.... 512 511.9 512.4 482.4 483.1 493.8 495.1
Create Distr........ 512 8.89 8.901 8.79 8.835 8.858 8.862
External field eval. 512 36.51 36.68 6.84 7.06 19.13 19.33
Fast inside test.... 512 0 0 0 0 0 0
Histogram........... 512 0 0 0 0 0 0
Initialize geometry. 512 0 0 0 0 0 0
Inside test......... 512 0 0 0 0 0 0
Load Distr.......... 512 0 0 0 0 0 0
Particle Inside..... 512 0 0 0 0 0 0
Ray tracing......... 512 0 0 0 0 0 0
Secondary emission.. 512 0 0 0 0 0 0
SelfField total..... 512 942.6 943.1 905.2 909.5 925.9 928.1
SF: GreensFTotal.... 512 412 412.3 395.8 398.1 404.5 405.7
TIntegration1....... 512 12.14 11.98 10.78 11.05 11.54 11.54
TIntegration2....... 512 15.75 15.74 14.19 14.55 15 15
WakeField........... 512 0 0 0 0 0 0
Write H5-File....... 512 11.29 16.15 4.47 16.13 7.677 16.14
Write Stat.......... 512 4.89 4.755 4.42 4.678 4.687 4.684
```frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/4testStat-1.py2017-11-11T10:41:57+01:00adelmanntestStat-1.pySeams to be confused with new SDDS reader
```python
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-90-5eae613b6252> ...Seams to be confused with new SDDS reader
```python
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-90-5eae613b6252> in <module>()
1 import statPlots as statpl
2
----> 3 statpl.opalStatOverviewPlot(fns)
~/git/pyOPALTools/statPlots.py in opalStatOverviewPlot(fns, title, pdfFn, addData, myLoc)
93 dataSrc.append(legendName)
94
---> 95 parser = SddsReader(fns[i])
96
97 if not x:
~/git/pyOPALTools/utils.py in __init__(self, filename)
171
172 self.memoryMapFile(filename)
--> 173 self.parseHeader()
174
175
~/git/pyOPALTools/utils.py in parseHeader(self)
277
278 else:
--> 279 raise Exception("Invalid syntax in SDDS header")
280
281 line = self.sdds_data_mem.readline()
Exception: Invalid syntax in SDDS header
```frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/3Pareto front viewer2017-06-29T13:27:00+02:00adelmannPareto front viewerUpdate to new format
[1_Ring.dat_0.json](/uploads/c428655026db65955a65d3cad90754a5/1_Ring.dat_0.json)Update to new format
[1_Ring.dat_0.json](/uploads/c428655026db65955a65d3cad90754a5/1_Ring.dat_0.json)frey_mfrey_mhttps://gitlab.psi.ch/OPAL/pyOPALTools/-/issues/2Json reader2018-03-15T18:52:31+01:00adelmannJson reader```
python json-reader-1.py 101
Found 999 json files.
('Read generation ', '101')
[u'rinit', u'tc01mb', u'prinit', u'tc02mb', u'tc03mb', u'phiinit', u'benergy']
[u'dpeak1', u'dpeak2', u'dpeak5_7', u'dpeak3_4', u'dpeak8_13']
adelm...```
python json-reader-1.py 101
Found 999 json files.
('Read generation ', '101')
[u'rinit', u'tc01mb', u'prinit', u'tc02mb', u'tc03mb', u'phiinit', u'benergy']
[u'dpeak1', u'dpeak2', u'dpeak5_7', u'dpeak3_4', u'dpeak8_13']
adelmann@fast-dude ~/git/pyOPALTools/tests/json-reader $ python json-reader-1.py 102
Found 999 json files.
('Read generation ', '102')
index 107 is out of bounds for axis 0 with size 107
```
Why give generation 107 an error?adelmannadelmann