Skip to content

Commit

Permalink
WIP on #8 and #17
Browse files Browse the repository at this point in the history
  • Loading branch information
KCollins committed Sep 17, 2024
1 parent 000c2ec commit 1c2b6f1
Showing 1 changed file with 46 additions and 32 deletions.
78 changes: 46 additions & 32 deletions notebooks/MWE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "ec3504cd-321d-44f1-9f16-d734bb36803f",
"metadata": {},
"outputs": [],
"source": [

"from conjugate_map.conjCalcFunctions import *"
"import datetime as dt\n",
"import pandas as pd\n",
"import conjugate_map.conjCalcFunctions as conj"
]
},
{
Expand All @@ -29,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "f317508d-cb3b-4460-a34e-2cc68db06b36",
"metadata": {},
"outputs": [
Expand All @@ -56,11 +57,11 @@
"lat, lon = [-64, -64]\n",
"\n",
"print(\"Geopack: \")\n",
"print(findconj(lat, lon, ut, method=\"geopack\"))\n",
"print(conj.findconj(lat, lon, ut, method=\"geopack\"))\n",
"print(\"AACGM: \")\n",
"print(findconj(lat, lon, ut, method=\"aacgm\"))\n",
"print(conj.findconj(lat, lon, ut, method=\"aacgm\"))\n",
"print(\"\\nAutomatic: \")\n",
"print(findconj(lat, lon, ut, method=\"auto\", is_verbose = True))\n"
"print(conj.findconj(lat, lon, ut, method=\"auto\", is_verbose = True))\n"
]
},
{
Expand All @@ -75,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"id": "d8dcceae-625c-4dc3-ac19-65b0421bf6fe",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -142,7 +143,7 @@
"3 SSI 40.019511 -105.240014"
]
},
"execution_count": 4,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -167,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 8,
"id": "c9a95d25-9fc2-4956-9ce7-16c446b8d377",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -207,17 +208,17 @@
" <td>-77.846323</td>\n",
" <td>166.668235</td>\n",
" <td>S</td>\n",
" <td>72.902533</td>\n",
" <td>-97.196088</td>\n",
" <td>72.903812</td>\n",
" <td>-97.197534</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>SPA</td>\n",
" <td>-90.000000</td>\n",
" <td>0.000000</td>\n",
" <td>S</td>\n",
" <td>68.063988</td>\n",
" <td>-66.259047</td>\n",
" <td>68.065575</td>\n",
" <td>-66.258363</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
Expand All @@ -243,19 +244,19 @@
],
"text/plain": [
" Name lat lon Hemisphere PLAT PLON\n",
"0 McMurdo -77.846323 166.668235 S 72.902533 -97.196088\n",
"1 SPA -90.000000 0.000000 S 68.063988 -66.259047\n",
"0 McMurdo -77.846323 166.668235 S 72.903812 -97.197534\n",
"1 SPA -90.000000 0.000000 S 68.065575 -66.258363\n",
"2 PGC 44.984308 -93.182207 N 44.984308 -93.182207\n",
"3 SSI 40.019511 -105.240014 N 40.019511 -105.240014"
]
},
"execution_count": 5,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"conjcalc(df, latname = 'lat', lonname = 'lon')"
"conj.conjcalc(df, latname = 'lat', lonname = 'lon')"
]
},
{
Expand All @@ -268,7 +269,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 11,
"id": "b0813286-2a83-4262-9a68-7cda035760cd",
"metadata": {},
"outputs": [
Expand All @@ -278,32 +279,45 @@
"text": [
"Help on function conjcalc in module conjugate_map.conjCalcFunctions:\n",
"\n",
"conjcalc(gdf, latname='GLAT', lonname='GLON', dtime=datetime.datetime(2024, 9, 12, 3, 39, 58, 429414), is_verbose=False, method='aacgm', mode='S2N', is_saved=False, directory='output/', name='stations')\n",
" Calculate the geographic latitudes and longitudes of conjugate points for all points in a dataframe. Calls findconj().\n",
"conjcalc(gdf, latname='GLAT', lonname='GLON', dtime=datetime.datetime(2024, 9, 17, 19, 48, 17, 133527, tzinfo=datetime.timezone.utc), is_verbose=False, method='aacgm', mode='S2N', is_saved=False, directory='output/', name='stations')\n",
" Calculate the geographic latitudes and longitudes of conjugate points for\n",
" all points in a dataframe. Calls findconj().\n",
" \n",
" Arguments:\n",
" gdf : dataframe of points whose conjugate points we're finding\n",
" latname : name of column containing latitude coordinates\n",
" lonname : name of column containing longitude coordinates\n",
" dtime : datetime used in conversion\n",
" is_verbose : if set to True/1, prints debugging text\n",
" method : method used in conversion, passed to findconj(). Options are 'geopack', which uses IGRF + T89 to run field line traces, or 'aacgm'.\n",
" mode : \n",
" 'S2N' : Return station coordinates for northern hemisphere, conjugate for southern. Map appears over the Arctic. Default.\n",
" 'N2S' : Return station coordinates for southern hemisphere, conjugate for northern. Map appears over the Antarctic.\n",
" 'flip' : Return conjugate coordinates for all points regardless of hemisphere.\n",
" is_saved : Boolean dictating whether the final .csv is saved to the output directory.\n",
" directory : Name of local directory to which .csv is saved; 'output/' by default.\n",
" name : First part of saved filename. 'stations' by default. \n",
" \n",
" method : method used in conversion, passed to findconj().\n",
" Options are 'geopack', which uses IGRF + T89 to run\n",
" field line traces, or 'aacgm'.\n",
" mode :\n",
" 'S2N' : Return station coordinates for\n",
" northern hemisphere, conjugate\n",
" for southern. Map appears over\n",
" the Arctic. Default.\n",
" 'N2S' : Return station coordinates for\n",
" southern hemisphere, conjugate\n",
" for northern. Map appears over\n",
" the Antarctic.\n",
" 'flip' : Return conjugate coordinates for\n",
" points regardless of hemisphere.\n",
" is_saved : Boolean dictating whether the final .csv is saved to\n",
" the output directory.\n",
" directory : Name of local directory to which .csv is saved;\n",
" 'output/' by default.\n",
" name : First part of saved filename. 'stations' by default.\n",
" \n",
" Returns:\n",
" gdf : dataframe with PLAT, PLON columns added indicating which points to plot\n",
" gdf : dataframe with PLAT, PLON columns added indicating which\n",
" points to plot\n",
"\n"
]
}
],
"source": [
"help(conjcalc)"
"help(conj.conjcalc)"
]
}
],
Expand Down

0 comments on commit 1c2b6f1

Please sign in to comment.