-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add Support for Loading Tristan v2 Spectra #20
Conversation
05d1a6c
to
6e45abb
Compare
There is a difference in what Tristan v1 and v2 save as spectra. v1 saves number of particles in an energy bin divided by gamma. This is why in spectra.py line 172-3 multiplies back by gamma before doing plots.
v2 saves just the number of particles per bin without this division by gamma. I see two possibilities to rectify this. Either divide spece and specp by gamma after reading v2 data, so that the rest of the code is unchanged; or only do this multiplication by gamma in spectra.py for data in v1 format. |
Done, I converted the v2 data to v1 format. I used |
Tests for: - __find_tristan_v2_spectra - __handle_tristan_v2_spectra
Those two functions were nearly identical so I combined them into a single function, MainApp.checkAndFindFilePaths(). Also, switched to using pathlib instead of os.path for all operations which simplified the code significantly; I had to tweak a few other spots to accountt for switching to pathlib
Also, fixed the test data type and tests for the new gamma factor in loading spectra
aec8bcc
to
a099f69
Compare
Testing on this data: When I select measurement coordinates for the spectrum that are between 40 and 80, i get errors that there is no electrons in that region and no spectrum is plotted. There should be 20 bins in x in this run, so it should be possible to zoom in. Could you check? |
Seems to work correctly! |
Summary
Add support for loading and plotting spectra from Tristan v2 data files.
Spectra
Iseult now reads in and displays Tristan v2 spectra. Tristan v2 spectra are binned in X, Y, and Z instead of just X as is done in Tristan v1. To account for this Iseult sums over the Y and Z axis to reduce Tristan v2 data to the same format as Tristan v1 data.
-i, --ion-spectra
and-e, --electron-spectra
to indicate which Tristan v2 spectra dataset should be treated as the ion and electron datasets respectively. By default Iseult treats the first dataset with a charge of -1 as the electron dataset and the first dataset with a +1 charge as the ion dataset.Other
.vscode/
to.gitignore
to avoid committing VS Code preferencesMainApp.ReloadPath()
andMainApp.pathOK()
with the newMainApp.checkAndFindFilePaths()
function. The old functions did nearly the same thing utilizing outdated libraries. The new function simplifies the logic and reduces repeated code.Cloning Instructions
if you already have that repo cloned locally then
$ cd path/to/bob-iseult $ git checkout --track origin/master-tv2Spectra