https://github.com/craam/rstnpy
Library to work with RSTN 1 second data
https://github.com/craam/rstnpy
noaa rstn rstn-1-second satellite solar-physics
Last synced: 5 months ago
JSON representation
Library to work with RSTN 1 second data
- Host: GitHub
- URL: https://github.com/craam/rstnpy
- Owner: craam
- License: gpl-2.0
- Created: 2018-04-05T20:23:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-25T19:40:22.000Z (about 7 years ago)
- Last Synced: 2025-10-09T23:41:01.259Z (8 months ago)
- Topics: noaa, rstn, rstn-1-second, satellite, solar-physics
- Language: Python
- Homepage:
- Size: 106 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: RSTNPy
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.
** Installation
#+BEGIN_SRC bash
pip install rstnpy
#+END_SRC
** Dependencies
- pandas >= 0.21
- requests >= 2.20
- numpy >= 1.13
- matplotlib >= 2.2.2
** How to use it
#+BEGIN_SRC python
import matplotlib.pyplot as plt
from rstnpy import RSTN
year = 2014
month = 10
day = 16
path_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()
#+END_SRC
** Known issues
There is a bug when we download the file. The bug itself *does not*
*affect the functionality* as it is an ignored exception. It is a
apparently a tempfile bug.
Traceback example running with python 3.6.
#+BEGIN_SRC python
Exception ignored in: >
Traceback (most recent call last):
File "/usr/lib/python3.6/tempfile.py", line 591, in __del__
self.close()
File "/usr/lib/python3.6/tempfile.py", line 584, in close
self.file.close()
AttributeError: 'str' object has no attribute 'close'
#+END_SRC
** Compatibility
The library works with Python 3.5+