Difference between revisions of "Variable Naming Convention"
Line 1: | Line 1: | ||
+ | The general philosophy is to capture the data in native units of the sensor. | ||
+ | |||
+ | Variable names have three parts that describe the source of the data, what is being measured, and the units the sensor is calibrated in, separated by the underscore ( _ ) character: source_type_units | ||
+ | |||
+ | Examples: | ||
+ | hive_weight_lbs | ||
+ | hive_weight_kgs | ||
+ | hive_temp_c | ||
+ | ambient_temp_c | ||
+ | wx_temp_f | ||
+ | |||
Data can come from three sources: | Data can come from three sources: | ||
Line 16: | Line 27: | ||
|} | |} | ||
− | + | Variables that start with hive or ambient are read by the hive computer. Sensors that are partof another system, such as a Personal Weather Station, start with wx, even if the PWS is located at the hive. | |
Revision as of 16:25, 22 December 2014
The general philosophy is to capture the data in native units of the sensor.
Variable names have three parts that describe the source of the data, what is being measured, and the units the sensor is calibrated in, separated by the underscore ( _ ) character: source_type_units
Examples: hive_weight_lbs hive_weight_kgs hive_temp_c ambient_temp_c wx_temp_f
Data can come from three sources:
Source | Prefix |
---|---|
The Hive | hive |
Around the Hive | ambient |
Weather Station | wx |
Variables that start with hive or ambient are read by the hive computer. Sensors that are partof another system, such as a Personal Weather Station, start with wx, even if the PWS is located at the hive.
Database | Perl Programs | Bash Scripts | |
---|---|---|---|
hive_observation_time_local | $date | $DATE | |
hive_weight_lbs | $hive_weight | $HIVE_WEIGHT | |
hive_temp_c | $hive_temp_c | $HIVE_TEMP | |
hive_humidity | $hive_humidity | $HIVE_HUMIDITY | - |
|ambient_temp_c
|ambient_humidity
|ambient_luminance
|ambient_precip_in
|wx_station_id
|wx_observation_time_rfc822
|wx_temp_f
|wx_temp_c
|wx_relative_humidity
|wx_wind_dir
|wx_wind_degrees
|wx_wind_mph
|wx_wind_gust_mph
|wx_pressure_mb
|wx_pressure_in
|wx_dewpoint_f
|wx_dewpoint_c
|wx_solar_radiation
|wx_precip_1hr_in
|wx_precip_1hr_metric
|wx_precip_today_in
|wx_precip_today_metric
|quality
$DATE
$HIVE_WEIGHT
$HIVE_TEMP
$HIVE_HUMIDITY
$AMBIENT_TEMP
$AMBIENT_TEMP
$WX_TEMP_F
$WX_WIND_DEGREES
$WX_WIND_MPH
$WX_WIND_GUST_MHP
$WX_DEWPOINT_F
$WX_RELATIVE_HUMIDITY
$WX_PRESSURE_MB
$WX_PRECIP_TODAY_IN