From 0cdf5bd1825d2716f61d86fa48a0d982e0b78e37 Mon Sep 17 00:00:00 2001 From: Hatice Karatay Date: Tue, 17 Oct 2023 15:41:29 -0400 Subject: [PATCH] Address more style errors --- .../00_Optimal_extraction.ipynb | 139 ++++++++---------- .../01_Combine_and_normalize_1D_spectra.ipynb | 19 +-- 2 files changed, 70 insertions(+), 88 deletions(-) diff --git a/notebooks/NIRISS_WFSS_postpipeline/00_Optimal_extraction.ipynb b/notebooks/NIRISS_WFSS_postpipeline/00_Optimal_extraction.ipynb index 54952a06c..14e6093e1 100755 --- a/notebooks/NIRISS_WFSS_postpipeline/00_Optimal_extraction.ipynb +++ b/notebooks/NIRISS_WFSS_postpipeline/00_Optimal_extraction.ipynb @@ -111,7 +111,7 @@ " boxfile = './pipeline_products.zip'\n", " urllib.request.urlretrieve(boxlink, boxfile)\n", " zf = zipfile.ZipFile(boxfile, 'r')\n", - " zf.extractall()\n" + " zf.extractall()" ] }, { @@ -132,11 +132,13 @@ "\n", "# Image array from direct image. This is for optimal extraction and masking.\n", "# This image should already be sky-subtracted; otherwise, you will encounter a wrong result with optimal extraction.\n", - "infile= '{}13_nis_{}_i2d_skysub.fits'.format(DIR_DATA, filt_det)\n", + "# fixed\n", + "infile = f'{DIR_DATA}l3_nis_{filt_det}_i2d_skysub.fits'\n", "hdu = fits.open(infile)\n", "\n", "# This is just for error array;\n", - "infile = '{}l3_nis_{}_i2d.fits'.format(DIR_DATA, filt_det)\n", + "# fixed\n", + "infile = f'{DIR_DATA}l3_nis_{filt_det}_i2d.fits'\n", "hdu_err = fits.open(infile)\n", "\n", "data = hdu[0].data\n", @@ -147,7 +149,7 @@ "\n", "# Segmentation map;\n", "# This can be prepared by running Photutils, if the pipeline does not generate one.\n", - "segfile = '{}l3_nis_{}_i2d_seg.fits'.format(DIR_DATA, filt_det)\n", + "segfile = f'{DIR_DATA}l3_nis_{filt_det}_i2d_seg.fits'\n", "seghdu = fits.open(segfile)\n", "segdata = seghdu[0].data" ] @@ -160,7 +162,7 @@ "source": [ "# Load catalog from image level3;\n", "# to obtain source position in pixel coordinate.\n", - "catfile = '{}l3_nis_{}_cat.ecsv'.format(DIR_DATA, filt_det)\n", + "catfile = f'{DIR_DATA}l3_nis_{filt_det}_cat.ecsv'\n", "fd = ascii.read(catfile)" ] }, @@ -196,15 +198,15 @@ "magzp = 25.0 # magnitude zeropoint in the catalog.\n", "\n", "# Read catalog;\n", - "fd_input = ascii.read('{}sources_extend_01.cat'.format(DIR_DATA))\n", + "fd_input = ascii.read(f'{DIR_DATA}sources_extend_01.cat')\n", "ra_input = fd_input['x_or_RA']\n", "dec_input = fd_input['y_or_Dec']\n", "\n", "# Header;\n", - "fw = open('{}l3_nis_flux.cat'.format(DIR_OUT), 'w')\n", + "fw = open(f'{DIR_OUT}l3_nis_flux.cat', 'w')\n", "fw.write('# id')\n", "for ff in range(len(filts)):\n", - " fw.write(' F{} E{}'.format(eazy_filts[ff], eazy_filts[ff]))\n", + " fw.write(f' F{eazy_filts[ff]} E{eazy_filts[ff]}')\n", "fw.write('\\n')\n", "\n", "# Contents;\n", @@ -215,17 +217,17 @@ " \n", " for ff in range(len(filts)):\n", " if ff == 0:\n", - " fw.write('{}'.format(fd['id'][ii]))\n", + " fw.write(f\"{fd['id'][ii]}\")\n", "\n", - " mag = fd_input['niriss_{}_magnitude'.format(filts[ff])][iix]\n", + " mag = fd_input[f'niriss_{filts[ff]}_magnitude'][iix]\n", " flux_nu = 10**((mag-magzp)/(-2.5))\n", "\n", " # Currently, the catalog does not provide proper error;\n", - " # Assuming 5% error for flux.\n", + " # Assuming a 5% error for flux.\n", " \n", " flux_err_nu = flux_nu * 0.05\n", "\n", - " fw.write(f' {flux_nu:.5e} {flux_err_nu:.5e}')\n", + " fw.write(f' {flux_nu:.5e} {flux_err_nu:.5e}') \n", "\n", " fw.write('\\n')\n", "fw.close()" @@ -256,8 +258,9 @@ "\n", "# Zero-indexed number for dither --- the test data here has two dither positions, so 0 or 1.\n", "ndither = 0\n", - "\n", - "file_2d = '{}l3_nis_{}_{}_{}s_cal.fits'.format(DIR_DATA, filt, grism, id)\n", + "print(DIR_DATA)\n", + "# fixed\n", + "file_2d = f'{DIR_DATA}l3_nis_{filt}_{grism}_s{id}_cal.fits'\n", "hdu_2d = fits.open(file_2d)\n", "\n", "# Align grism direction\n", @@ -447,10 +450,10 @@ " # 1. DQ array\n", " # 2. error value\n", " # 3. CR detection\n", - " mask_tmp = (dq_2d[:,ii] == 0) & (err_2d[:,ii]>0) & ( (data_2d[:,ii] - flux_y[:] * flux_disp1[ii])**2 < sig**2 * err_2d[:,ii]**2)\n", - " ivar = 1. / err_2d[:,ii]**2\n", + " mask_tmp = (dq_2d[:, ii] == 0) & (err_2d[:, ii]>0) & ( (data_2d[:, ii] - flux_y[:] * flux_disp1[ii])**2 < sig**2 * err_2d[:, ii]**2)\n", + " ivar = 1. / err_2d[:, ii]**2\n", "\n", - " num = flux_y[:] * data_2d[:,ii] * ivar\n", + " num = flux_y[:] * data_2d[:, ii] * ivar\n", " den = flux_y[:]**2 * ivar\n", " flux_disp[ii] = num[mask_tmp].sum(axis=0) / den[mask_tmp].sum(axis=0)\n", " err_disp[ii] = np.sqrt(1./den[mask_tmp].sum(axis=0))\n", @@ -487,7 +490,7 @@ "metadata": {}, "outputs": [], "source": [ - "file_1d = '%sl3_nis_%s_%s_s%s_1d_opt.fits'%(DIR_OUT, filt, grism, id)\n", + "file_1d = f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_1d_opt.fits'\n", "\n", "# Now make it into a Spectrum1D instance.\n", "obs = Spectrum1D(spectral_axis=wave_disp*u.um,\n", @@ -511,8 +514,8 @@ "outputs": [], "source": [ "for ii in range(sci_rot.shape[0]):\n", - " flux_tmp = sci_rot[ii,:]\n", - " xx_tmp = np.arange(0, len(sci_rot[ii,:]), 1)\n", + " flux_tmp = sci_rot[ii, :]\n", + " xx_tmp = np.arange(0, len(sci_rot[ii, :]), 1)\n", " plt.plot(xx_tmp, flux_tmp, label='y=%d'%(ii))\n", " \n", "plt.legend(loc=1, fontsize=8)\n", @@ -534,9 +537,9 @@ "outputs": [], "source": [ "# Sum along cross-disperse direction\n", - "flux_x = np.zeros(len(sci_rot[0,:]), 'float')\n", + "flux_x = np.zeros(len(sci_rot[0, :]), 'float')\n", "for ii in range(sci_rot.shape[0]):\n", - " flux_x[ii] = np.sum(sci_rot[:,ii])\n", + " flux_x[ii] = np.sum(sci_rot[:, ii])\n", "\n", "# Normalize;\n", "flux_x[:] /= flux_x.sum()\n", @@ -580,7 +583,7 @@ " lsf : light profile. \n", " '''\n", " \n", - " #for ii in range(len(sci[0,:])):\n", + " #for ii in range(len(sci[0, :])):\n", " # lsf[ii] = np.mean(sci_rot[int(height/2.-5):int(height/2.+5), ii])\n", " # xsf[ii] = ii - len(lsf)/2.\n", "\n", @@ -624,7 +627,7 @@ "source": [ "# Write it down;\n", "# Tha parameters are in unit of pixel.\n", - "fm = open('%sl3_nis_%s_%s_s%s_moffat.txt'%(DIR_OUT, filt, grism, id), 'w')\n", + "fm = open(f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_moffat.txt', 'w')\n", "fm.write('# A x0 gamma alp\\n')\n", "fm.write('# Moffat function\\n')\n", "fm.write('%.3f %.3f %.3f %.3f\\n'%(A, xm, gamma, alpha))\n", @@ -663,7 +666,7 @@ " print(filt)\n", " \n", " # 2d spectrum;\n", - " file_2d = '%sl3_nis_%s_%s_s%s_cal.fits'%(DIR_DATA, filt, grism, id)\n", + " file_2d = f'{DIR_DATA}l3_nis_{filt}_{grism}_s{id}_cal.fits'\n", " hdu_2d = fits.open(file_2d)\n", "\n", " for ndither in ndithers:\n", @@ -681,7 +684,7 @@ " err_2d = rotate(hdu_2d[ndither*7+3].data, 90)\n", " wave_2d = rotate(hdu_2d[ndither*7+4].data, 90)\n", "\n", - " y2d,x2d = data_2d.shape[:]\n", + " y2d, x2d = data_2d.shape[:]\n", "\n", " plt.close()\n", " plt.imshow(data_2d, vmin=0, vmax=300)\n", @@ -699,19 +702,16 @@ " else:\n", " sci_rot = rotate(sci_cut, PA_V3+0+90)\n", "\n", - "\n", - " #\n", " # This is for spectral resolution;\n", - " #\n", " # Get light profile along the x-axis\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_tmp = sci_rot[ii,:]\n", - " xx_tmp = np.arange(0, len(sci_rot[ii,:]), 1)\n", + " flux_tmp = sci_rot[ii, :]\n", + " xx_tmp = np.arange(0, len(sci_rot[ii, :]), 1)\n", "\n", " # Sum along cross-disperse direction\n", - " flux_x = np.zeros(len(sci_rot[0,:]), 'float')\n", + " flux_x = np.zeros(len(sci_rot[0, :]), 'float')\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_x[ii] = np.sum(sci_rot[ii,:])\n", + " flux_x[ii] = np.sum(sci_rot[ii, :])\n", "\n", " # Normalize;\n", " flux_x[:] /= flux_x.sum()\n", @@ -723,24 +723,21 @@ "\n", " if ndither == 0:\n", " # Write it down;\n", - " fm = open('%sl3_nis_%s_%s_s%s_moffat.txt'%(DIR_OUT, filt, grism, id), 'w')\n", + " fm = open(f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_moffat.txt', 'w')\n", " fm.write('# A x0 gamma alp\\n')\n", " fm.write('# Moffat function\\n')\n", " fm.write('%.3f %.3f %.3f %.3f\\n'%(A, xm, gamma, alpha))\n", " fm.close()\n", "\n", - " #\n", " # This is for Optimal extraction;\n", - " #\n", " # Sum along x (disperse) direction\n", " flux_y = np.zeros(len(sci_rot[:,0]), 'float')\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_y[ii] = np.sum(sci_rot[ii,:])\n", + " flux_y[ii] = np.sum(sci_rot[ii, :])\n", " \n", " # Normalize;\n", " flux_y[:] /= flux_y.sum()\n", "\n", - "\n", " # Following Horne;\n", " flux_disp = np.zeros(x2d, 'float')\n", " err_disp = np.zeros(x2d, 'float')\n", @@ -751,16 +748,15 @@ " # 1. DQ array\n", " # 2. error value\n", " # 3. CR detection\n", - " mask_tmp = (dq_2d[:,ii] == 0) & (err_2d[:,ii] > 0)\n", - " ivar = 1. / err_2d[:,ii]**2\n", + " mask_tmp = (dq_2d[:, ii] == 0) & (err_2d[:, ii] > 0)\n", + " ivar = 1. / err_2d[:, ii]**2\n", "\n", - " num = flux_y[:] * data_2d[:,ii] * ivar \n", + " num = flux_y[:] * data_2d[:, ii] * ivar \n", " den = flux_y[:]**2 * ivar\n", " flux_disp[ii] = num[mask_tmp].sum(axis=0)/den[mask_tmp].sum(axis=0)\n", " err_disp[ii] = np.sqrt(1./den[mask_tmp].sum(axis=0))\n", " wave_disp[ii] = wave_2d[0,ii]\n", "\n", - "\n", " plt.close()\n", " con_plot = (wave_disp>0)\n", " plt.errorbar(wave_disp[con_plot], flux_disp[con_plot], yerr=err_disp[con_plot])\n", @@ -769,7 +765,7 @@ "\n", " # Wirte:\n", " # Now make it into a Spectrum1D instance.\n", - " file_1d = '%sl3_nis_%s_%s_s%s_ndither%d_1d_opt.fits'%(DIR_OUT, filt, grism, id, ndither)\n", + " file_1d = f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_ndither{ndither}_1d_opt.fits'\n", "\n", " if wave_disp[1] - wave_disp[0] < 0:\n", " obs = Spectrum1D(spectral_axis=wave_disp[::-1]*u.um,\n", @@ -780,9 +776,7 @@ " flux=flux_disp*u.MJy,\n", " uncertainty=StdDevUncertainty(err_disp), unit='MJy')\n", " \n", - " obs.write(file_1d, format='tabular-fits', overwrite=True)\n", - " \n", - " " + " obs.write(file_1d, format='tabular-fits', overwrite=True)" ] }, { @@ -813,7 +807,7 @@ "for filt in filts:\n", " print(filt)\n", " # 2d spectrum;\n", - " file_2d = '%sl3_nis_%s_%s_s%s_cal.fits'%(DIR_DATA, filt, grism, id)\n", + " file_2d = f'{DIR_DATA}l3_nis_{filt}_{grism}_s{id}_cal.fits'\n", " hdu_2d = fits.open(file_2d)\n", "\n", " for ndither in ndithers:\n", @@ -821,45 +815,43 @@ " if grism == 'G150C':\n", " # If spectrum is horizontal;\n", " data_2d = hdu_2d[ndither*7+1].data\n", - " dq_2d = hdu_2d[ndither*7+2].data\n", - " err_2d = hdu_2d[ndither*7+3].data\n", + " dq_2d = hdu_2d[ndither*7+2].data\n", + " err_2d = hdu_2d[ndither*7+3].data\n", " wave_2d = hdu_2d[ndither*7+4].data\n", " else:\n", " data_2d = rotate(hdu_2d[ndither*7+1].data, 90)\n", - " dq_2d = rotate(hdu_2d[ndither*7+2].data, 90)\n", - " err_2d = rotate(hdu_2d[ndither*7+3].data, 90)\n", + " dq_2d = rotate(hdu_2d[ndither*7+2].data, 90)\n", + " err_2d = rotate(hdu_2d[ndither*7+3].data, 90)\n", " wave_2d = rotate(hdu_2d[ndither*7+4].data, 90)\n", "\n", - " y2d,x2d = data_2d.shape[:]\n", + " y2d, x2d = data_2d.shape[:]\n", "\n", " plt.close()\n", " plt.imshow(data_2d, vmin=0, vmax=20)\n", " plt.show()\n", "\n", " # Re-extract 2d image;\n", - " #if ndither == 0:\n", + " # if ndither == 0:\n", " rsq = y2d\n", " sci_cut = data[int(ycen-rsq/2.+0.5):int(ycen+rsq/2.+0.5), int(xcen-rsq/2.+0.5):int(xcen+rsq/2.+0.5)]\n", " seg_cut = segdata[int(ycen-rsq/2.+0.5):int(ycen+rsq/2.+0.5), int(xcen-rsq/2.+0.5):int(xcen+rsq/2.+0.5)]\n", "\n", - " # Not sure if the offset in extractioin box is bug ;\n", + " # Not sure if the offset in extraction box is bug ;\n", " if grism == 'G150C':\n", " sci_rot = rotate(sci_cut, PA_V3+0)\n", " else:\n", " sci_rot = rotate(sci_cut, PA_V3+0+90)\n", "\n", - " #\n", " # This is for spectral resolution;\n", - " #\n", " # Get light profile along the x-axis\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_tmp = sci_rot[ii,:]\n", - " xx_tmp = np.arange(0, len(sci_rot[ii,:]), 1)\n", + " flux_tmp = sci_rot[ii, :]\n", + " xx_tmp = np.arange(0, len(sci_rot[ii, :]), 1)\n", "\n", " # Sum along cross-disperse direction\n", - " flux_x = np.zeros(len(sci_rot[0,:]), 'float')\n", + " flux_x = np.zeros(len(sci_rot[0, :]), 'float')\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_x[ii] = np.sum(sci_rot[ii,:])\n", + " flux_x[ii] = np.sum(sci_rot[ii, :])\n", "\n", " # Normalize;\n", " flux_x[:] /= flux_x.sum()\n", @@ -871,29 +863,24 @@ "\n", " if ndither == 0:\n", " # Write it down;\n", - " fm = open('%sl3_nis_%s_%s_s%s_moffat.txt'%(DIR_OUT, filt, grism, id), 'w')\n", + " fm = open(f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_moffat.txt', 'w')\n", " fm.write('# A x0 gamma alp\\n')\n", " fm.write('# Moffat function\\n')\n", " fm.write('%.3f %.3f %.3f %.3f\\n'%(A, xm, gamma, alpha))\n", " fm.close()\n", "\n", - "\n", - " #\n", " # This is for Optimal extraction;\n", - " #\n", " # Sum along x (disperse) direction\n", " flux_y = np.zeros(len(sci_rot[:,0]), 'float')\n", " for ii in range(sci_rot.shape[0]):\n", - " flux_y[ii] = np.sum(sci_rot[ii,:])\n", - "\n", - " \n", + " flux_y[ii] = np.sum(sci_rot[ii, :])\n", + " \n", " # Normalize;\n", " flux_y[:] /= flux_y.sum()\n", "\n", - "\n", " # Following Horne;\n", " flux_disp = np.zeros(x2d, 'float')\n", - " err_disp = np.zeros(x2d, 'float')\n", + " err_disp = np.zeros(x2d, 'float')\n", " wave_disp = np.zeros(x2d, 'float')\n", "\n", " for ii in range(x2d):\n", @@ -901,10 +888,10 @@ " # 1. DQ array\n", " # 2. error value\n", " # 3. CR detection\n", - " mask_tmp = (dq_2d[:,ii] == 0) & (err_2d[:,ii] > 0) \n", - " ivar = 1. / err_2d[:,ii]**2\n", + " mask_tmp = (dq_2d[:, ii] == 0) & (err_2d[:, ii] > 0) \n", + " ivar = 1. / err_2d[:, ii]**2\n", "\n", - " num = flux_y[:] * data_2d[:,ii] * ivar \n", + " num = flux_y[:] * data_2d[:, ii] * ivar \n", " den = flux_y[:]**2 * ivar\n", " flux_disp[ii] = num[mask_tmp].sum(axis=0)/den[mask_tmp].sum(axis=0)\n", " err_disp[ii] = np.sqrt(1./den[mask_tmp].sum(axis=0))\n", @@ -916,9 +903,9 @@ " plt.ylim(-20, 100)\n", " plt.show()\n", "\n", - " # Wirte:\n", - " # Now make it into a Spectrum1D instance.\n", - " file_1d = '%sl3_nis_%s_%s_s%s_ndither%d_1d_opt.fits'%(DIR_OUT, filt, grism, id, ndither)\n", + " # Write:\n", + " # Now, make it into a Spectrum1D instance.\n", + " file_1d = f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_ndither{ndither}_1d_opt.fits'\n", "\n", " if wave_disp[1] - wave_disp[0] < 0:\n", " obs = Spectrum1D(spectral_axis=wave_disp[::-1]*u.um,\n", @@ -949,7 +936,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/notebooks/NIRISS_WFSS_postpipeline/01_Combine_and_normalize_1D_spectra.ipynb b/notebooks/NIRISS_WFSS_postpipeline/01_Combine_and_normalize_1D_spectra.ipynb index fe9d1eb5e..1dcf3e6df 100755 --- a/notebooks/NIRISS_WFSS_postpipeline/01_Combine_and_normalize_1D_spectra.ipynb +++ b/notebooks/NIRISS_WFSS_postpipeline/01_Combine_and_normalize_1D_spectra.ipynb @@ -197,8 +197,8 @@ " flux_combine[ii] = np.sum(flux[:, ii] * 1 / flux_err[:, ii]**2) / np.sum(1 / flux_err[:, ii]**2) \n", " flux_err_combine[ii] = np.sqrt(np.sum(flux_err[:, ii]**2)) / len(flux_err[:, ii])\n", "\n", - "plt.plot(wave, flux[0,:], color='gray', label='dither1')\n", - "plt.plot(wave, flux[1,:], color='gray', label='dither2')\n", + "plt.plot(wave, flux[0, :], color='gray', label='dither1')\n", + "plt.plot(wave, flux[1, :], color='gray', label='dither2')\n", "plt.plot(wave, flux_combine[:], color='r', label='Combined')\n", "plt.legend(loc=2)" ] @@ -286,10 +286,6 @@ "\n", " '''\n", "\n", - " lmin = np.min(lfil)\n", - " lmax = np.max(lfil)\n", - " imax = 0\n", - "\n", " fhalf = np.max(ffil)/2.0\n", " con = (ffil > fhalf)\n", " lfwhml = np.min(lfil[con])\n", @@ -411,13 +407,12 @@ "\n", " con = (wave > mask_lw[ff]) & (wave < mask_uw[ff])\n", " lcen, fnu = filconv(wave_filt, flux_filt, wave[con], flux_combine[con])\n", - " iix = np.where(id_cat[:] == int(id))\n", + " iix = np.where(id_cat[:] == int(id))\n", " Cnorm = fd_cat[f'F{eazy_filts[ff]}'][iix] / fnu\n", "\n", " # Write:\n", " file_1d = f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_combine_1d_opt.fits' \n", " \n", - "\n", " obs = Spectrum1D(spectral_axis=wave*u.um,\n", " flux=flux_combine * Cnorm * u.dimensionless_unscaled,\n", " uncertainty=StdDevUncertainty(flux_err_combine * Cnorm), unit='')\n", @@ -441,7 +436,7 @@ "filts = ['f115w', 'f150w', 'f200w']\n", "cols = ['lightblue', 'orange', 'purple']\n", "\n", - "for ff,filt in enumerate(filts):\n", + "for ff, filt in enumerate(filts):\n", " file_1d = f'{DIR_OUT}l3_nis_{filt}_{grism}_s{id}_combine_1d_opt.fits' \n", " fd = fits.open(file_1d)[1].data\n", " wave = fd['wavelength']\n", @@ -497,8 +492,8 @@ " fd = fits.open(file_1d)[1].data\n", " if dither == 0:\n", " wave = fd['wavelength']\n", - " flux = np.zeros((ndither, len(wave)),'float')\n", - " flux_err = np.zeros((ndither, len(wave)),'float')\n", + " flux = np.zeros((ndither, len(wave)), 'float')\n", + " flux_err = np.zeros((ndither, len(wave)), 'float')\n", "\n", " flux[dither, :] = fd['flux']\n", " flux_err[dither, :] = fd['uncertainty']\n", @@ -525,7 +520,7 @@ "\n", " con = (wave > mask_lw[ff]) & (wave < mask_uw[ff])\n", " lcen, fnu = filconv(wave_filt, flux_filt, wave[con], flux_combine[con])\n", - " iix = np.where(id_cat[:] == int(id))\n", + " iix = np.where(id_cat[:] == int(id))\n", " Cnorm = fd_cat[f'F{eazy_filts[ff]}'][iix] / fnu\n", " \n", " # Write:\n",