from numpy import float32 from collections import namedtuple Var = namedtuple('Var', ['type', 'standard_name', 'name', 'description', 'units', 'valid_min', 'valid_max']) database = dict( box_temp=Var( float32, 'air_temperature', 'box_temp', 'Auxillary Temperature', 'degC', '', '' ), box_pressure=Var( float32, 'air_pressure', 'box_pressure', 'Pressure inside the data logger enclosure', 'hPa', '850', '1100'), paro_air_temp_period=Var( float32, '', 'paro_air_temp_period', '', '1', '', '' ), paro_pressure_period=Var( float32, '', 'paro_pressure_period', '', '1', '', ''), paro_air_temp=Var( float32, 'air_temperature', 'paro_air_temp', '', 'degC', '-50', '50' ), pressure=Var( float32, 'air_pressure', 'pressure', 'Air pressure as measured from the PAROSCI pressure sensor', 'hPa', '850', '1100' ), paro_cal_sig=Var( float32, '', 'paro_cal_sig', '', '', '', '' ), box_rh=Var( float32, 'relative_humidity', 'box_rh', 'Relative humidity inside the data logger enclosure', '%', '0', '100' ), box_air_temp=Var( float32, 'air_temperature', 'box_air_temp', 'Air temperature inside the data logger enclosure', 'degC', '-50', '50' ), air_temp_2=Var( float32, 'air_temperature', 'air_temp_2', 'Auxillary air temperature', 'degC', '-50', '50', ), air_temp_3=Var( float32, 'air_temperature', 'air_temp_3', 'Auxillary air temperature', 'degC', '-50', '50' ), air_temp_4=Var( float32, 'air_temperature', 'air_temp_4', 'Auxillary air temperature', 'degC', '-50', '50' ), air_temp_5=Var( float32, 'air_temperature', 'air_temp_5', 'Auxillary air temperature', 'degC', '-50', '50' ), wind_speed=Var( float32, 'wind_speed', 'wind_speed', 'Wind speed', 'm*s^-1', '0', '50' ), wind_dir=Var( float32, 'wind_direction', 'wind_dir', 'Wind direction', 'degrees', '0', '360' ), rh_shield_freq=Var( float32, '', 'rh_shield_freq', '', 'hz', '', '' ), rh=Var( float32, 'relative_humidity', 'rh', 'Relative humidity', '%', '0', '100' ), air_temp_6_3m=Var( float32, 'air_temperature', 'air_temp_6_3m', 'Air temperature 6.3m from tower base', 'degC', '-50', '50' ), dewpoint=Var( float32, 'dewpoint_temperature', 'dewpoint', 'Calculated dewpoint temperature', 'degC', '-50', '50'), rtd_shield_freq=Var( float32, '', 'rtd_shied_freq', '', '', '', '' ), air_temp=Var( float32, 'air_temperature', 'air_temp', 'Air temperature', 'degC', '-50', '50' ), solar_flux=Var( float32, 'solar_flux', 'solar_flux', 'Solar flux', 'w*m^-2', '0', '3000'), precip=Var( float32, '', 'precip', 'Precipitation', 'mm', '0', '254' ), accum_precip=Var( float32, 'accumulated_precipitation', 'accum_precip', 'Precipitation accumulated since 0Z', 'mm', '0', '254' ), altimeter=Var( float32, '', 'altimeter', '', 'inHg', '', '' ), gust=Var( float32, 'wind_speed_of_gust', 'gust', 'Wind gust over the previous 2 minutes', 'm/s', '0', '50' ) ) met_vars = {'air_temp', 'rh', 'solar_flux', 'pressure', 'precip', 'accum_precip', 'wind_speed', 'wind_dir'} engr_vars = set(database.keys()) - met_vars