Skip to content

Updating Notebooks #84

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.ipynb_checkpoints
.DS_Store
.vscode
*.png
*.jpg
*.jpeg
1 change: 1 addition & 0 deletions CrossCorrelation/cross_correlation_notebook.ipynb
Original file line number Diff line number Diff line change
@@ -969,6 +969,7 @@
},
"outputs": [],
"source": [
"from stingray.crosscorrelation import AutoCorrelation\n",
"dt = 0.001 # seconds\n",
"exposure = 20. # seconds\n",
"freq = 1 # Hz\n",
2 changes: 1 addition & 1 deletion Deadtime/Check dead time model in Stingray.ipynb
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@
"outputs": [],
"source": [
"def simulate_events(rate, length, deadtime=2.5e-3, **filter_kwargs):\n",
" events = np.random.uniform(0, length, np.int(rate * length))\n",
" events = np.random.uniform(0, length, int(rate * length))\n",
" events = np.sort(events)\n",
" events_dt = filter_for_deadtime(events, deadtime, **filter_kwargs)\n",
" return events, events_dt"
3 changes: 2 additions & 1 deletion LombScargle/LombScargleCrossspectrum_tutorial.ipynb
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.font_manager as font_manager\n",
"plt.style.use('seaborn-talk')\n",
"plt.style.use('seaborn-v0_8-talk')\n",
"%matplotlib inline\n",
"from matplotlib.font_manager import FontProperties \n",
"font_prop = font_manager.FontProperties(size=16)"
]
},
2 changes: 1 addition & 1 deletion LombScargle/LombScarglePowerspectrum_tutorial.ipynb
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
"from scipy.interpolate import make_interp_spline\n",
"import matplotlib.font_manager as font_manager\n",
"%matplotlib inline\n",
"plt.style.use('seaborn-talk')\n",
"plt.style.use('seaborn-v0_8-talk')\n",
"font_prop = font_manager.FontProperties(size=16)"
]
},
2 changes: 1 addition & 1 deletion Window Functions/window_functions.ipynb
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@
],
"source": [
"nfft = 2048\n",
"A = fft(uniform_window,nfft ) / (len(uniform_window)/2.0)\n",
"A = fft(window,nfft ) / (len(window)/2.0)\n",
"freq = fftfreq(nfft)\n",
"response = 20 * np.log10(np.abs(fftshift(A/(abs(A).max()))))\n",
"plt.plot(freq, response)\n",