diff --git a/content/notebooks/pandeia/pandeia.ipynb b/content/notebooks/pandeia/pandeia.ipynb index ffa99f6..9de1871 100644 --- a/content/notebooks/pandeia/pandeia.ipynb +++ b/content/notebooks/pandeia/pandeia.ipynb @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "b96c3c70-16d1-4349-8904-00f3828d4f79", "metadata": {}, "outputs": [], @@ -74,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "eb47af89-3fc1-4984-b28a-06e0edf6cee4", "metadata": {}, "outputs": [], @@ -105,14 +105,14 @@ "source": [ "### Calculate a Scene's Signal-to-Noise Ratio\n", "\n", - "In this first example, we calculate the expected SNR for a point source with a flat spectral distribution (default target) normalized to 25 AB magnitudes. We place the source on Detector #1 (internally: SCA01) and take three exposures in band F129 with the multi-accumulation (MA) table \"c2a_img_hlwas\", truncated after 9 resultants (407.96 seconds of total exposure time). MA tables describe the sequence of individual reads that are combined into resultants and comprise the up-the-ramp sampling during a single exposure of the WFI detectors. For more information on the WFI detectors, please refer to the RDox documentation on [WFI](https://roman-docs.stsci.edu/roman-instruments-home/wfi-imaging-mode-user-guide/wfi-design/description-of-wfi) and for the MA tables, please refer to the RDox documentation on [MA tables](https://roman-docs.stsci.edu/raug/astronomers-proposal-tool-apt/appendix/appendix-wfi-multiaccum-tables).\n", + "In this first example, we calculate the expected SNR for a point source with a flat spectral distribution (default target) normalized to 25 AB magnitudes. We place the source on Detector #1 (SCA01) and take three exposures in band F129 with the multi-accumulation (MA) table \\\"c2a_img_hlwas\\\", truncated after 9 resultants (407.96 seconds of total exposure time). MA tables describe the sequence of individual reads that are combined into resultants and comprise the up-the-ramp sampling during a single exposure of the WFI detectors. For more information on the WFI detectors, please refer to the RDox documentation on [WFI](https://roman-docs.stsci.edu/roman-instruments-home/wfi-imaging-mode-user-guide/wfi-design/description-of-wfi) and for the MA tables, please refer to the RDox documentation on [MA tables](https://roman-docs.stsci.edu/raug/astronomers-proposal-tool-apt/appendix/appendix-wfi-multiaccum-tables).\n", "\n", "We first create a default calculation using Pandeia's built-in function `build_default_calc(, , )`: " ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "41bf5746-e8c1-41ee-8f64-9af598d13022", "metadata": {}, "outputs": [], @@ -143,12 +143,12 @@ "id": "013b4561", "metadata": {}, "source": [ - "The `build_default_calc` created a scene with a single point source to observe with SCA01, F158 filter, \"c2a_img_hlwas\" MA table, with no truncatation, and with a single exposure. With the WFI, an exposure refers to a single multi-accum sequence of the detector array at a single dither point in the dither pattern. Next, we define the observing setup and make some changes to the default setting:" + "The `build_default_calc` created a scene with a single point source placed on Detector 01 (SCA01), to be observed in a single exposure using the F158 filter and the \\\"c2a_img_hlwas\\\" MA table, with no truncation. Note that for the Roman WFI, the term \"exposure\" refers to a multi-accum sequence of the detector array at a single dither point in the dither pattern. Next, we define the observing setup and make some changes to the default settings:" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "d5cdd524", "metadata": {}, "outputs": [], @@ -163,12 +163,12 @@ "id": "1beda2d0-1fa3-4b88-8f4d-ff6f9d9416f2", "metadata": {}, "source": [ - "Next, we change the default point source flux to 25 AB magnitudes:" + "Next, we normalize the default point source flux to 25 AB magnitudes:" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "d4a78b80-ce4f-4840-9a28-1426b9bb5925", "metadata": {}, "outputs": [], @@ -183,7 +183,7 @@ "id": "55f5d8ac-126c-4b94-acd6-c26d9bfd63ac", "metadata": {}, "source": [ - "Finally, we perform the signal to noise calculation using Pandeia's another built-in function `perform_calculation` and print the result:" + "Finally, we perform the signal to noise calculation using Pandeia's built-in function `perform_calculation` and print the results:" ] }, { @@ -204,7 +204,7 @@ "id": "44c3825c-ea41-4270-9a8a-b4f347cc59ca", "metadata": {}, "source": [ - "Note that this step may generate a WARNING from synphot that the spectrum is extrapolated, which can be ignored.\n", + "Note that this step may generate a WARNING from synphot that the spectrum is extrapolated, which can be safely ignored.\n", "\n", "Running Pandeia for Roman may return a warning such as: `if np.log(abs(val)) < -1*precision and val != 0.0`. This is related to a JWST-specific test for float precision, and can be ignored." ] @@ -214,11 +214,11 @@ "id": "d61559f5-68b1-40f3-8f80-7edab8f332bb", "metadata": {}, "source": [ - "### Calculating Magnitude and Optimizing Exposures for Roman WFI Simulations\n", + "### Calculating Limiting Magnitudes and Optimizing the Number of Exposures for Roman WFI Simulations\n", "\n", - "For the next example, we begin by determining the corresponding magnitude for a given signal-to-noise ratio (SNR) and setup parameters. Next, we extend this analysis to calculate the optimal number of exposures required to reach a target SNR for a given source flux.\n", + "In the next example, we start by determining the magnitude corresponding to a given signal-to-noise ratio (SNR) for a specific setup. We then extend this analysis to calculate the optimal number of exposures needed to achieve a target SNR for a given source flux.\n", "\n", - "The following helper functions use Pandeia to simulate a range of scenes at different magnitudes in order to estimate the corresponding magnitude for a given SNR and a number of exposures. As above, we assume a point source with a flat spectrum, and the MA table is set to the \"c2a_img_hlwas\" table but this time without any truncation." + "The following helper functions use Pandeia to simulate a range of scenes at different magnitudes in order to estimate the magnitude corresponding to a given SNR for a specific number of exposures. As above, we assume a point source with a flat spectrum, and the MA table is set to the \"c2a_img_hlwas\" table without any truncation." ] }, { @@ -226,9 +226,9 @@ "id": "81aa2576-4638-481b-9978-bf96cd285b10", "metadata": {}, "source": [ - "#### Step 1: Calculating Corresponding Magnitude for a Given Setup\n", + "#### Step 1: Calculating Limiting Magnitude for a Given Setup\n", "\n", - "In the first step, we estimate the limiting magnitude for a point source at a desired SNR. This involves iterating over a range of magnitudes, computing the SNR for each, and interpolating the results to determine the magnitude corresponding to the target SNR. The observing parameters include the number of exposures and a specified filter.\n", + "In the first step, we estimate the limiting magnitude for a point source at a desired SNR. This process involves iterating over a range of magnitudes, calculating the SNR for each, and interpolating the results to determine the magnitude that corresponds to the target SNR. The observing parameters include the number of exposures and the specified filter.\n", "\n", "Example Use Case:\n", "\n", @@ -241,7 +241,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "e6e68758-cef5-471b-89f1-0877c1d64b26", "metadata": {}, "outputs": [], @@ -334,7 +334,7 @@ "metadata": {}, "source": [ "#### Step 2: Determining Optimal Number of Exposures\n", - "With the magnitude determined, we then calculate the optimal number of exposures required to achieve a specified SNR for a known flux. This is done by simulating observations with varying numbers of exposures, identifying the minimum exposure count necessary to meet or exceed the target SNR. This ensures efficient use of telescope time while maintaining data quality.\n", + "Once the magnitude is determined, we calculate the optimal number of exposures needed to achieve a target SNR for a known flux. This involves simulating observations with varying exposure counts and identifying the minimum number required to meet or exceed the target SNR. This approach ensures efficient use of telescope time while maintaining data quality.\n", "\n", "The following helper functions use Pandeia to simulate a range of scenes with different numbers of exposures in order to estimate the optimal observing time to reach the expected limiting magnitude for a source with a given flux. As above, we assume a point source with a flat spetrum, and the MA table is set to the \"c2a_img_hlwas\" table, truncated to 8 resultants.\n", "\n", @@ -349,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "b363d0f3-a2f6-4953-b4cd-f90872639cce", "metadata": {}, "outputs": [], @@ -475,12 +475,12 @@ "source": [ "### Modifying the Spectral Energy Distribution\n", "\n", - "While previous examples assume a point source with a flat SED, Pandeia also offers the ability to use a a variety of different shapes and spectral inputs. In the example below, we calculate the SNR for an A0V star (Phoenix model) of magnitude 25 AB, observed in the F129 band, with 3 exposures of the default MA table (\"c2a_img_hlwas\", with no truncation). For more information on how to implement complex scenes with a variety of shapes and SEDs, please refer to the [JWST Tutorials](https://jwst-docs.stsci.edu/jwst-exposure-time-calculator-overview/jwst-etc-pandeia-engine-tutorial/pandeia-quickstart#PandeiaQuickstart-Samplecode)." + "While previous examples assume a point source with a flat SED, Pandeia also offers the ability to use a variety of different shapes and spectral inputs. In the example below, we calculate the SNR for an A0V star (Phoenix model) of magnitude 25 AB, observed in the F129 band, with 3 exposures of the default MA table \"c2a_img_hlwas\", with no truncation. For more information on how to implement complex scenes with a variety of shapes and SEDs, please refer to the [JWST Tutorials](https://jwst-docs.stsci.edu/jwst-exposure-time-calculator-overview/jwst-etc-pandeia-engine-tutorial/pandeia-quickstart#PandeiaQuickstart-Samplecode)." ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "26569041-1670-4285-ab13-3a837523b078", "metadata": {}, "outputs": [], @@ -494,7 +494,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "95a2da69-828a-4e0f-9c79-10de708b2f5e", "metadata": {}, "outputs": [], @@ -526,7 +526,7 @@ "source": [ "### Observing NGC2506-G31 with Roman WFI\n", "\n", - "In this example, we show a real science case using NGC2506-G31, a G1V standard star that is used as a cross-mission calibration standard for both JWST and HST observations. We would like to see if Roman can observe the same star and if so, with which observing setup. We are interested in placing the star on SCA11. " + "In this example, we show a real science case using NGC2506-G31, a G1V standard star that is used as a cross-mission calibration standard for both JWST and HST observations. We would like to see if Roman can observe the same star and if so, with which observing setup. We are interested in placing the star on Detector 11 (SCA11). " ] }, { @@ -567,7 +567,7 @@ "id": "b9c01070-2eed-4e3c-8d92-70c749726232", "metadata": {}, "source": [ - "With the calculation ran, we would like to check to see if there are any warning messages from the report. You can access the warnings through the the \"warnings\" dictionary. " + "After running the calculation, we can check for any warning messages in the report. These warnings can be accessed through the \"warnings\" dictionary." ] }, { @@ -585,7 +585,7 @@ "id": "49d23740-edb9-4cd9-9713-65a842c79d0a", "metadata": {}, "source": [ - "We see that there is a pixel that is partially saturated. If you are concerned that there is a partially saturated pixel, you can check the report to see what the maximum number of resultants is to avoid having the brighest pixel on the detector getting saturated. You can access this information through the \"sat_nresultants\" key within the \"scalar\" dictionary." + "We observe that a pixel is partially saturated. If you are concerned about a partially saturated pixel, you can check the report determine the maximum number of resultants needed to avoid saturation of the brightest pixel on the detector. This information can be accessed through the \"sat_nresultants\" key within the \"scalar\" dictionary." ] }, { @@ -603,7 +603,7 @@ "id": "d0ba4335-57bb-444b-94b3-bb3afda85a06", "metadata": {}, "source": [ - "Let's check manually that it indeed is nresultant=5. The maximum nresultant for \"c2a_img_hlwas\" MA table is 10 and we will calculate backward, from no truncation to incremented truncation. " + "Let's manually verify that the value is indeed nresultant = 5. The maximum nresultant for the \"c2a_img_hlwas\" MA table is 10, and we will calculate backward, starting from no truncation and incrementally applying truncation. " ] }, { @@ -634,11 +634,9 @@ "id": "81bcdfa5-3bc8-4677-a05c-2053411a7fab", "metadata": {}, "source": [ - "The answer turns out to be 5 indeed. \n", + "The answer turns out to be 5 indeed.\n", "\n", - "Although we know the actual coordinate of this star, Pandeia engine does not support a simulation at a specific location or time\n", - "as the engine comes with 7 canned backgrounds at 2 different locations (see the JDox on the [Pandeia backgrounds](https://jwst-docs.stsci.edu/jwst-exposure-time-calculator-overview/jwst-etc-pandeia-engine-tutorial/pandeia-backgrounds#gsc.tab=0) for more details). If you would like to see how the SNR changes with time at the specific location of this star, you have to use the web application of the ETC that is available at the [Roman WFI ETC](roman.etc.stsci.edu).\n", - "\n" + "Note that the Pandeia engine does not support simulations at specific coordinates or times. Instead, the engine includes seven predefined backgrounds at two different locations. For more details, refer ot the JDox documentation on [Pandeia backgrounds](https://jwst-docs.stsci.edu/jwst-exposure-time-calculator-overview/jwst-etc-pandeia-engine-tutorial/pandeia-backgrounds#gsc.tab=0). If you want to see how the SNR changes over time at the specific location of this star, you will need to use the web application of the ETC, available at the [Roman WFI ETC](roman.etc.stsci.edu)." ] }, { @@ -691,7 +689,7 @@ ], "metadata": { "kernelspec": { - "display_name": "pandeia_dev", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -705,7 +703,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.11.11" } }, "nbformat": 4,