Library to work with RSTN 1 second data. Working for data after 2000. The library provides the possibility of downloading the file for a given day from any of RSTN stations, and it is also able to generate a dataframe with the data.
pip install rstnpy- pandas >= 0.21
- requests >= 2.20
- numpy >= 1.13
- matplotlib >= 2.2.2
importmatplotlib.pyplotaspltfromrstnpyimportRSTNyear=2014month=10day=16path_to_files="data/"station="San vito"rstn=RSTN(year, month, day, path_to_files, station)
# Search and download the file.filename=rstn.downloader.download_file()
# Decompress the gzipped file into a text file.filename=rstn.decompress_file(filename)
# Generate a dataframe from the data.df=rstn.create_dataframe()
# Plot the data.ax=rstn.plot()
plt.plot()There is a bug when we download the file. The bug itself does notaffect the functionality as it is an ignored exception. It is a apparently a tempfile bug.
Traceback example running with python 3.6.
Exceptionignoredin: <boundmethod_TemporaryFileCloser.__del__of<tempfile._TemporaryFileCloserobjectat0x7f2ba52df320>>Traceback (mostrecentcalllast):
File"/usr/lib/python3.6/tempfile.py", line591, in__del__self.close()
File"/usr/lib/python3.6/tempfile.py", line584, incloseself.file.close()
AttributeError: 'str'objecthasnoattribute'close'The library works with Python 3.5+