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

Updates from RSP test feedback to working_with_asdf and measuring_galaxy_shapes #45

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's the detector coordinate system? I thought webbpsf used the science orientation (just confirmed with Charles).

]
},
{
"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 +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": {
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."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned about using a None for this. Nice.

]
},
{
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