This is ReddTea's small package compiling useful self-made functions for an astrophysical context.
Reddutils contains many functions and classes for personal use. Some of them may be of use for the community.
This code makes use of:
- Numpy
- pandas
- Scipy
- PyAstronomy (http://www.hs.uni-hamburg.de/DE/Ins/Per/Czesla/PyA/PyA/index.html)
- tqdm (https://pypi.python.org/pypi/tqdm)
- tabulate
- matplotlib.pyplot
- ipywidgets
- IPython.display
Most of them come with conda, if some are missing they can be easily installed with pip.
In the console type in your work folder
pip install reddutils
For a pandas dataframe or three-column table:
from reddutils import correlator as rc
import pandas as pd
df = pd.read_csv('data.csv')
cor = rc.correlator()
cor.display(df)
Use for visualising the NASA Exoplanet Archive:
from reddutils import exodus
#exopop = exodus.Exoplanet_Archive()
exopop = exodus.Exoplanet_Archive('NasaExoplanetArchive')
#exopop = exodus.Exoplanet_Archive('ExoplanetEU2')
#exopop = exodus.Exoplanet_Archive('ExoplanetsOrg')
exopop.display()
Try out the histogram mode:
exopop.display_hist()
For visualising fourier transforms and the nyquist limit.
from reddutils import fourier
fou = fourier.fourier()
fou.display()
For a pandas dataframe:
from reddutils import periodogram as rp
import pandas as pd
df = pd.read_csv('data.csv')
per = rp.LSP()
per.display(df)