Files
weewx/util/import/csv-example.conf
gjr80 f2957cfc22 Various minor changes
- changed Cumulus source parameter from folder to directory
- moved startup message so that it still shows first
2016-09-03 09:24:16 +10:00

407 lines
17 KiB
Plaintext

# EXAMPLE WEE_IMPORT CONFIGURATION FILE
#
# Copyright (c) 2009-2016 Tom Keffer <tkeffer@gmail.com>
# See the file LICENSE.txt for your rights.
##############################################################################
# Specify the source. Available options are:
# CSV - import obs from a single CSV format file
# Wunder - import obs from a Weather Underground PWS history
# Cumuls - import obs from a one or more Cumulus monthly log files
# Format is:
# source = (CSV | Wunder | Cumulus)
source = CSV
##############################################################################
[CSV]
# Parameters used when importing from a CSV file
# Path and name of our CSV source file. Format is:
# file = full path and filename
file = /var/tmp/data.csv
# If there is no mapped interval field how will the interval field be
# determined for the imported records. Available options are:
# derive - Derive the interval field from the timestamp of successive
# records. This setting is best used when the imported records
# are equally spaced in time and there are no missing records.
# conf - Use the interval setting from weewx.conf. This setting is
# best used if the records to be imported have been produced by
# weewx using the same archive interval as set in weewx.conf on
# this machine.
# x - Use a fixed interval of x minutes for every record. This
# setting is best used if the records to be imported are
# equally based in time but there are some missing records.
#
# Note: If there is a mapped interval field then this setting will be
# ignored.
# Format is:
# interval = (derive | conf | x)
interval = derive
# Should any missing derived observations be calculated from the imported
# data if possible. Available options are:
# True - Any missing derived observations are calculated.
# False - Any missing derived observations are not calculated.
# Format is:
# calc_missing = (True | False)
calc_missing = True
# Imported records are written to archive in transactions of tranche
# records at a time. Increase for faster throughput, decrease to reduce
# memory requirements. Format is:
# tranche = x
# where x is an integer
tranche = 250
# Specify whether a UV sensor was used to produce any UV observations.
# Available options are:
# True - UV sensor was used and UV data will be imported.
# False - UV sensor was not used and any UV data will not be imported.
# UV fields will be set to None/NULL.
# For a CSV import UV_sensor should be set to False if a UV sensor was
# NOT present when the import data was created. Otherwise it may be set to
# True or omitted. Format is:
# UV_sensor = (True | False)
UV_sensor = True
# Specify whether a solar radiation sensor was used to produce any solar
# radiation observations. Available options are:
# True - Solar radiation sensor was used and solar radiation data will
# be imported.
# False - Solar radiation sensor was not used and any solar radiation
# data will not be imported. radiation fields will be set to
# None/NULL.
# For a CSV import solar_sensor should be set to False if a solar radiation
# sensor was NOT present when the import data was created. Otherwise it may
# be set to True or omitted. Format is:
# solar_sensor = (True | False)
solar_sensor = True
# Date-time format of CSV field from which the weewx archive record
# dateTime field is to be extracted. wee_import first attempts to interpret
# date/time info in this format, if this fails it then attempts to
# interpret it as a timestamp and if this fails it then raises an error.
# Uses Python strptime() format codes.
# raw_datetime_format = Python strptime() format string
raw_datetime_format = %Y-%m-%d %H:%M:%S
# Does the imported rain field represent the total rainfall since the last
# record or a cumulative value. Available options are:
# discrete - rain field represents total rainfall since last record
# cumulative - rain field represents a cumulative rainfall reset at
# midnight
# rain = (discrete | cumulative)
rain = cumulative
# Lower and upper bounds for imported wind direction. It is possible,
# particularly for a calculated direction, to have a value (eg -45) outside
# of the weewx limits (0 to 360 inclusive). Format is:
#
# wind_direction = lower,upper
#
# where :
# lower is the lower limit of acceptable wind direction in degrees
# (may be negative)
# upper is the upper limit of acceptable wind direction in degrees
#
# Imported values from lower to upper will be normalised to the range 0 to
# 360. Values outside of the parameter range will be stored as None. Default
# is -360,360.
wind_direction = -360,360
# Map CSV record fields to weewx archive fields. Format is:
#
# weewx_archive_field_name = csv_field_name, weewx_unit_name
#
# where:
# weewx_archive_field_name - An observation name in the weewx database
# schema.
# csv_field_name - The name of a field from the CSV file.
# weewx_unit_name - The name of the units, as defined in weewx,
# used by csv_field_name. This value represents
# the units used for this field in the CSV
# file, wee_import will do the necessary
# conversions to the unit system used by the
# weewx archive.
# For example,
# dewpoint = dew, degree_C
# would map the CSV field dew, in degrees C, to the archive field dewpoint.
#
# Archive fields that do not exist in the CSV data may be omitted. Any
# omitted fields that are derived (eg dewpoint) may be calculated during
# import using the equivalent of the weewx StdWXCalculate service through
# setting the calc-missing parameter above.
[[Map]]
dateTime = timestamp, unix_epoch
usUnits =
interval =
barometer = barometer, inHg
pressure =
altimeter =
inTemp =
outTemp = Temp, degree_F
inHumidity =
outHumidity = humidity, percent
windSpeed = windspeed, mile_per_hour
windDir = wind, degree_compass
windGust = gust, mile_per_hour
windGustDir = gustDir, degree_compass
rainRate = rate, inch_per_hour
rain = dayrain, inch
dewpoint =
windchill =
heatindex =
ET =
radiation =
UV =
##############################################################################
[Wunder]
# Parameters used when importing from a WU PWS
# WU PWS Station ID to be used for import.
station_id = XXXXXXXX123
#
# When importing WU data the following weewx database fields will be
# populated directly by the imported data (provided the corresponding data
# exists on WU):
# barometer
# dateTime
# dewpoint
# outHumidity
# outTemp
# radiation
# rain
# windDir
# windGust
# windSpeed
#
# The following weewx database fields will be populated from other
# settings/config files:
# interval
# usUnits
#
# The following weewx database fields will be populated with values derived
# from the imported data provided the --calc-missing command line option is
# used during import:
# altimeter
# ET
# heatindex
# pressure
# rainRate
# windchill
#
# The following weewx fields will be populated with derived values from the
# imported data provided the --calc-missing command line option is used
# during import. These fields will only be saved to the weewx database if
# the weewx schema has been modified to accept them. Note that the pyephem
# module is required in order to calculate maxSolarRad - refer weewx Users
# Guide.
# appTemp
# cloudbase
# humidex
# maxSolarRad
# windrun
# How will the interval field be determined for the imported records.
# Available options are:
# derive - Derive the interval field from the timestamp of successive
# records. This setting is best used when the imported records
# are equally spaced in time and there are no missing records.
# conf - Use the interval setting from weewx.conf. This setting is
# best used if the records to be imported have been produced by
# weewx using the same archive interval as set in weewx.conf on
# this machine.
# x - Use a fixed interval of x minutes for every record. This
# setting is best used if the records to be imported are
# equally based in time but there are some missing records.
# This setting is recommended for WU imports.
# Due to WU frequently missing uploaded records, use of 'derive' may give
# incorrect or inconsistent interval values. Better results may be
# achieved by using the 'conf' setting (if weewx has been doing the WU
# uploading and the weewx archive_interval matches the WU observation
# spacing in time) or setting the interval to a fixed value (eg 5). The
# most appropriate setting will depend on the completeness and (time)
# accuracy of the WU data being imported.
# Format is:
# interval = (derive | conf | x)
interval = x
# Should any missing derived observations be calculated from the imported
# data if possible. Available options are:
# True - Any missing derived observations are calculated.
# False - Any missing derived observations are not calculated.
# Format is:
# calc_missing = (True | False)
calc_missing = True
# Imported records are written to archive in transactions of tranche
# records at a time. Increase for faster throughput, decrease to reduce
# memory requirements. Format is:
# tranche = x
# where x is an integer
tranche = 250
# Lower and upper bounds for imported wind direction. It is possible,
# particularly for a calculated direction, to have a value (eg -45) outside
# of the weewx limits (0 to 360 inclusive). Format is:
#
# wind_direction = lower,upper
#
# where :
# lower is the lower limit of acceptable wind direction in degrees
# (may be negative)
# upper is the upper limit of acceptable wind direction in degrees
#
# WU has at times been known to store large values (eg -9999) for wind
# direction, often no wind direction was uploaded to WU. The wind_direction
# parameter sets a lower and upper bound for valid wind direction values.
# Values inside these bounds are normalised to the range 0 to 360. Values
# outside of the bounds will be stored as None. Default is 0,360
wind_direction = 0,360
##############################################################################
[Cumulus]
# Parameters used when importing Cumulus monthly log files
#
# Directory containing Cumulus monthly log files to be imported. Format is:
# directory = full path without trailing /
directory = /var/tmp/cumulus
# When importing Cumulus monthly log file data the following weewx database
# fields will be populated directly by the imported data:
# barometer
# dateTime
# dewpoint
# heatindex
# inHumidity
# inTemp
# outHumidity
# outTemp
# radiation (if Cumulus data available)
# rain (requires Cumulus 1.9.4 or later)
# rainRate
# UV (if Cumulus data available)
# windDir
# windGust
# windSpeed
# windchill
#
# The following weewx database fields will be populated from other
# settings/config files:
# interval
# usUnits
#
# The following weewx database fields will be populated with values derived
# from the imported data provided the --calc-missing command line option is
# used during import:
# altimeter
# ET
# pressure
#
# The following weewx fields will be populated with derived values from the
# imported data provided the --calc-missing command line option is used
# during import. These fields will only be saved to the weewx database if
# the weewx schema has been modified to accept them. Note that the pyephem
# module is required in order to calculate maxSolarRad - refer weewx Users
# Guide.
# appTemp
# cloudbase
# humidex
# maxSolarRad
# windrun
# How will the interval field be determined for the imported records.
# Available options are:
# derive - Derive the interval field from the timestamp of successive
# records. This setting is best used when the imported records
# are equally spaced in time and there are no missing records.
# conf - Use the interval setting from weewx.conf. This setting is
# best used if the records to be imported have been produced by
# weewx using the same archive interval as set in weewx.conf on
# this machine.
# x - Use a fixed interval of x minutes for every record. This
# setting is best used if the records to be imported are
# equally based in time but there are some missing records.
# This setting is recommended for WU imports.
# To import Cumulus records it is recommended that the interval setting
# be set to the value used in Cumulus as the 'data log interval'.
# Format is:
# interval = (derive | conf | x)
interval = x
# Should any missing derived observations be calculated from the imported
# data if possible. Available options are:
# True - Any missing derived observations are calculated.
# False - Any missing derived observations are not calculated.
# Format is:
# calc_missing = (True | False)
calc_missing = True
# Specify the character used as the field delimiter as Cumulus monthly log
# files may not always use a comma to delimit fields in the monthly log
# files. The character must be enclosed in quotes. Must not be the same
# as the decimal setting below. Format is:
# delimiter = ','
delimiter = ','
# Specify the character used as the decimal point. Cumulus monthly log
# files may not always use a fullstop character as the decimal point. The
# character must be enclosed in quotes. Must not be the same as the
# delimiter setting. Format is:
# decimal = '.'
decimal = '.'
# Imported records are written to archive in transactions of tranche
# records at a time. Increase for faster throughput, decrease to reduce
# memory requirements. Format is:
# tranche = x
# where x is an integer
tranche = 250
# Specify whether a UV sensor was used to produce any UV observations.
# Available options are:
# True - UV sensor was used and UV data will be imported.
# False - UV sensor was not used and any UV data will not be imported.
# UV fields will be set to None/NULL.
# For a Cumulus monthly log file import UV_sensor should be set to False if
# a UV sensor was NOT present when the import data was created. Otherwise
# it may be set to True or omitted. Format is:
# UV_sensor = (True | False)
UV_sensor = True
# Specify whether a solar radiation sensor was used to produce any solar
# radiation observations. Available options are:
# True - Solar radiation sensor was used and solar radiation data will
# be imported.
# False - Solar radiation sensor was not used and any solar radiation
# data will not be imported. radiation fields will be set to
# None/NULL.
# For a Cumulus monthly log file import solar_sensor should be set to False
# if a solar radiation sensor was NOT present when the import data was
# created. Otherwise it may be set to True or omitted. Format is:
# solar_sensor = (True | False)
solar_sensor = True
# For correct import of the monthly logs wee_import needs to know what
# units are used in the imported data. The units used for temperature,
# pressure, rain and windspeed related observations in the Cumulus monthly
# logs are set at the Cumulus Station Configuration Screen. The
# [[Units]] settings below should be set to the weewx equivalent of the
# units of measure used by Cumulus (eg if Cumulus used 'C' for temperature,
# temperature should be set to 'degree_C'). Note that Cumulus does not
# support all units used by weewx (eg 'mmHg') so not all weewx unit are
# available options.
[[Units]]
temperature = degree_C # options are 'degree_F' or 'degree_C'
pressure = hPa # options are 'inHg', 'mbar' or 'hPa'
rain = mm # options are 'inch' or 'mm'
speed = km_per_hour # options are 'mile_per_hour',
# 'km_per_hour', 'knot' or
# 'meter_per_second'