Skip to content

Instantly share code, notes, and snippets.

@dennissergeev
Created November 27, 2018 12:16
Show Gist options
  • Save dennissergeev/f3128497f334a91f87bd3f5e284a5c8b to your computer and use it in GitHub Desktop.
Save dennissergeev/f3128497f334a91f87bd3f5e284a5c8b to your computer and use it in GitHub Desktop.
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