Skip to main content

library for handling NRG Systems data files

Project description

NRGPy nrgpy

pypi

nrgpy is the Python package for processing NRG Data Files

Website and source https://github.com/nrgpy/nrgpy
Documentation https://nrgpy.github.io/nrgpy/index.html
IEA Task 43 Parser https://github.com/nrgpy/nrg-parser
Support support@nrgsystems.com

It provides tools for:

  • Converting binary ".rld" and ".rwd" files to text format
    • using locally installed SymphoniePRO Desktop Software and Symphonie Data Retriever
    • using NRG Cloud API (compatible with Linux!) *(SymphoniePRO only at this time)
  • Reading Symphonie text exports, LOGR dat, and Spidar zip/csv files into Pandas dataframes
  • Timestamp adjustment (of text files)
  • Simple quality checks on data

Contributing

See our Contributing guidelines for how to be a part of this project.

Installation

pip install nrgpy

Log and token files

Log files and NRG Cloud token files will be generated when using the app. These files can be found in your '''home''' directory:

Windows

C:\Users\{username}\.nrgpy\

Linux/Mac

/home/{username}/.nrgpy/

Examples

For more examples see the Documentation: https://nrgpy.github.io/nrgpy/index.html

RLD files

Convert a folder of RLD files to Text with SymphoniePRO Desktop Software

import nrgpy
date_filter = '2018-10' # filter on any text in the filenames
text_folder_name = 'text_outputs/'
converter = nrgpy.local_rld(rld_dir='', out_dir=text_folder_name, file_filter=date_filter)
converter.convert()

Convert a folder of RLD files to Text with NRG Cloud Convert API

import nrgpy
file_filter = "000110"
rld_directory = "rlds"
client_id = "https://cloud.nrgsystems.com/data-manager/api-setup"
client_secret = ""
converter = nrgpy.cloud_convert(
    file_filter=file_filter, 
    rld_dir=rld_directory, 
    client_id=client_id,
    client_secret=client_secret,
    start_date="2019-11-01",
    end_date="2019-11-30",
)
converter.process()

Convert a single RLD file to Text with NRG Cloud API

import nrgpy
filename = "path/to/rld"
txt_dir = "path/to/txt/"
client_id = "https://cloud.nrgsystems.com/data-manager/api-setup"
client_secret = ""
converter = nrgpy.CloudConvert(
    filename=filename, 
    client_id=client_id,
    client_secret=client_secret,
)

Read files

file_filter = "000110"
import nrgpy

reader = nrgpy.SymProTextRead()
reader.concat_txt(
    txt_dir=text_folder_name, 
    file_filter=file_filter, 
    start_date="2019-11-01",
    end_date="2019-11-30",
)

RWD files

Convert a folder of RWD files to Text with Symphonie Data Retriever

import nrgpy

file_filter = '0434201902' # for Feb 2019 files from site 0434
rwd_directory = 'C:/Users/[user]/rwd/'
out_directory = 'C:/Users/[user]/txt/'

converter = nrgpy.local_rwd(file_filter=file_filter, rwd_dir=rwd_directory, out_dir=out_directory)
converter.convert()

Convert a folder of RWD files to Text with Symphonie Data Retriever on Linux

import nrgpy

rwd_directory = '/home/user/datafiles/rwd'
out_directory = '/home/user/datafiles/txt'
wine_directory = '/home/user/prefix32/drive_c/' # path to wine's "C:\" drive


converter = nrgpy.local_rwd(
                file_filter=file_filter, 
                rwd_dir=rwd_directory, 
                out_dir=out_directory,
                wine_folder=wine_directory,
                use_site_file=False # set to True to use site files
            )
converter.convert()

You can also convert a single file with SDR, and save it in the same directory:

import nrgpy

filename = '/path/to/file'
converter = nrgpy.local_rwd(filename=filename)

Read TXT files exported from RWD files

import nrgpy

dt = 'rwd'
txt_file = '/path/to/file.txt'
reader = nrgpy.read_text_data(data_type=dt, filename=txt_file)

or concatenate a whole lot of files:

dt = 'rwd'
txt_dir = '/path/to/text/files'
file_filter = 'text_in_filenames_you_want'
reader = nrgpy.read_text_data(data_type=dt, txt_dir=txt_dir, file_filter=file_filter)
reader.concat()

Spidar files

Spidar Vertical Profiler remote sensors generate archived csv data files in a Zip format.

These can be read directly into the spidar_txt_read method. See the docstring in spidar_txt.py for more information.

Eg.

In [1]: import nrgpy

In [2]: fname = "/spidar/1922AG7777_CAG70-SPPP-LPPP_NRG1_AVGWND_2019-07-07_1.zip"                            

In [3]: reader = nrgpy.SpidarRead(filename=fname)                                                                              

In [4]: reader.heights                                                                                                         
Out[4]: [40, 60, 80, 90, 100, 120, 130, 160, 180, 200]

In [5]: reader.data                                                                                                            
Out[5]: 
                     pressure[mmHg]  temperature[C]  ...  dir_200_std[Deg]  wind_measure_200_quality[%]
Timestamp                                            ...                                               
2019-07-06 23:40:00          749.66           24.13  ...             28.77                           68
2019-07-06 23:50:00          749.63           24.08  ...             14.31                            0
2019-07-07 00:00:00          749.64           23.99  ...             20.59                            0
...

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nrgpy-2.3.13.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nrgpy-2.3.13-py3-none-any.whl (76.3 kB view details)

Uploaded Python 3

File details

Details for the file nrgpy-2.3.13.tar.gz.

File metadata

  • Download URL: nrgpy-2.3.13.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nrgpy-2.3.13.tar.gz
Algorithm Hash digest
SHA256 21c20548a063bbce5ab8d20f882083c606854d8efb561e1cc714c899723a6afc
MD5 64ac979e089b00b7b1c17b81316d285c
BLAKE2b-256 5c28d42283a109526edace074352b40cac90488a79bba15239f27284057b9bd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nrgpy-2.3.13.tar.gz:

Publisher: pypi_publish.yml on nrgpy/nrgpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nrgpy-2.3.13-py3-none-any.whl.

File metadata

  • Download URL: nrgpy-2.3.13-py3-none-any.whl
  • Upload date:
  • Size: 76.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nrgpy-2.3.13-py3-none-any.whl
Algorithm Hash digest
SHA256 989ca105d40d0e917dbf16b5f2798a7029785e81716ce2f750d64d50b648b200
MD5 262206c5de532e6b3d7d7848c89ecb53
BLAKE2b-256 483f70e7e45a9cd3c155c34f5318c922ac3317010867005f3d59a5dfba91daeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for nrgpy-2.3.13-py3-none-any.whl:

Publisher: pypi_publish.yml on nrgpy/nrgpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page