Variable Unit¶
-
get_unit
(tableName, varName)¶ Returns the unit for a given variable, if applicable.
Parameters: - tableName: string
The name of table associated with the dataset. A full list of table names can be found in the Data Catalog.
- varName: string or list of string
Variable short name. A full list of variable short names can be found in the Data Catalog.
Returns: String literal.
Example
Returns the unit of the short name variable, silica_hot, in the HOT Particle Flux dataset.
#!pip install pycmap -q #uncomment to install pycmap, if necessary
import pycmap
api = pycmap.API(token='<YOUR_API_KEY>')
api.get_unit('tblHOT_ParticleFlux', 'silica_hot')
SQL Statement
Here is how to achieve the same results using a direct SQL statement. Please refer to Query for more information.
EXEC uspVariableUnit 'tableName', 'varName'
Example
Returns the unit of the short name variable, silica_hot, in the HOT Particle Flux dataset.
EXEC uspVariableUnit 'tblHOT_ParticleFlux', 'silica_hot'