From 344326ae2f29fbc558e49aae175a856164bc99b9 Mon Sep 17 00:00:00 2001 From: Hatice Karatay Date: Tue, 10 Oct 2023 11:52:12 -0400 Subject: [PATCH] Address style errors --- .../MOSspec_advanced.ipynb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/notebooks/mos_spectroscopy_advanced/MOSspec_advanced.ipynb b/notebooks/mos_spectroscopy_advanced/MOSspec_advanced.ipynb index db8572c33..722227439 100644 --- a/notebooks/mos_spectroscopy_advanced/MOSspec_advanced.ipynb +++ b/notebooks/mos_spectroscopy_advanced/MOSspec_advanced.ipynb @@ -85,7 +85,7 @@ "\n", "# jdaviz\n", "import jdaviz\n", - "from jdaviz import Mosviz, Specviz2d, Specviz\n", + "from jdaviz import Mosviz, Specviz2d, Specviz # noqa\n", "\n", "# glue\n", "from glue.core.roi import XRangeROI\n", @@ -181,7 +181,7 @@ "metadata": {}, "outputs": [], "source": [ - "#pathtodata = Path('/home/shared/preloaded-fits/jdaviz_data/mos_ceers_data')\n", + "# pathtodata = Path('/home/shared/preloaded-fits/jdaviz_data/mos_ceers_data')\n", "pathtodata = Path('./data')" ] }, @@ -287,8 +287,8 @@ "source": [ "# Include some fake uncertainty for now\n", "spec1d = Spectrum1D(spectral_axis=spectra.spectral_axis,\n", - " flux=spectra.flux,\n", - " uncertainty=StdDevUncertainty((np.zeros(len(spectra.flux)) + 1E-13) * spectra.unit))\n", + " flux=spectra.flux,\n", + " uncertainty=StdDevUncertainty((np.zeros(len(spectra.flux)) + 1E-13) * spectra.unit))\n", "spec1d" ] }, @@ -327,7 +327,7 @@ " region1_exists = False\n", " \n", "# Spectral region for masking artifacts\n", - "if region1_exists==False:\n", + "if not region1_exists:\n", " sv = specviz.app.get_viewer('spectrum-viewer')\n", " sv.toolbar_active_subset.selected = []\n", " sv.apply_roi(XRangeROI(1., 1.58)) " @@ -760,7 +760,7 @@ "plt.scatter(spec1d_sub.spectral_axis, spec1d_sub.flux, label=None)\n", "plt.axvline(lines['line_center'][0].value, color=\"red\", alpha=0.5, label='[OII]')\n", "for line in lines:\n", - " if(line['line_type'] == 'emission'):\n", + " if line['line_type'] == 'emission':\n", " plt.axvline(line['line_center'].value, alpha=0.5, color='red')\n", "plt.xlim(x_min, x_max)\n", "plt.xlabel(\"wavelength ({:latex})\".format(spec1d_sub.spectral_axis.unit))\n", @@ -958,8 +958,8 @@ "# The new_flux_unit function does not change the uncertainty and specviz complains that there is a mismatch\n", "# so we re-add the uncertainty like we did a few cells above\n", "spec1d_masked_flamb_unc = Spectrum1D(spectral_axis=spec1d_masked_flamb.spectral_axis,\n", - " flux=spec1d_masked_flamb.flux,\n", - " uncertainty=StdDevUncertainty((np.zeros(len(spec1d_masked_flamb.flux)) + 1E-20) * spec1d_masked_flamb.unit))" + " flux=spec1d_masked_flamb.flux,\n", + " uncertainty=StdDevUncertainty((np.zeros(len(spec1d_masked_flamb.flux)) + 1E-20) * spec1d_masked_flamb.unit))" ] }, { @@ -1069,7 +1069,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.9.13" } }, "nbformat": 4,