Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # EXAMPLE CONFIGURATION FILE FOR IMPORTING FROM CSV FILES
- #
- # Copyright (c) 2009-2024 Tom Keffer <tkeffer@gmail.com> and Gary Roderick.
- # See the file LICENSE.txt for your rights.
- ##############################################################################
- # Specify the source. Available options are:
- # CSV - import obs from a single CSV format file
- # WU - import obs from a Weather Underground PWS history
- # Cumulus - import obs from a one or more Cumulus monthly log files
- # WD - import obs from a one or more WD monthly log files
- # WeatherCat - import obs from a one or more WeatherCat monthly .cat files
- # Format is:
- # source = (CSV | WU | Cumulus | WD | WeatherCat)
- 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 = /tmp/meteobridge.csv
- # Specify the character used to separate fields. The character must be
- # enclosed in quotes. Format is:
- # delimiter = '<single character>'
- # Default is ',' (comma).
- delimiter = ','
- # Specify the character used as the decimal point. The character must be
- # enclosed in quotes.
- # Format is:
- # decimal = '<single character>'
- # or
- # Default is '.' (period).
- decimal = '.'
- # 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 there are no missing
- # records from period being imported. Missing records will cause
- # the interval field to be incorrectly calculated for some
- # 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
- # or some other means with the same archive interval as set in
- # weewx.conf on this machine.
- # x - Use a fixed interval of 'x' minutes for every record where 'x'
- # is a number. This setting is best used if the records to be
- # imported are equally spaced in time but there are some missing
- # records.
- #
- # Note: If there is a mapped interval field this setting will be ignored.
- # Format is:
- # interval = (derive | conf | x)
- # Default is derive.
- interval = derive
- # Should the [StdQC] max/min limits in weewx.conf be applied to the
- # imported data. This may be useful if the source has extreme values that
- # are clearly incorrect for some observations. Available options are:
- # True - weewx.conf [StdQC] max/min limits are applied.
- # False - weewx.conf [StdQC] max/min limits are not applied.
- # Format is:
- # qc = (True | False)
- # Default is True.
- qc = True
- # 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)
- # Default is True.
- calc_missing = True
- # Specify how imported data fields that contain invalid data (eg a numeric
- # field containing non-numeric data) are handled. Available options are:
- # True - The invalid data is ignored, the WeeWX target field is set to
- # None and the import continues.
- # False - The import is halted.
- # Format is:
- # ignore_invalid_data = (True | False)
- # Default is True.
- ignore_invalid_data = 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
- # Default is 250.
- tranche = 250
- # Specify whether a UV sensor was used to produce UV observation data.
- # 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 field 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)
- # Default is True.
- UV_sensor = True
- # Specify whether a solar radiation sensor was used to produce solar
- # radiation observation data. 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 field 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)
- # Default is True.
- solar_sensor = True
- # Date-time format of CSV field from which the WeeWX archive record
- # dateTime field is to be extracted. The import utility first attempts to
- # interpret date-time data in this format, if this fails it then attempts
- # to interpret it as a timestamp and if this fails an error is raised. Uses
- # Python strptime() format codes. Format is:
- # raw_datetime_format = Python strptime() format string
- raw_datetime_format = %Y-%m-%d %H:%M:%S
- # 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 = 0,360
- # Map CSV record fields to WeeWX archive fields. Format for each map entry
- # is:
- #
- # [[[weewx_archive_field_name]]]
- # source_field = csv_field_name
- # unit = weewx_unit_name
- # is_cumulative = True | False
- # is_text = True | False
- #
- # where:
- # weewx_archive_field_name - An observation name in the WeeWX database
- # schema.
- # source_field - Config option specifying the CSV field being
- # mapped.
- # csv_field_name - The name of a field from the CSV file.
- # unit - Config option specifying the unit used by
- # the CSV field being mapped.
- # weewx_unit_name - The WeeWX unit name for the the units used
- # by csv_field_name.
- # is_cumulative - Config option specifying whether the CSV
- # field being mapped is cumulative,
- # e.g: dayrain. Optional, default value is
- # False.
- # is_text - Config option specifying whether the CSV
- # field being mapped is text. Optional,
- # default value is False.
- # For example,
- # [[[outTemp]]]
- # source_field = Temp
- # unit = degree_C
- # would map the CSV field 'Temp', in degrees C, to the WeeWX archive field
- # 'outTemp'.
- #
- # A mapping for WeeWX field 'dateTime' is mandatory and the WeeWX unit name
- # for the 'dateTime' mapping must be 'unix_epoch'. For example,
- # [[[dateTime]]]
- # source_field = csv_date_and_time
- # unit = unix_epoch
- # would map the CSV field 'csv_date_and_time' to the WeeWX 'dateTime' field
- # with the 'csv_date_and_time' field being interpreted first using the
- # format specified at the 'raw_datetime_format' config option and if that
- # fails as a unix epoch timestamp.
- #
- # If the CSV data contains a field with WeeWX 'usUnits' data the field may
- # be mapped to WeeWX field 'usUnits' and this value will be used to
- # determine the units used for each CSV field. If a 'usUnits' mapping is
- # included the 'unit' option may be omitted as the 'usUnits' value is
- # unitless. If the 'unit' option is set it will be ignored. If a 'usUnits'
- # mapping is included the 'unit' option for all other fields may be
- # omitted.
- #
- # WeeWX 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.
- [[FieldMap]]
- [[[dateTime]]]
- source_field = dateTime
- unit = unix_epoch
- [[[outTemp]]]
- source_field = outTemp
- unit = degree_F
- [[[inTemp]]]
- source_field = inTemp
- unit = degree_F
- [[[outHumidity]]]
- source_field = outHumidity
- unit = percent
- [[[inHumidity]]]
- source_field = inHumidity
- unit = percent
- [[[dewpoint]]]
- source_field = dewpoint
- unit = degree_F
- [[[heatindex]]]
- source_field = heatindex
- unit = degree_F
- [[[windchill]]]
- source_field = windchill
- unit = degree_F
- [[[barometer]]]
- source_field = barometer
- unit = hPa
- [[[rain]]]
- source_field = rain
- unit = inch
- is_cumulative = True
- [[[rainRate]]]
- source_field = rainRate
- unit = inch_per_hour
- [[[windSpeed]]]
- source_field = windSpeed
- unit = mile_per_hour
- [[[windDir]]]
- source_field = windDir
- unit = degree_compass
- [[[windGust]]]
- source_field = windGust
- unit = mile_per_hour
- [[[radiation]]]
- source_field = radiation
- unit = watt_per_meter_squared
- [[[UV]]]
- source_field = UV
- unit = uv_index
- [[[inDewpoint]]]
- source_field = inDewpoint
- unit = degree_F
- [[[pressure]]]
- source_field = pressure
- unit = hPa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement