Skip to content

Commit

Permalink
Fix style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
haticekaratay committed Dec 20, 2023
1 parent d41a85a commit a06f9cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 37 deletions.
52 changes: 18 additions & 34 deletions notebooks/MIRI_IFU_YSOs_in_the_LMC/isha_nayak_ysos_in_the_lmc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,21 @@
"\n",
"from astropy import units as u\n",
"from astropy.wcs import WCS\n",
"from astropy import constants as const\n",
"from astropy.io import ascii, fits\n",
"from astropy.io import ascii\n",
"from astropy.nddata import StdDevUncertainty\n",
"from astropy.modeling import models\n",
"from astropy.table import Table, Column, vstack\n",
"from astropy.table import Table\n",
"from astropy.stats import sigma_clipped_stats\n",
"from astropy.utils.data import download_file\n",
"import urllib.request\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"from scipy.optimize import curve_fit\n",
"from spectral_cube import SpectralCube\n",
"from photutils.detection import DAOStarFinder\n",
"from photutils.aperture import CircularAperture\n",
"\n",
"from specutils import Spectrum1D, SpectralRegion\n",
"from specutils.analysis import snr, line_flux, centroid, equivalent_width\n",
"from specutils.fitting import fit_generic_continuum, fit_continuum, find_lines_threshold, find_lines_derivative, estimate_line_parameters, fit_lines\n",
"from specutils.manipulation import noise_region_uncertainty, box_smooth, extract_region, gaussian_smooth, SplineInterpolatedResampler"
"from specutils.analysis import snr\n",
"from specutils.fitting import fit_generic_continuum, find_lines_derivative\n",
"from specutils.manipulation import box_smooth, extract_region"
]
},
{
Expand Down Expand Up @@ -98,43 +92,34 @@
"from aplpy import __version__ as aplpy_version\n",
"print(\"Aplpy: {}\".format(aplpy_version))\n",
"\n",
"import astrodendro\n",
"from astrodendro import __version__ as astrodendro_version\n",
"print(\"Astrodendro: {}\".format(astrodendro_version))\n",
"\n",
"import astropy\n",
"from astropy import __version__ as astropy_version\n",
"print(\"Astropy: {}\".format(astropy_version))\n",
"\n",
"import jwst\n",
"from jwst import __version__ as jwst_version\n",
"print(\"JWST: {}\".format(jwst_version))\n",
"\n",
"import matplotlib\n",
"from matplotlib import __version__ as matplotlib_version\n",
"print(\"Matplotlib: {}\".format(matplotlib_version))\n",
"\n",
"import numpy\n",
"from numpy import __version__ as numpy_version\n",
"print(\"Numpy: {}\".format(numpy_version))\n",
"\n",
"import pandas\n",
"from pandas import __version__ as pandas_version\n",
"print(\"Pandas: {}\".format(pandas_version))\n",
"\n",
"import photutils\n",
"from photutils import __version__ as photutils_version\n",
"print(\"Photutils: {}\".format(photutils_version))\n",
"\n",
"import scipy\n",
"from scipy import __version__ as scipy_version\n",
"print(\"Scipy: {}\".format(scipy_version))\n",
"\n",
"import specutils\n",
"from specutils import __version__ as specutils_version\n",
"print(\"Specutils: {}\".format(specutils_version))\n",
"\n",
"import spectral_cube\n",
"from spectral_cube import __version__ as spectral_cube_version\n",
"print(\"SpectralCube: {}\".format(spectral_cube_version))"
]
Expand Down Expand Up @@ -176,13 +161,13 @@
"outputs": [],
"source": [
"params = {'legend.fontsize': '18',\n",
" 'axes.labelsize': '18',\n",
" 'axes.titlesize': '18',\n",
" 'xtick.labelsize': '18',\n",
" 'ytick.labelsize': '18',\n",
" 'lines.linewidth': 2,\n",
" 'axes.linewidth': 2,\n",
" 'animation.html': 'html5'}\n",
" 'axes.labelsize': '18',\n",
" 'axes.titlesize': '18',\n",
" 'xtick.labelsize': '18',\n",
" 'ytick.labelsize': '18',\n",
" 'lines.linewidth': 2,\n",
" 'axes.linewidth': 2,\n",
" 'animation.html': 'html5'}\n",
"plt.rcParams.update(params)\n",
"plt.rcParams.update({'figure.max_open_warning': 0})"
]
Expand Down Expand Up @@ -1091,22 +1076,21 @@
" if drop_dups_ice and not drop_dups_sil:\n",
" for i in range(0, count_ice):\n",
" if ice_absorption_detected[i].value < 15.4 and ice_absorption_detected[i].value > 15.0:\n",
" print(\"This is a Class 1 YSO.\")\n",
" print(\"This is a Class 1 YSO.\")\n",
" \n",
" # Else find out if YSO 2 (more evolved YSO with other ice absoprtion and silicate absorption features)\n",
" if drop_dups_sil:\n",
" print(\"This is a Class 2 YSO.\") \n",
" elif count_pah == 0 and drop_dups_ice:\n",
" for i in range(0, count_ice):\n",
" if ((ice_absorption_detected[i].value < 4.87 and ice_absorption_detected[i].value > 4.47)\n",
" or (ice_absorption_detected[i].value < 5.8 and ice_absorption_detected[i].value > 6.2)\n",
" or (ice_absorption_detected[i].value < 6.69 and ice_absorption_detected[i].value > 7.09)\n",
" or (ice_absorption_detected[i].value < 7.5 and ice_absorption_detected[i].value > 7.7)):\n",
" print(\"This is a Class 2 YSO.\")\n",
" or (ice_absorption_detected[i].value < 5.8 and ice_absorption_detected[i].value > 6.2)\n",
" or (ice_absorption_detected[i].value < 6.69 and ice_absorption_detected[i].value > 7.09)\n",
" or (ice_absorption_detected[i].value < 7.5 and ice_absorption_detected[i].value > 7.7)):\n",
" print(\"This is a Class 2 YSO.\")\n",
" \n",
" # Else if PAH emission features then YSO 3\n",
" if ((count_pah > 0 and not drop_dups_ice)\n",
" or (count_pah > 0 and drop_dups_sil)):\n",
" if (count_pah > 0 and not drop_dups_ice) or (count_pah > 0 and drop_dups_sil):\n",
" print(\"This is a Class 3 YSO.\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
"from astropy.nddata import StdDevUncertainty\n",
"from astropy.utils.data import download_file\n",
"\n",
"# To find stars in the MRS spectralcubes and do aperture photometry\n",
"from photutils.detection import DAOStarFinder\n",
"\n",
"# To deal with 1D spectrum\n",
"from specutils import Spectrum1D\n",
"from specutils.manipulation import box_smooth, extract_region\n",
Expand Down

0 comments on commit a06f9cb

Please sign in to comment.