Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remove cell tag #202

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 74 additions & 11 deletions notebooks/composite_model_fitting/specfit_demo_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# Composite Model Spectral Fitting"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"**Use case:** Fitting the complex continuum around Lyman-alpha in the spectrum of an active galaxy NGC 5548.<br>\n",
"**Data:** 3-column ECSV file with units for each column.<br>\n",
Expand All @@ -21,8 +33,21 @@
"\n",
"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",
"\n",
"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",
"\n",
"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). "
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"#### Developer Notes\n",
"Todo: \n",
" \n",
Expand Down Expand Up @@ -70,7 +95,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer notes: \n",
"\n",
Expand All @@ -97,7 +130,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Data input\n",
"\n",
Expand All @@ -123,7 +162,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"Read the tables using astropy's QTable, so that we preserve the units.\n",
"\n",
Expand All @@ -147,7 +192,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Put the spectrum into a Spectrum1D object\n",
"\n",
Expand Down Expand Up @@ -203,7 +254,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Create a mask from the regions\n",
"\n",
Expand Down Expand Up @@ -237,7 +294,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Convenience routine for plotting a spectrum and highlighting the mask\n",
"\n",
Expand Down Expand Up @@ -758,7 +821,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/ifu_optimal/ifu_optimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
"slide_type": ""
},
"tags": [
"hide-cell"
"remove-cell"
]
},
"source": [
Expand Down Expand Up @@ -407,7 +407,7 @@
"slide_type": ""
},
"tags": [
"hide-cell"
"remove-cell"
]
},
"source": [
Expand Down Expand Up @@ -574,7 +574,7 @@
"slide_type": ""
},
"tags": [
"hide-cell"
"remove-cell"
]
},
"source": [
Expand Down
82 changes: 71 additions & 11 deletions notebooks/mos-spectroscopy/MOSspec_sv06_revised.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# MOS Spectroscopy of Extragalactic Field\n",
"\n",
Expand All @@ -15,8 +21,8 @@
"## Introduction\n",
"\n",
"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",
"\n ",
"\n",
" \n",
"**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",
"\n",
"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/"
Expand Down Expand Up @@ -188,7 +194,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer note\n",
"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."
Expand Down Expand Up @@ -325,7 +339,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer note\n",
"\n",
Expand All @@ -337,7 +359,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer note\n",
"\n",
Expand All @@ -353,7 +383,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer note\n",
"\n",
Expand Down Expand Up @@ -547,7 +585,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"##### Developer note\n",
"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."
Expand Down Expand Up @@ -623,7 +669,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"## Fit the line with a Gaussian\n",
"\n",
Expand Down Expand Up @@ -727,7 +781,13 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Find the best-fitting template\n",
"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",
Expand Down Expand Up @@ -829,9 +889,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
22 changes: 18 additions & 4 deletions notebooks/niriss_ami_binary/1_niriss_ami_binary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# NIRISS AMI: MIRAGE Simulations"
]
Expand Down Expand Up @@ -133,7 +139,15 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"source": [
"*Developer Note:*\n",
"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."
Expand Down Expand Up @@ -683,9 +697,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading
Loading