Skip to content

Commit

Permalink
Update wfc3_exception_report.ipynb for PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
bjkuhn authored Nov 8, 2023
1 parent b7545cc commit 15e3223
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions notebooks/WFC3/exception_report/wfc3_exception_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"for obsid in exp_ids: \n",
" # make new directory to hold fits files - named by exposure id\n",
" try:\n",
" newdir = os.getcwd()+'/'+ obsid.lower()+'/'\n",
" newdir = os.getcwd()+'/' + obsid.lower()+'/'\n",
" mkdir = os.mkdir(newdir)\n",
" print(f'Making new directory {newdir}')\n",
" except FileExistsError: \n",
Expand All @@ -224,9 +224,9 @@
" except (OSError, FileNotFoundError): \n",
" pass\n",
" \n",
" print(f'Remvoing mastDownload/HST/') \n",
" os.rmdir(f'mastDownload/HST/')\n",
" print(f'Remvoing mastDownload/')\n",
" print('Remvoing mastDownload/HST/') \n",
" os.rmdir('mastDownload/HST/')\n",
" print('Remvoing mastDownload/')\n",
" os.rmdir('mastDownload/')"
]
},
Expand Down Expand Up @@ -352,7 +352,7 @@
"numexts = fits.getheader(jif_file, 0)['NEXTEND'] # number of extensions i.e. exposures\n",
"\n",
"keywords = ['EXPNAME*', 'GUIDEACT*', 'GSACQ*', 'ACTGSSEP*',\n",
" 'GSSEPRMS*',' NLOSSES*', 'CRVAL1*', 'CRVAL2*',\n",
" 'GSSEPRMS*', ' NLOSSES*', 'CRVAL1*', 'CRVAL2*',\n",
" 'V2_RMS*', 'V3_RMS*', 'GSFAIL*']\n",
"\n",
"for ext in range(1, numexts+1):\n",
Expand Down Expand Up @@ -422,7 +422,6 @@
" plt.scatter(jit_tbl['Seconds'], jit_tbl['SI_V2_RMS'], 10, alpha=.5, marker='s', label='V2_RMS')\n",
" plt.scatter(jit_tbl['Seconds'], jit_tbl['SI_V3_RMS'], 10, alpha=.5, marker='s', label='V3_RMS')\n",
" \n",
" \n",
" plt.xlabel('Exposure Time [Seconds]', size=13)\n",
" plt.ylabel('Coordinate Axis [Arcsec]', size=13)\n",
" plt.title(f\"Jitter File Ext Number: {ext}\\n Corresponding FLT: {flt_file[0].split('/')[-1]}\", size=14)\n",
Expand Down Expand Up @@ -544,9 +543,9 @@
"sources = daofind(data - median) \n",
"\n",
"# Truncate list to show just a few sources \n",
"sources = sources[(sources['flux'] > 10) &\\\n",
" (sources['xcentroid'] > 10) & (sources['xcentroid'] < 90) &\\\n",
" (sources['ycentroid'] > 18) & (sources['ycentroid'] < 90) ]\n",
"sources = sources[(sources['flux'] > 10) &\n",
" (sources['xcentroid'] > 10) & (sources['xcentroid'] < 90) &\n",
" (sources['ycentroid'] > 18) & (sources['ycentroid'] < 90)]\n",
"\n",
"# Create circular apertures to plot\n",
"positions = np.transpose((sources['xcentroid'], sources['ycentroid']))\n",
Expand Down Expand Up @@ -601,7 +600,7 @@
" y2 = int(round(my_prof.y+7))\n",
" \n",
" # Plot star stamp \n",
" im1 = ax1.imshow(data[y1:y2, x1:x2]-z1+.01, origin='lower', cmap='Greys', extent=[x1, x2, y1, y2], norm=LogNorm(vmin=.01, vmax=z2*100.-z1) )\n",
" im1 = ax1.imshow(data[y1:y2, x1:x2]-z1+.01, origin='lower', cmap='Greys', extent=[x1, x2, y1, y2], norm=LogNorm(vmin=.01, vmax=z2*100.-z1))\n",
"\n",
" ax1.set_title(f\"x = {my_prof.x:.3f}, y = {my_prof.y:.3f}\", size=13)\n",
" ax2.set_title(header['filter'], size=13)\n",
Expand Down

0 comments on commit 15e3223

Please sign in to comment.