computeEmittanceOnPlane.py
This analysis script, computeEmittanceOnPlane.py, computes the RMS emittance of a beam in Cartesian coordinates as it crosses a plane, and provides various other beam phase space quantities using a speciesDataOnPlane history. As with calculating the emittance from species dump files, some care should be taken with 2D simulations of novel acceleration scenarios as a greater overall charge is often modeled to obtain a field strength to an equivalent 3D simulation with a Gaussian distribution in z. For the 2D simulation, there is no Gaussian in z, so charge is uniform and normalized to 1m.
The speciesDataOnPlane history records metadata which is checked to see if the species is weighted. The analyzer will report if the weights were found in this metadata.
The emittances are calculated as the square root of the determinant of the covariance matrix whose elements are the products of the averaged position and primed coordinates.
Input Parameters
- -s <simname>, --simulationName=<simname>
(string, required)
<simname> is the name of the simulation to be analyzed.
- -S <spname>, --speciesName=<spname>
(string, required, default = electron)
<spname> is the name of the species to be analyzed.
- -H <histname>, --historyName=<histname>
(string, required, default = speciesOnPlane)
<histname> is the name of the speciesDataOnPlane history to be analyzed.
- -w, --overwrite
(flag)
Whether a dataset or group should be overwritten if it already exists.
Output
This analysis script outputs additional histories in a VizSchema (VSim) compatible output file. These contain phase space measurements like bunch RMS size, longitudinal and transverse emittance, etc. The time slices in which they are measured correspond to the times the species data was dumped. Both time-slice measurements and cumulative measurement of reduce phase space quantities up to that time are recorded. Additionally the analyzer produces a csv file containing the RMS values of the same various phase space measurements.
If you are running this analyzer from the UI, and the output dataset file already exists, then it will be overwritten each time the analyzer is run, unless you uncheck the Overwrite Existing Files box near the bottom of the Analysis Results pane.
If you are running the analyzer from the command line, the dataset will not be overwritten
unless the -w
, or --overwrite
flag is specified on the command line.
The results of your analyzer may not be written into the output file if you have not specified the overwrite option to be True.