Skip to content

Commit

Permalink
Updated to correct some PEP8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rizeladiaz committed Jan 3, 2025
1 parent 4fe621d commit 45f9959
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions notebooks/NIRSPEC/ifu/JWPipeNB-NIRSpec-IFU.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@
" program = \"02729\"\n",
" sci_observtn = \"005\"\n",
" bg_observtn = None\n",
" filters = [#\"F100LP;G140H\",\n",
" #\"F170LP;G235H\",\n",
" \"F290LP;G395H\"]\n",
"\n",
" # Possible filter options [#\"F100LP;G140H\",#\"F170LP;G235H\",\"F290LP;G395H\"]\n",
" # Limiting selection to one\n",
" filters = [\"F290LP;G395H\"]\n",
" \n",
" # ----------Define the base and observation directories----------\n",
" basedir = os.path.join('.', f'ifu_data_{program}')\n",
" sci_dir = os.path.join(basedir, f'Obs{sci_observtn}')\n",
Expand Down Expand Up @@ -662,7 +662,6 @@
"metadata": {},
"source": [
"---\n",
"\n",
"## 4. Directory Setup\n",
"Set up detailed paths to input/output stages here."
]
Expand Down Expand Up @@ -765,7 +764,7 @@
"source": [
"<div class=\"alert alert-warning\">\n",
" To override specific steps and reference files, use the examples below.\n",
"</div>\n"
"</div>"
]
},
{
Expand Down Expand Up @@ -957,7 +956,6 @@
"metadata": {},
"source": [
"---\n",
"\n",
"## 6. Stage 2: `Spec2Pipeline` (`calwebb_spec2`)\n",
"\n",
"In this section, we process our countrate (slope) image products from Stage 1 (`calwebb_detector1`) through the Spec2 (`calwebb_spec2`) pipeline to create Stage 2 [data products](https://jwst-pipeline.readthedocs.io/en/latest/jwst/data_products/science_products.html).\n",
Expand Down Expand Up @@ -1003,7 +1001,7 @@
"For more information about each step and a full list of step arguments, please refer to the official documentation: [JDox](https://jwst-docs.stsci.edu/jwst-science-calibration-pipeline-overview/stages-of-jwst-data-processing/calwebb_spec2) •\n",
"[ReadtheDocs](https://jwst-pipeline.readthedocs.io/en/latest/jwst/pipeline/calwebb_spec2.html)\n",
"\n",
"Below, we set up a dictionary that defines how the `Spec2Pipeline` should be configured for IFU data.\n"
"Below, we set up a dictionary that defines how the `Spec2Pipeline` should be configured for IFU data."
]
},
{
Expand Down Expand Up @@ -1090,7 +1088,6 @@
"metadata": {},
"source": [
"---\n",
"\n",
"### 6.2 `Spec2Pipeline` ASN Files\n",
"\n",
"[Association (ASN) files](https://jwst-pipeline.readthedocs.io/en/stable/jwst/associations/overview.html) define the relationships between multiple exposures, allowing them to get processed as a set rather than individually. Processing an ASN file enables the exposures to be calibrated, archived, retrieved, and reprocessed as a set rather than as individual objects.\n",
Expand All @@ -1103,7 +1100,7 @@
"\n",
"Background subtraction may not be correctly applied if more than *one* `science` file is included in the association. Additionally, pixel-to-pixel background subtraction will only be performed if the grating wheel has not moved between the target and off-scene associated background exposures. If the grating wheel moved between the target and background exposures (as would be the case if they were in different visits), pipeline processing will follow a more involved \"master background\" subtraction done in Stage 3.\n",
"\n",
"</div>\n"
"</div>"
]
},
{
Expand Down Expand Up @@ -1159,7 +1156,6 @@
"metadata": {},
"source": [
"---\n",
"\n",
"### 6.3 Run `Spec2Pipeline`\n",
"\n",
"Run the science files and, if available, any background files through the `calwebb_spec2` pipeline using the `.call()` method."
Expand Down Expand Up @@ -1233,8 +1229,7 @@
" print(\"Skipping Stage 2 for BKG data \\n\")\n",
"\n",
"else:\n",
" print(\"Skipping Stage 2 for SCI and BKG data \\n\")\n",
" \n"
" print(\"Skipping Stage 2 for SCI and BKG data \\n\")"
]
},
{
Expand Down Expand Up @@ -1298,7 +1293,6 @@
"metadata": {},
"source": [
"---\n",
"\n",
"## 7. Stage 3: `Spec3Pipeline` (`calwebb_spec3`)\n",
"\n",
"In this section, we process our calibrated spectra from Stage 2 (`calwebb_spec2`) through the Spec3 (`calwebb_spec3`) pipeline to create Stage 3 [data products](https://jwst-pipeline.readthedocs.io/en/latest/jwst/data_products/science_products.html).\n",
Expand Down Expand Up @@ -1549,14 +1543,7 @@
"metadata": {},
"source": [
"---\n",
"## 8. Visualize the data"
]
},
{
"cell_type": "markdown",
"id": "13e82633",
"metadata": {},
"source": [
"## 8. Visualize the data\n",
"Define convenience funcitons for visualization.\n",
"\n",
"Function to display Stage 1 products"
Expand Down Expand Up @@ -2036,9 +2023,6 @@
"\n",
"## 9. Modifying the EXTRACT1D Reference File (as needed)\n",
"\n",
"[extract_1d](https://jwst-pipeline.readthedocs.io/en/latest/jwst/extract_1d) • \n",
"[Editing JSON reference file](https://jwst-pipeline.readthedocs.io/en/latest/jwst/extract_1d/reference_files.html#editing-json-reference-file-format-for-non-ifu-data)\n",
"\n",
"The `extract_1d` step is controlled by a different set of parameters in the EXTRACT1D reference file for extended vs. point source IFU data. \n",
"\n",
"[Extraction for 3D IFU Data:](https://jwst-pipeline.readthedocs.io/en/latest/jwst/extract_1d/description.html)\n",
Expand All @@ -2047,7 +2031,8 @@
"> * For point source data, the extraction aperture is centered at the RA/DEC target location indicated by the header. If the target location is undefined in the header, then the extraction region is the center of the IFU cube.\n",
"> * For point sources, a circular extraction aperture is used, along with an optional circular annulus for background extraction and subtraction. The size of the extraction region and the background annulus size varies with wavelength. The extraction-related vectors are found in the ASDF EXTRACT1D reference file. For each element in the wavelength vector, there are three size components: `radius`, `inner_bkg`, and `outer_bkg`. The radius vector sets the extraction size while `inner_bkg` and `outer_bkg` specify the limits of an annular background aperture. \n",
"\n",
"Below is an example of how to modify the EXTRACT1D reference file for point sources. \n",
"Below is an example of how to modify the EXTRACT1D reference file for point sources. More information about this file and how to modify it in [extract_1d](https://jwst-pipeline.readthedocs.io/en/latest/jwst/extract_1d) and\n",
"[Editing JSON reference file](https://jwst-pipeline.readthedocs.io/en/latest/jwst/extract_1d/reference_files.html#editing-json-reference-file-format-for-non-ifu-data).\n",
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"\n",
Expand Down Expand Up @@ -2117,7 +2102,7 @@
"id": "e31c5fe4-70d8-4db2-b00e-ffa662242909",
"metadata": {},
"source": [
"Now, we re-extract the 1D spectrum by running the `Extract1dStep` and overriding the reference file.\n"
"Now, we re-extract the 1D spectrum by running the `Extract1dStep` and overriding the reference file."
]
},
{
Expand Down Expand Up @@ -2145,7 +2130,7 @@
"id": "692dcc8e-094a-4790-ae5c-0cb6873c559b",
"metadata": {},
"source": [
"We now plot again the 3D/1D final cube/spectra and showing the original extraction box in red and the new extraction box in black.\n"
"We now plot again the 3D/1D final cube/spectra and showing the original extraction box in red and the new extraction box in black."
]
},
{
Expand Down

0 comments on commit 45f9959

Please sign in to comment.