Skip to content

Commit

Permalink
Merge pull request #84 from AnonymousCodes911/notebook-update
Browse files Browse the repository at this point in the history
Updating Notebooks
  • Loading branch information
matteobachetti authored Feb 17, 2024
2 parents db9e8d6 + 5876625 commit 7f24ada
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
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
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Deadtime/Check dead time model in Stingray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion LombScargle/LombScargleCrossspectrum_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion LombScargle/LombScarglePowerspectrum_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion Window Functions/window_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7f24ada

Please sign in to comment.