Closed bcaddy closed 3 weeks ago
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.
self.spece[:,i] *= self.gamma
self.specp[:,i] *= self.gamma
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 ebins
not gamma
since there is no dataset named gamma
in Tristan v2 and I think we decided that ebins
was the same thing.
Testing on this data: /scratch/gpfs/ar3676/2_test/output
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. "RUNTIME WARNING: spectra.py can't find the electrons in the integration region, spectra will be incorrect"
There should be 20 bins in x in this run, so it should be possible to zoom in. To reproduce. Right click on spectral plot (lower left), Measurements tab, unclick "Energy Region relative to shock?", type 40 and 80 into electron Energy Int region. Same for ions as well, though it can be different.
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