legend-exp / legend-data-format-specs

LEGEND Data Format Specifications
https://legend-exp.github.io/legend-data-format-specs/
Other
0 stars 2 forks source link

Variable format for powers of units, multiplications etc. #7

Open sagitta42 opened 1 year ago

sagitta42 commented 1 year ago

In several cases already we have units with divisions e.g. in crystal metadata for impurity concentration in 1e9 e/cm^3, or in the preamplifier gain parameter in ADC/eV.

Currently in the crystal metadata, the impurity values are saved under value_in_1e9e_cm3. For now, I follow similar format for gain gain_ADC_eV.

What would be the best solution for these cases and others with complex parameters that involve divisions, powers, or multiplications?

sagitta42 commented 1 year ago

@gipert suggestion from @oschulz : gain_ADC_per_eV. What do you think? At least for variables with divisions in units

gipert commented 1 year ago

Well I would like to hear a complete proposal :)

If we use the /, *, etc. characters then units autoparsing will work out of the box, but the strings will not be valid variable names anymore. If we instead go for valid variable names, we'll need to write more code to parse units.

oschulz commented 1 year ago

I would very very strongly advocate to use only names that are valid variable names in common programming languages.

sagitta42 commented 1 year ago

I think we all agree that / is not a choice.

As for other options: