openPMD-viewer icon indicating copy to clipboard operation
openPMD-viewer copied to clipboard

Make multiplying with unit_SI optional

Open AlexanderSinn opened this issue 4 years ago • 0 comments

This PR adds the ability to change the unit conversion when reading in data. By specifying units='SI' in OpenPMDTimeSeries(), the functions get_particle() and get_field() will output pure SI data. 'SI_u' (default) will give SI data but with normalized particle momentum, like how it is currently. 'raw' will ignore all unit_SI attributes. (but will still multiply the particle data with weighting if appropriate) With this approach more unit systems can be added to read_species_data() in the future.

Related to #209

AlexanderSinn avatar Feb 25 '21 19:02 AlexanderSinn