Skip to main content

rawdatx

rawdatx is a Python 2.7, 3.4, 3.5 converter that generates Excel xlsx files from TOA5 comma-separated text files produced by Campbell Scientific LoggerNet. Sensor input, processing instructions, and output structure are specified in a single XML Definition File that also serves as documentation.

rawdatx is available under the MIT license. The code of the project is hosted at https://github.com/cpetrich/rawdatx and packages are available on PyPI at https://pypi.python.org/pypi/rawdatx/. Documentation is available at https://rawdatx.readthedocs.org/.

Installation

The following prerequisites need to be installed:

  • Python 2.7, 3.4, or 3.5

  • numpy 1.9 or higher

  • xlsxwriter

optionally (recommended):

  • lxml

  • asteval

The easiest way to install rawdatx is through pip: pip install rawdatx

Alternatively, download the latest version from the repository https://github.com/cpetrich/rawdatx and install with python setup.py install.

Usage

To convert a TOA5 file to XLSX, run the following script:

import rawdatx.read_TOA5 as read_raw_data
import rawdatx.process_XML as process_XML

config = './config.cfg'
read_raw_data.main(config)
process_XML.main(config)

Input and output files are specified in an UTF-8 encoded configuration file config.cfg:

[RawData]
raw_data_path       = ./raw-data/
mask                = CR1000_*.dat
logger_time_zone    = UTC+1

[Metadata]
Project      = My project name

[Files]
xml_map_path        = ./
xml_map             = data_map.xml
data_path           = ./
processed_data_xlsx = processed_data.xlsx
xml_dtd_out         = data_map.dtd
raw_data            = consolidated_raw_data.npy
processed_data_npy  = processed_data.npy

The [RawData] section specifies the location of the logger input files, the [Metadata] section defines metadata entries copied into the XLSX file, and the [Files] section specifies path and file names of output and intermediate files (data_path) and input XML Definition File (xml_map_path and xml_map).

The XML Definition File (data_map.xml) may look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<measurements from="2015/05/03 11:45">
    <group name="Logger">
        <map name="Battery Voltage" unit="V" src="Batt_V" />
        <map name="Internal Temperature" unit="°C" src="T_panel" />
    </group>
    <group name="Weather">
        <map name="Air Temperature" unit="°C" src="T_air" />
        <map name="Relative Humidity" unit="%" src="RH" />
        <map name="Wind Speed" unit="m/s" src="Wind_speed" />
        <map name="Wind Direction" unit="°" src="Wind_direction" />
    </group>
</measurements>

See also examples and test files in the repository at https://github.com/cpetrich/rawdatx.

Metadata

Release files for rawdatx 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rawdatx 0.1
File Size Uploaded
rawdatx-0.1.zip 67.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rawdatx 0.1
File Interpreter ABI Platform
rawdatx-0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 95.0 kB

Release files / rawdatx-0.1.zip

Download URL rawdatx-0.1.zip
Size 67.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6fb03e8c06ac8b33023f527845131160e1ba2f31f57532ad7dda5d55982374d6
BLAKE2b-256 checksum
How to use checksums
020bf569c08cb64479f0d13693ae742514853365a7c6dd72a9245e5aa893a0eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawdatx-0.1-py2.py3-none-any.whl

Download URL rawdatx-0.1-py2.py3-none-any.whl
Size 27.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9e920e53aea95fff54c1786a7adc31f04d707fe7b283b09f1e901c18fd91fefa
BLAKE2b-256 checksum
How to use checksums
ec3d55927165233659a9e04af0e4e2ddc79c618e56735cb019dcdacf08543066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page