Package: nrgpy
nrgpynrgpyis the Python package for processing NRG Data FilesWebsite and sourcehttps://github.com/nrgpy/nrgpyDocumentationhttps://nrgpy.github.io/nrgpy/index.htmlIEA Task 43 Parserhttps://github.com/nrgpy/nrg-parserSupportsupport@nrgsystems.comIt provides tools for:Converting binary ".rld" and ".rwd" files to text formatusing locally installed SymphoniePRO Desktop Software and Symphonie Data Retrieverusing NRG Cloud API (compatible with Linux!) *(SymphoniePRO only at this time)Reading Symphonie text exports, LOGR dat, and Spidar zip/csv files into Pandas dataframesTimestamp adjustment (of text files)Simple quality checks on dataContributingSee ourContributing guidelinesfor how to be a part of this project.Installationpip install nrgpyLog and token filesLog files and NRG Cloud token files will be generated when using the app. These files can be found
in your '''home''' directory:WindowsC:\Users\{username}\.nrgpy\Linux/Mac/home/{username}/.nrgpy/ExamplesFor more examples see the Documentation:https://nrgpy.github.io/nrgpy/index.htmlRLD filesConvert a folder of RLD files to Text with SymphoniePRO Desktop Softwareimportnrgpydate_filter='2018-10'# filter on any text in the filenamestext_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 APIimportnrgpyfile_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 APIimportnrgpyfilename="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 filesfile_filter="000110"importnrgpyreader=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 filesConvert a folder of RWD files to Text with Symphonie Data Retrieverimportnrgpyfile_filter='0434201902'# for Feb 2019 files from site 0434rwd_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 Retrieveron Linuximportnrgpyrwd_directory='/home/user/datafiles/rwd'out_directory='/home/user/datafiles/txt'wine_directory='/home/user/prefix32/drive_c/'# path to wine's "C:\" driveconverter=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:importnrgpyfilename='/path/to/file'converter=nrgpy.local_rwd(filename=filename)Read TXT files exported from RWD filesimportnrgpydt='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 filesSpidar 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]:importnrgpyIn[2]:fname="/spidar/1922AG7777_CAG70-SPPP-LPPP_NRG1_AVGWND_2019-07-07_1.zip"In[3]:reader=nrgpy.SpidarRead(filename=fname)In[4]:reader.heightsOut[4]:[40,60,80,90,100,120,130,160,180,200]In[5]:reader.dataOut[5]:pressure[mmHg]temperature[C]...dir_200_std[Deg]wind_measure_200_quality[%]Timestamp...2019-07-0623:40:00749.6624.13...28.77682019-07-0623:50:00749.6324.08...14.3102019-07-0700:00:00749.6423.99...20.590...