This is an old revision of the document!
There are two unit of measure parameters included with every TOOL object: the SI unit of measure (SIuom) and the alternate unit of measure (altUom).
The SIUom is the base units for the data and is the units that are used for storing the data and doing any math with that data, including interacting with other objects.
The altUom is the display and input units of measure that will be used anytime you interact with the data. Interacting would include: the display tools like table, and graph, entering data manually through these tools, and direct assignment in code in views. Each altUom should be setup in the measures table (see measures tab in Documenter) to specify how the conversion to the related SIUom should be done.
TOOL can handle unit of measure conversions across multiple objects seamlessly provided that the user defines the new measure in Documenter and properly specifies the unit of measure when defining the shape of a variable. The general steps to implement unit of measure conversions are:
The target variable will be displayed in the desired unit of measure.
For this example we are going be importing fuel consumption data in mpg and converting the output to km/L
First we need to define the required altUom measures in Documenter.
To do this:
This will open the Measure Information window
Mile
Measure Type - Scientific Measure
Name - mile
SI Signature - m^1
Conversion to SI units - 0.000621371
US Gallon
Measure Type - Scientific Measure
Name - USgallon
SI Signature - m^3
Conversion to SI units - 264.172
Kilometer
Measure Type - Scientific Measure
Name - km
SI Signature - m^1
Conversion to SI units - 0.001
Litre
Measure Type - Scientific Measure
Name - litre
SI Signature - m^3
Conversion to SI units - 1000
Once the altUom's have been created we need to apply them to the shapes of our variables fuelConIn and fuelConOut.
We will need to set the altUom for the varialbe fuelConIn to mpg and the altUom for the variable fuelConOut to km/L.
To do this:
Repeat this process for the variable fuelConOut with km as the numerator and litre as the denominator
fuelConOut[vt,t]=fuelConIn[vt,t]
After loading the model from Documenter into SAMM and importing the source data into SAMM we can see how the source data which is in mpg gets converted to km/l in the target variable in the tables below