Skip to content

Commit 074a39f

Browse files
authored
Merge pull request #202 from spacetelescope/add-remove-cell-tag
Add remove cell tag
2 parents 331a862 + 475323c commit 074a39f

File tree

7 files changed

+243
-44
lines changed

7 files changed

+243
-44
lines changed

notebooks/composite_model_fitting/specfit_demo_3.ipynb

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"metadata": {},
5+
"metadata": {
6+
"editable": true,
7+
"slideshow": {
8+
"slide_type": ""
9+
},
10+
"tags": []
11+
},
612
"source": [
713
"# Composite Model Spectral Fitting"
814
]
915
},
1016
{
1117
"cell_type": "markdown",
12-
"metadata": {},
18+
"metadata": {
19+
"editable": true,
20+
"slideshow": {
21+
"slide_type": ""
22+
},
23+
"tags": []
24+
},
1325
"source": [
1426
"**Use case:** Fitting the complex continuum around Lyman-alpha in the spectrum of an active galaxy NGC 5548.<br>\n",
1527
"**Data:** 3-column ECSV file with units for each column.<br>\n",
@@ -21,8 +33,21 @@
2133
"\n",
2234
"In this example, we are fitting the complex continuum around Lyman-alpha in the spectrum of an active galaxy (NGC 5548). This involves a powerlaw, extinction, emission lines of various widths and absorption lines. Only certain regions of the spectrum (away from strong absorption lines) are fit. The model has some fixed and some free parameters, as well as parameters that are linked together. We are using the Astropy compound-model machinery to add fit all the components simultaneously. \n",
2335
"\n",
24-
"The example makes only partial use of specutils. It reads the data into the Spectrum1D data structure. However, when we get to actually fitting the model, we are just grabbing the numpy arrays (without units, because that caused some errors). \n",
25-
"\n",
36+
"The example makes only partial use of specutils. It reads the data into the Spectrum1D data structure. However, when we get to actually fitting the model, we are just grabbing the numpy arrays (without units, because that caused some errors). "
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"metadata": {
42+
"editable": true,
43+
"slideshow": {
44+
"slide_type": ""
45+
},
46+
"tags": [
47+
"remove-cell"
48+
]
49+
},
50+
"source": [
2651
"#### Developer Notes\n",
2752
"Todo: \n",
2853
" \n",
@@ -70,7 +95,15 @@
7095
},
7196
{
7297
"cell_type": "markdown",
73-
"metadata": {},
98+
"metadata": {
99+
"editable": true,
100+
"slideshow": {
101+
"slide_type": ""
102+
},
103+
"tags": [
104+
"remove-cell"
105+
]
106+
},
74107
"source": [
75108
"##### Developer notes: \n",
76109
"\n",
@@ -97,7 +130,13 @@
97130
},
98131
{
99132
"cell_type": "markdown",
100-
"metadata": {},
133+
"metadata": {
134+
"editable": true,
135+
"slideshow": {
136+
"slide_type": ""
137+
},
138+
"tags": []
139+
},
101140
"source": [
102141
"## Data input\n",
103142
"\n",
@@ -123,7 +162,13 @@
123162
},
124163
{
125164
"cell_type": "markdown",
126-
"metadata": {},
165+
"metadata": {
166+
"editable": true,
167+
"slideshow": {
168+
"slide_type": ""
169+
},
170+
"tags": []
171+
},
127172
"source": [
128173
"Read the tables using astropy's QTable, so that we preserve the units.\n",
129174
"\n",
@@ -147,7 +192,13 @@
147192
},
148193
{
149194
"cell_type": "markdown",
150-
"metadata": {},
195+
"metadata": {
196+
"editable": true,
197+
"slideshow": {
198+
"slide_type": ""
199+
},
200+
"tags": []
201+
},
151202
"source": [
152203
"## Put the spectrum into a Spectrum1D object\n",
153204
"\n",
@@ -203,7 +254,13 @@
203254
},
204255
{
205256
"cell_type": "markdown",
206-
"metadata": {},
257+
"metadata": {
258+
"editable": true,
259+
"slideshow": {
260+
"slide_type": ""
261+
},
262+
"tags": []
263+
},
207264
"source": [
208265
"## Create a mask from the regions\n",
209266
"\n",
@@ -237,7 +294,13 @@
237294
},
238295
{
239296
"cell_type": "markdown",
240-
"metadata": {},
297+
"metadata": {
298+
"editable": true,
299+
"slideshow": {
300+
"slide_type": ""
301+
},
302+
"tags": []
303+
},
241304
"source": [
242305
"## Convenience routine for plotting a spectrum and highlighting the mask\n",
243306
"\n",
@@ -758,7 +821,7 @@
758821
"name": "python",
759822
"nbconvert_exporter": "python",
760823
"pygments_lexer": "ipython3",
761-
"version": "3.11.5"
824+
"version": "3.11.6"
762825
}
763826
},
764827
"nbformat": 4,

notebooks/ifu_optimal/ifu_optimal.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
"slide_type": ""
325325
},
326326
"tags": [
327-
"hide-cell"
327+
"remove-cell"
328328
]
329329
},
330330
"source": [
@@ -407,7 +407,7 @@
407407
"slide_type": ""
408408
},
409409
"tags": [
410-
"hide-cell"
410+
"remove-cell"
411411
]
412412
},
413413
"source": [
@@ -574,7 +574,7 @@
574574
"slide_type": ""
575575
},
576576
"tags": [
577-
"hide-cell"
577+
"remove-cell"
578578
]
579579
},
580580
"source": [

notebooks/mos-spectroscopy/MOSspec_sv06_revised.ipynb

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"metadata": {},
5+
"metadata": {
6+
"editable": true,
7+
"slideshow": {
8+
"slide_type": ""
9+
},
10+
"tags": []
11+
},
612
"source": [
713
"# MOS Spectroscopy of Extragalactic Field\n",
814
"\n",
@@ -15,8 +21,8 @@
1521
"## Introduction\n",
1622
"\n",
1723
"This notebook will perform a seris of spectroscopic analyses on multiple spectra, including smoothing, continuum fitting and subtraction, line identification, centroiding and flux measurements, gaussian fitting, equivalent widths, and template fitting.\n",
18-
"\n ",
1924
"\n",
25+
" \n",
2026
"**Note:** This notebook is intended to ultimately be compatible with the final data products (1D and 2D spectra) from the JWST pipeline. These data products are not available yet, so the notebook uses LEGA-C data (van der Wel et al. 2016, Straatmann et al. 2018) for now.\n",
2127
"\n",
2228
"LEGA-C is a galaxy survey of about 3000 galaxies at z~0.8 and M* > 10^10 M_sun in the COSMOS field. The spectra sample the rest-frame optical between ~3000A and 5000A at high resolution and very high signal-to-noise ratio. More information about the survey can be found here: http://www.mpia.de/home/legac/"
@@ -188,7 +194,15 @@
188194
},
189195
{
190196
"cell_type": "markdown",
191-
"metadata": {},
197+
"metadata": {
198+
"editable": true,
199+
"slideshow": {
200+
"slide_type": ""
201+
},
202+
"tags": [
203+
"remove-cell"
204+
]
205+
},
192206
"source": [
193207
"##### Developer note\n",
194208
"I would appreciate the interactive tools here to zoom and pan through the 2D spectrum. Hoovering to know the precise wavelength of a feature would also be very useful. With that, the interactive tool could show automatically the calibration in wavelength reading it from the header."
@@ -325,7 +339,15 @@
325339
},
326340
{
327341
"cell_type": "markdown",
328-
"metadata": {},
342+
"metadata": {
343+
"editable": true,
344+
"slideshow": {
345+
"slide_type": ""
346+
},
347+
"tags": [
348+
"remove-cell"
349+
]
350+
},
329351
"source": [
330352
"##### Developer note\n",
331353
"\n",
@@ -337,7 +359,15 @@
337359
},
338360
{
339361
"cell_type": "markdown",
340-
"metadata": {},
362+
"metadata": {
363+
"editable": true,
364+
"slideshow": {
365+
"slide_type": ""
366+
},
367+
"tags": [
368+
"remove-cell"
369+
]
370+
},
341371
"source": [
342372
"##### Developer note\n",
343373
"\n",
@@ -353,7 +383,15 @@
353383
},
354384
{
355385
"cell_type": "markdown",
356-
"metadata": {},
386+
"metadata": {
387+
"editable": true,
388+
"slideshow": {
389+
"slide_type": ""
390+
},
391+
"tags": [
392+
"remove-cell"
393+
]
394+
},
357395
"source": [
358396
"##### Developer note\n",
359397
"\n",
@@ -547,7 +585,15 @@
547585
},
548586
{
549587
"cell_type": "markdown",
550-
"metadata": {},
588+
"metadata": {
589+
"editable": true,
590+
"slideshow": {
591+
"slide_type": ""
592+
},
593+
"tags": [
594+
"remove-cell"
595+
]
596+
},
551597
"source": [
552598
"##### Developer note\n",
553599
"It would be useful to have a tool to cycle through the lines, show a zoom of the spectrum, and inspect how good the line identification is. For now I do it by hand on a single line."
@@ -623,7 +669,15 @@
623669
},
624670
{
625671
"cell_type": "markdown",
626-
"metadata": {},
672+
"metadata": {
673+
"editable": true,
674+
"slideshow": {
675+
"slide_type": ""
676+
},
677+
"tags": [
678+
"remove-cell"
679+
]
680+
},
627681
"source": [
628682
"## Fit the line with a Gaussian\n",
629683
"\n",
@@ -727,7 +781,13 @@
727781
},
728782
{
729783
"cell_type": "markdown",
730-
"metadata": {},
784+
"metadata": {
785+
"editable": true,
786+
"slideshow": {
787+
"slide_type": ""
788+
},
789+
"tags": []
790+
},
731791
"source": [
732792
"## Find the best-fitting template\n",
733793
"It needs a list of templates and the redshift of the observed galaxy. For the templates, I am using a set of model SEDs generated with Bruzual & Charlot stellar population models, emission lines, and dust attenuation as described in Pacifici et al. (2012).\n",
@@ -829,9 +889,9 @@
829889
"name": "python",
830890
"nbconvert_exporter": "python",
831891
"pygments_lexer": "ipython3",
832-
"version": "3.8.10"
892+
"version": "3.11.6"
833893
}
834894
},
835895
"nbformat": 4,
836-
"nbformat_minor": 2
896+
"nbformat_minor": 4
837897
}

notebooks/niriss_ami_binary/1_niriss_ami_binary.ipynb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"metadata": {},
5+
"metadata": {
6+
"editable": true,
7+
"slideshow": {
8+
"slide_type": ""
9+
},
10+
"tags": []
11+
},
612
"source": [
713
"# NIRISS AMI: MIRAGE Simulations"
814
]
@@ -133,7 +139,15 @@
133139
},
134140
{
135141
"cell_type": "markdown",
136-
"metadata": {},
142+
"metadata": {
143+
"editable": true,
144+
"slideshow": {
145+
"slide_type": ""
146+
},
147+
"tags": [
148+
"remove-cell"
149+
]
150+
},
137151
"source": [
138152
"*Developer Note:*\n",
139153
"If you are outside STScI install the mirage data by following instructions on https://mirage-data-simulator.readthedocs.io/en/latest/reference_files.html and create MIRAGE_DATA location."
@@ -683,9 +697,9 @@
683697
"name": "python",
684698
"nbconvert_exporter": "python",
685699
"pygments_lexer": "ipython3",
686-
"version": "3.8.10"
700+
"version": "3.11.6"
687701
}
688702
},
689703
"nbformat": 4,
690-
"nbformat_minor": 2
704+
"nbformat_minor": 4
691705
}

0 commit comments

Comments
 (0)