From ebf367dff89f83af1d670694dc6553723ea05636 Mon Sep 17 00:00:00 2001 From: Javier Sanchez Date: Mon, 16 Sep 2024 18:58:28 +0000 Subject: [PATCH 1/3] addressing comments from test feedback --- .../working_with_asdf/working_with_asdf.ipynb | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/content/notebooks/working_with_asdf/working_with_asdf.ipynb b/content/notebooks/working_with_asdf/working_with_asdf.ipynb index 81578d5..5a2d64f 100644 --- a/content/notebooks/working_with_asdf/working_with_asdf.ipynb +++ b/content/notebooks/working_with_asdf/working_with_asdf.ipynb @@ -80,7 +80,15 @@ "\n", "The main goal of this notebook is to illustrate how to open and handle Roman Wide Field Instrument (WFI) data. WFI data are stored in [Advanced Scientific Data Format (ASDF)](https://asdf-standard.readthedocs.io/) files, which combine human-readable hierarchical metadata structure with binary array data. ASDF files are self-validating using pre-defined schema.\n", "\n", - "There are tools to interact with ASDF files in Python, Julia, C/C++, and IDL. In this example we focus on the Python interface." + "There are tools to interact with ASDF files in Python, Julia, C/C++, and IDL. In this example we focus on the Python interface.\n", + "\n", + "Roman ASDF files can be opened and manipulated using two main approaches: 1. Using the `roman_datamodels` library, and 2. using the `asdf` library.\n", + "\n", + "Both approaches should allow accessing the full data. Using `roman_datamodels` has as an advantage that the different data blocks are loaded as `stnode`-based objects, and gives us access to their methods. The `asdf` library, on the other hand, loads the data blocks as they were serialized in disk, which loses some of the `roman_datamodels` capabilities, but can allow more flexibility. We illustrate the two approaches in this notebook, and start showcasing loading via `roman_datamodels`.\n", + "\n", + "Additional information about ASDF in the context of Roman can be found in RDox: https://roman-docs.stsci.edu/data-handbook-home/wfi-data-format.\n", + "\n", + "**Note**: This notebook assumes familiarity with Python, Python dictionaries, and Jupyter notebooks, as well as some basic familiarity with `matplotlib`, `numpy`, and `astropy`. " ] }, { @@ -136,7 +144,14 @@ "metadata": {}, "outputs": [], "source": [ - "f.info()" + "f.info(max_rows=30)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have limited the number of rows printed to 30, but if you want to see all rows, you can change that number to your liking or to `None` in order to see all nodes." ] }, { @@ -156,7 +171,7 @@ "metadata": {}, "outputs": [], "source": [ - "f.keys()" + "pprint(f.keys())" ] }, { @@ -430,7 +445,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Another feature in WFI ASDF metadata is the storage of times as `astropy.time.Time` objects, which provide numerous convenient methods for converting to different reference systems and formats. We illustrate here a few examples and for a more comprehensive view of `astropy.time` please check the documentation [here](https://docs.astropy.org/en/stable/time/)." + "Another feature in WFI ASDF metadata is the storage of times as `astropy.time.Time` objects, which provide numerous convenient methods for converting to different reference systems and formats. We illustrate here a few examples and for a more comprehensive view of `astropy.time` please check the documentation in https://docs.astropy.org/en/stable/time/." ] }, { @@ -817,9 +832,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Roman Calibration latest (2024-03-25)", "language": "python", - "name": "python3" + "name": "roman-cal" }, "language_info": { "codemirror_mode": { From 3ebc8d3222dc81c2cdc0e60cbc23afe983cc3fcc Mon Sep 17 00:00:00 2001 From: Javier Sanchez Date: Mon, 16 Sep 2024 19:27:15 +0000 Subject: [PATCH 2/3] addressed rsp feedback --- .../measuring_galaxy_shapes.ipynb | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb b/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb index 7c0bd69..e6d4852 100644 --- a/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb +++ b/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb @@ -266,6 +266,23 @@ "plt.imshow(psf_img.array, norm=LogNorm())" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "By default the PSF is generated for SCA 01 at `(x, y)` 2048, 2048 in the detector coordinate system. These can be confirmed and modified via the `nc.detector` and `nc.detector_position` methods." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(nc.detector)\n", + "print(nc.detector_position)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -595,9 +612,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Roman Calibration latest (2024-03-25)", "language": "python", - "name": "python3" + "name": "roman-cal" }, "language_info": { "codemirror_mode": { From 195e236413b69ff3f840983cf05fb8d91570f782 Mon Sep 17 00:00:00 2001 From: Javier Sanchez Date: Wed, 18 Sep 2024 14:57:41 +0000 Subject: [PATCH 3/3] addressed review comments --- .../measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb b/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb index e6d4852..299fbd8 100644 --- a/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb +++ b/content/notebooks/measuring_galaxy_shapes/measuring_galaxy_shapes.ipynb @@ -270,7 +270,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "By default the PSF is generated for SCA 01 at `(x, y)` 2048, 2048 in the detector coordinate system. These can be confirmed and modified via the `nc.detector` and `nc.detector_position` methods." + "By default the PSF is generated for SCA 01 at `(x, y)` 2048, 2048 in the science coordinate system (more information about coordinate systems in RDox: https://roman-docs.stsci.edu/simulation-tools-handbook-home/simulation-development-utilities/pysiaf-for-roman). \n", + "\n", + "These attributes can be confirmed and modified via the `nc.detector` and `nc.detector_position` methods." ] }, {