Created
November 27, 2018 12:16
-
-
Save dennissergeev/f3128497f334a91f87bd3f5e284a5c8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
url = 'http://svo2.cab.inta-csic.es/theory/newov/ssap.php?model=bt-settl&fid=752&format=ascii' | |
df = pd.read_csv(url, skiprows=9, names=['wavelength', 'flux'], sep='\t', index_col=False, | |
skipfooter=1, engine='python', dtype={'wavelength': float, 'flux': float}) | |
df['wavelength'] *= 1e-4 | |
fig, ax = plt.subplots() | |
ax.set_xscale('log') | |
# ax.set_xticks([0.2, 0.5, 0.8, 1, 2, 4, 6, 8, 10]) | |
ax.set_ylim([0, 7e5]) | |
df[(df.wavelength<10) & (df.wavelength>0.1)].rolling(5000).mean().plot(ax=ax, x='wavelength', y='flux') | |
# df[(df.wavelength<10) & (df.wavelength>0.1)][::5000].plot(ax=ax, x='wavelength', y='flux') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment