|
97 | 97 | "# Import astropy packages \n",
|
98 | 98 | "from astropy import units as u\n",
|
99 | 99 | "from astropy.io import ascii\n",
|
100 |
| - "from astropy.wcs import WCS\n", |
101 |
| - "from astropy.table import Table, vstack\n", |
102 |
| - "from astropy.stats import sigma_clipped_stats\n", |
103 | 100 | "from astropy.nddata import StdDevUncertainty\n",
|
104 |
| - "from astropy.io import fits # added by BAS on 8 April 2021\n", |
105 |
| - "from astropy.utils.data import get_pkg_data_filename\n", |
106 | 101 | "from astropy.utils.data import download_file\n",
|
107 | 102 | "\n",
|
108 | 103 | "# To find stars in the MRS spectralcubes and do aperture photometry\n",
|
109 |
| - "from photutils.aperture import CircularAperture\n", |
110 | 104 | "from photutils.detection import DAOStarFinder\n",
|
111 | 105 | "\n",
|
112 | 106 | "# To deal with 1D spectrum\n",
|
113 | 107 | "from specutils import Spectrum1D\n",
|
114 |
| - "from specutils.fitting import fit_generic_continuum\n", |
115 |
| - "from specutils.manipulation import box_smooth, extract_region, SplineInterpolatedResampler\n", |
| 108 | + "from specutils.manipulation import box_smooth, extract_region\n", |
116 | 109 | "from specutils.analysis import line_flux, centroid, equivalent_width\n",
|
117 | 110 | "from specutils.spectra import SpectralRegion\n",
|
118 | 111 | "from specutils import SpectrumList\n",
|
119 | 112 | "from jdaviz import Specviz\n",
|
120 | 113 | "from jdaviz import Cubeviz\n",
|
121 | 114 | "\n",
|
122 |
| - "# To fit a curve to the data\n", |
123 |
| - "from scipy.optimize import curve_fit\n", |
124 |
| - "\n", |
125 | 115 | "# Display the video\n",
|
126 | 116 | "from IPython.display import HTML, YouTubeVideo"
|
127 | 117 | ]
|
|
157 | 147 | " if key in dict.keys():\n",
|
158 | 148 | " print(\"Present, \", end=\" \")\n",
|
159 | 149 | " print(\"value =\", dict[key])\n",
|
160 |
| - " return(True)\n", |
| 150 | + " return True\n", |
161 | 151 | " else:\n",
|
162 | 152 | " print(\"Not present\")\n",
|
163 |
| - " return(False)" |
| 153 | + " return False" |
164 | 154 | ]
|
165 | 155 | },
|
166 | 156 | {
|
|
240 | 230 | "fnuall = fnuallarr[srtind]\n",
|
241 | 231 | "\n",
|
242 | 232 | "# Developer Note: We put in errors of 0.0001, but uncertainties need to be fixed\n",
|
243 |
| - "dfnuall = (0.0001)*np.ones(len(fnuall))\n" |
| 233 | + "dfnuall = (0.0001)*np.ones(len(fnuall))" |
244 | 234 | ]
|
245 | 235 | },
|
246 | 236 | {
|
|
856 | 846 | "\n",
|
857 | 847 | "plt.xlabel('Wavelength (microns)')\n",
|
858 | 848 | "plt.ylabel(\"Flux ({:latex})\".format(spec.flux.unit))\n",
|
859 |
| - "plt.title(\"10$\\mu$m feature plus local continuum\")\n", |
| 849 | + "plt.title(r\"10$\\mu$m feature plus local continuum\")\n", |
860 | 850 | "plt.legend(frameon=False, fontsize='medium')\n",
|
861 | 851 | "plt.tight_layout()\n",
|
862 | 852 | "plt.show()\n",
|
|
872 | 862 | "\n",
|
873 | 863 | "plt.xlabel('Wavelength (microns)')\n",
|
874 | 864 | "plt.ylabel(\"Flux ({:latex})\".format(spec.flux.unit))\n",
|
875 |
| - "plt.title(\"Continuum subtracted 10$\\mu$m feature\")\n", |
| 865 | + "plt.title(r\"Continuum subtracted 10$\\mu$m feature\")\n", |
876 | 866 | "plt.tight_layout()\n",
|
877 | 867 | "plt.show()\n",
|
878 | 868 | "plt.close()"
|
|
953 | 943 | "\n",
|
954 | 944 | "tau = -(np.log(line_spec.flux.value / line_y_continuum.value))\n",
|
955 | 945 | "optdepth_spec = Spectrum1D(spectral_axis=line_spec.spectral_axis,\n",
|
956 |
| - " flux=tau*(u.Jy/u.Jy))\n", |
957 |
| - " " |
| 946 | + " flux=tau*(u.Jy/u.Jy))" |
958 | 947 | ]
|
959 | 948 | },
|
960 | 949 | {
|
|
1044 | 1033 | "name": "python",
|
1045 | 1034 | "nbconvert_exporter": "python",
|
1046 | 1035 | "pygments_lexer": "ipython3",
|
1047 |
| - "version": "3.11.7" |
| 1036 | + "version": "3.9.13" |
1048 | 1037 | }
|
1049 | 1038 | },
|
1050 | 1039 | "nbformat": 4,
|
|
0 commit comments