Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix directory inside of SDSS Montage Chart to use user folder instead of static folder #13

Merged
merged 5 commits into from
Jun 1, 2024
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
19 changes: 14 additions & 5 deletions Astronomy/sdss_mosaics/SDSS_today.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"\n",
"## Setup\n",
"\n",
"The Montage Python package is a mixture of pure Python and Python binary extension code. It can be downloaded using <tt style=\"color: #c00000;\">pip install MontagePy</tt>. This notebook also assumes that Astropy and Astroquery have been installed.\n"
"The Montage Python package is a mixture of pure Python and Python binary extension code. It can be downloaded using <tt style=\"color: #c00000;\">pip install MontagePy</tt>. This notebook also assumes that Astropy and Astroquery have been installed.\n",
"\n",
"If the <tt style=\"color: #c00000;\">pip install</tt> don't resolve, please note that this notebook needs to be run inside of your `/Storage/` folder. \n"
]
},
{
Expand Down Expand Up @@ -57,7 +59,8 @@
}
],
"source": [
"!conda install astroquery"
"%pip install astroquery\n",
"%pip install MontagePy"
]
},
{
Expand All @@ -84,6 +87,9 @@
"import warnings\n",
"import sdss_archive\n",
"import datetime\n",
"import SciServer\n",
"\n",
"from SciServer import Authentication\n",
"\n",
"from astropy.io import ascii\n",
"\n",
Expand All @@ -105,7 +111,9 @@
"band = \"g\"\n",
"workdir = \"M51g\"\n",
"\n",
"workdir = \"/home/idies/workspace/Temporary/raddick/montage_temp/\" + workdir + '/'"
"# Use user storage\n",
"myUserName = Authentication.getKeystoneUserWithToken(Authentication.getToken()).userName\n",
"workdir = \"/home/idies/workspace/Temporary/\" + myUserName + \"/scratch/montage_temp/\" + workdir + \"/\""
]
},
{
Expand Down Expand Up @@ -145,8 +153,9 @@
"print(\"Work directory: \" + workdir, flush=True)\n",
"\n",
"try:\n",
" os.makedirs(workdir) \n",
"except:\n",
" os.makedirs(workdir, exist_ok=True) \n",
"except OSError as e :\n",
" print(\"Failed to created folder at \" + workdir)\n",
" pass\n",
" \n",
"os.chdir(workdir)\n",
Expand Down