tilbud / rCMEM

GNU General Public License v3.0
2 stars 4 forks source link

Unit Conversions #16

Closed HolmquistJ closed 4 years ago

HolmquistJ commented 4 years ago

Is there a good rule of thumb to handle the units of inputs versus what goes on in the code versus outputs? I think a good principle is 1. the unit for inputs and output has to be commonly used. 2. For inputs, when we're talking field data I think we keep things on the scale of a meter For elevation, sea-level, and when field data are converted to the scale of the sediment profile, I think we use or convert to the scale of the cm.

Attribute Fundamental Units Treatment
Biomass kg m-2 Convert to g cm-2 in code.
Suspended Sediment Concentration mg liter-1 = g m-3 Convert to g cm-3 in code.
Elevation and Datums typically reported in m relative to NAVD88 should make cm accross the board
Relative Sea-Level Rise typically reported in mm/year should make cm/year accross the board
ktoddbrown commented 4 years ago

I would love to get the unit conversions out of the primary functions. As long as the mass/volume units are similar then the code should not care what the units are. But this is the mathematician in me talking.

HolmquistJ commented 4 years ago

I like that idea. Do we ask users to use units we specify or define the units they're inputting, and write helper functions to convert everything to common scale before running core functions?

HolmquistJ commented 4 years ago

Right we have no unit conversions in the functions. All inputs, internal processes, and outputs default to grams and centimeters. We may want to put warning messages in to detect peak biomass and ssc values that seem too high.

HolmquistJ commented 4 years ago

I don't think there are any more unit conversions in the code.