Skip to content

Commit

Permalink
Merge pull request #103 from StingraySoftware/address_pyopensci_comments
Browse files Browse the repository at this point in the history
Address PyOpenSci comments
  • Loading branch information
matteobachetti authored Sep 10, 2024
2 parents b013a5f + 54a0f7e commit 29875e8
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 33 deletions.
93 changes: 79 additions & 14 deletions Lightcurve/Lightcurve tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,13 @@
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"lc.check_lightcurve()"
Expand All @@ -1253,17 +1259,33 @@
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"raises-exception"
]
},
"outputs": [],
"source": [
"gti = [(10, 100), (20, 30, 40), ((1, 2), (3, 4, (5, 6)))] # not a well-behaved GTI\n",
"gti = [(10, 100, 123), (20, 30, 40)] # not a well-behaved GTI\n",
"lc = Lightcurve(time, counts, dt=0.1, skip_checks=True, gti=gti)"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"raises-exception"
]
},
"outputs": [
{
"ename": "TypeError",
Expand All @@ -1280,6 +1302,7 @@
}
],
"source": [
"# This will fail\n",
"lc.check_lightcurve()"
]
},
Expand Down Expand Up @@ -1420,7 +1443,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Working with GTIs and Splitting Light Curves\n",
"\n",
Expand Down Expand Up @@ -1737,7 +1766,13 @@
{
"cell_type": "code",
"execution_count": 82,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -1767,7 +1802,13 @@
{
"cell_type": "code",
"execution_count": 83,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"start_times, stop_times, lc_sums = lc.analyze_lc_chunks(segment_size = 10.0, func=np.median)"
Expand Down Expand Up @@ -1817,7 +1858,13 @@
{
"cell_type": "code",
"execution_count": 86,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"start_times, stop_times, lc_result = lc.analyze_lc_chunks(segment_size=10.0, func=myfunc)"
Expand Down Expand Up @@ -1846,7 +1893,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Compatibility with `Lightkurve`\n",
"\n",
Expand All @@ -1856,7 +1909,13 @@
{
"cell_type": "code",
"execution_count": 88,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"import lightkurve"
Expand All @@ -1865,7 +1924,13 @@
{
"cell_type": "code",
"execution_count": 89,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"lc_new = lc.to_lightkurve()"
Expand Down Expand Up @@ -2139,7 +2204,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -2153,9 +2218,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
29 changes: 10 additions & 19 deletions Multitaper/multitaper_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@
"cell_type": "code",
"execution_count": 5,
"id": "b7b5e756",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -256,9 +254,7 @@
"cell_type": "code",
"execution_count": 6,
"id": "eb8f5358",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -653,9 +649,7 @@
"cell_type": "code",
"execution_count": 12,
"id": "f305d250",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -778,9 +772,7 @@
"cell_type": "code",
"execution_count": 13,
"id": "a03504ed",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -867,9 +859,7 @@
"cell_type": "code",
"execution_count": 14,
"id": "efea10b1",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -1046,8 +1036,9 @@
"source": [
"# Loading data\n",
"import pandas as pd\n",
"\n",
"kepler_data = pd.read_csv(\"https://raw.githubusercontent.com/StingraySoftware/notebooks/tree/main/Multitaper/koi2133.csv\")\n",
"# If downloaded locally, use\n",
"# pd.read_csv(\"koi2133.csv\")\n",
"kepler_data = pd.read_csv(\"https://raw.githubusercontent.com/StingraySoftware/notebooks/main/Multitaper/koi2133.csv\")\n",
"times_kp = np.array(kepler_data[\"times\"])\n",
"flux_kp = np.array(kepler_data[\"flux\"])"
]
Expand Down Expand Up @@ -1351,7 +1342,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1365,7 +1356,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 29875e8

Please sign in to comment.