adda
adda copied to clipboard
Add units support into command line
Is your feature request related to a problem? Please describe.
ADDA is some sort of unit-less, and if -size is in um, then -lambda must be in um. It will be more convenient to introduce units into ADDA, but leave it optional
Describe the solution you'd like
Add second optional input variable for every command-line numerical parameter, so instead of "-size 1 -lambda .555" user could write "-size 1 um -lambda 555 nm"
Additional context
All output quantities must also be followed with the units they are expressed in
Adding units to the abovementioned command line options should be straightforward. However, it is not that trivial for some other options, like beams, which can accept several parameters of length dimension, like width and coordinates. Probably, we can add one optional unit parameter to the end, but it should be obvious for the user (and allow no ambiguity).
Thus, the first step in implementation should be a revision of the existing command line options to suggest how the units should be added.
Second step is the revision of existing output, suggesting how the units should be added everywhere. Also think whether this can lead to any problems with existing post-processing tools that parse ADDA output.
Third question is what should be the default behavior, when units are used in only some places of the command line, but not the other. One option is to assume um for each quantity independently, unless some other unit is given explicitly. Alternatively, we may allow behavior that if nm is mentioned somewhere, while no other length units are mentioned anywhere, then nm is assumed the default unit for everything. The confusion may arise for something like -size 1 um -lambda 500 nm -beam dipole 3 4 5
.
This will also help with #253 . Both of these issues seem to have poor backwards compatibility, so that raises the question, how we should name the next version 1.5 or 2.0.
"not that trivial for some other options, like beams, which can accept several parameters of length dimension" - it seems that it would be trivial and enough to introduce a new separate cmdline-parameter "-beam_center