Skip to content

Commit

Permalink
Merge pull request #45 from fjaviersanchez/js_updates_sept24
Browse files Browse the repository at this point in the history
Updates from RSP test feedback to `working_with_asdf` and `measuring_galaxy_shapes`
  • Loading branch information
tddesjardins authored Sep 18, 2024
2 parents 7124a14 + 195e236 commit 3d3de3e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,25 @@
"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 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."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(nc.detector)\n",
"print(nc.detector_position)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -595,9 +614,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": {
Expand Down
27 changes: 21 additions & 6 deletions content/notebooks/working_with_asdf/working_with_asdf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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`. "
]
},
{
Expand Down Expand Up @@ -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."
]
},
{
Expand All @@ -156,7 +171,7 @@
"metadata": {},
"outputs": [],
"source": [
"f.keys()"
"pprint(f.keys())"
]
},
{
Expand Down Expand Up @@ -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/."
]
},
{
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 3d3de3e

Please sign in to comment.