From ac12f9b60f2f8f1141c7692bb4cd9264ff57177e Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Fri, 3 Jun 2022 19:50:13 -0400 Subject: [PATCH] add ASDF Intro tutorial --- 12-ASDF/ASDF_Solutions.ipynb | 147 ++++++++ 12-ASDF/Intro_ASDF.ipynb | 649 +++++++++++++++++++++++++++++++++++ 12-ASDF/README.md | 3 + 12-ASDF/roman.asdf | 403 ++++++++++++++++++++++ README.md | 4 +- 5 files changed, 1204 insertions(+), 2 deletions(-) create mode 100644 12-ASDF/ASDF_Solutions.ipynb create mode 100644 12-ASDF/Intro_ASDF.ipynb create mode 100644 12-ASDF/README.md create mode 100644 12-ASDF/roman.asdf diff --git a/12-ASDF/ASDF_Solutions.ipynb b/12-ASDF/ASDF_Solutions.ipynb new file mode 100644 index 0000000..bfef38c --- /dev/null +++ b/12-ASDF/ASDF_Solutions.ipynb @@ -0,0 +1,147 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "accb2b84", + "metadata": {}, + "source": [ + "#### ASDF Exercise Solutions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "416bd2e3", + "metadata": {}, + "outputs": [], + "source": [ + "import asdf" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f0f39489", + "metadata": {}, + "outputs": [], + "source": [ + "af = asdf.open('roman.asdf')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "286a8859", + "metadata": {}, + "outputs": [], + "source": [ + "af.info()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "78997318", + "metadata": {}, + "outputs": [], + "source": [ + "af.info(max_rows=200)" + ] + }, + { + "cell_type": "markdown", + "id": "f2125b48", + "metadata": {}, + "source": [ + "Use the **search** method to find the path to the WCS object" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "73b922c1", + "metadata": {}, + "outputs": [], + "source": [ + "af.search('wcs')" + ] + }, + { + "cell_type": "markdown", + "id": "d0d25b5c", + "metadata": {}, + "source": [ + "Evaluate the WCS object using the Astropy Common API" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c905a1a3", + "metadata": {}, + "outputs": [], + "source": [ + "w = af['roman']['meta']['wcs']\n", + "\n", + "sky = w.pixel_to_world(200, 300)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0fc4a6fd", + "metadata": {}, + "outputs": [], + "source": [ + "print(sky)" + ] + }, + { + "cell_type": "markdown", + "id": "f4e97e7f", + "metadata": {}, + "source": [ + "Convert to galactic coordinates" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7fea05b3", + "metadata": {}, + "outputs": [], + "source": [ + "print(sky.galactic)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "78dcc722", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/12-ASDF/Intro_ASDF.ipynb b/12-ASDF/Intro_ASDF.ipynb new file mode 100644 index 0000000..87a1f06 --- /dev/null +++ b/12-ASDF/Intro_ASDF.ipynb @@ -0,0 +1,649 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "dc769042", + "metadata": {}, + "source": [ + "# Intro to the Advanced Scientific Data Format (ASDF)\n" + ] + }, + { + "cell_type": "markdown", + "id": "32f82995", + "metadata": {}, + "source": [ + "## Outline\n", + "\n", + "- Why a new data format?\n", + "- ASDF Standard features\n", + "- Who uses it?\n", + "- Working with existing ASDF files\n", + " - Read a file\n", + " - Show the contents of an ASDF file\n", + " - Search for an attribute in an ASDF file\n", + " - Accessing metadata and data\n", + " - Modifying and saving files\n", + " - Exercise\n", + " - *Adding History items*\n", + " - *Compression*\n", + "- *Command line interface*\n" + ] + }, + { + "cell_type": "markdown", + "id": "f4d3b708", + "metadata": {}, + "source": [ + "### The Need For a New Data Format\n", + "\n", + "What's wrong with FITS?\n", + "\n", + " FITS served the astronomical community very well for many years. However, with the advanace of new instrumentation, development of algorithms and increased size of data and data volume it appears to be more problematic than helpful. The issues with FITS have been documented in a paper by B. Thomas, et al. (Learning from FITS: Limitations in use in modern astronomical research, Astron. Comput. (2015), 10.1016/j.ascom.2015.01.009, arXiv:1502.00996v2).\n", + " \n", + " The specific motivation for developing the standard was that FITS WCS conventions proved basically unusable for raw HST data that included complex distortion models and that required high accuracy. The experience with HST showed that those conventions will not work with the much more complex JWST WCS transforms.\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "87c3882c", + "metadata": {}, + "source": [ + "### Main Features of ASDF\n", + "\n", + "\n", + "- It has a hierarchical metadata structure, made up of basic dynamic data types such as strings, numbers, lists and mappings.\n", + "\n", + "- Attribute names and values are not constrained by size as is the case for FITS header cards.\n", + "\n", + "- It has human-readable metadata that can be edited directly in place in the file.\n", + "\n", + "- The structure of the files can be automatically validated using associated schema files.\n", + "\n", + "- It’s designed for extensibility: new conventions may be used without breaking backward compatibility with tools that do not understand those conventions. Versioning systems are used to prevent conflicting with alternative conventions.\n", + "\n", + "- The binary array data (when compression is not used) is a raw memory dump, and techniques such as memory mapping can be used to efficiently access it.\n", + "\n", + "- It is possible to read and write the file in as a stream, without requiring random access.\n", + "\n", + "- It’s built on top of industry standards, such as YAML and JSON Schema to take advantage of a larger community\n", + "working on the core problems of data representation. This also makes it easier to support ASDF in new programming languages and environments by building on top of existing libraries.\n", + "\n", + "- Since every ASDF file has the version of the specification to which it is written, it will be possible, through careful planning, to evolve the ASDF format over time, allowing for files that use new features while retaining backward compatibility with older tools." + ] + }, + { + "cell_type": "markdown", + "id": "c865ea32", + "metadata": {}, + "source": [ + "### Implementation Status\n", + "\n", + "The current version of the **standard is 1.5.0.**\n", + "\n", + "There is a Python reference implementation that supports the standard, the library is called **asdf**.\n", + "\n", + "Future plans include a C/C++ (a partial implementation exists) and possibly an IDL implementation.\n" + ] + }, + { + "cell_type": "markdown", + "id": "528c84a6", + "metadata": {}, + "source": [ + "### Who Uses ASDF?\n", + "\n", + "- The JWST calibration pipeline uses data models based on ASDF to abstract out the serialization format. The WCS describing the unresampled data is serialized using ASDF.\n", + "\n", + "- ASDF will be the data format for the Nancy Grace Roman Space Telescope. \n", + "\n", + "- Daniel K Inoue Solar Telescope (DKIST) is using ASDF for serializing the World Coordinate System.\n", + "\n", + "- Used by the Vera Rubin Telescope as a WCS exchange format.\n", + "\n", + "- There are other non-institutional projects using it in astronomy and other fields. " + ] + }, + { + "cell_type": "markdown", + "id": "a31c7d5c", + "metadata": {}, + "source": [ + "### Anatomy of an ASDF file\n", + "\n", + "ASDF is a hybrid text and binary format. The general layout of the file is\n", + "- header\n", + "- tree (optional)\n", + " The tree is a dictionary. Most Python types can be serialized directly, using YAML, as {key: value} pairs in the tree. \n", + "- binary blocks (optional)\n", + "- binary block index (optional)\n", + "\n", + "The header, tree and block index are text, while the blocks are raw binary.\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "892aab60", + "metadata": {}, + "source": [ + "### Reading an ASDF file\n", + "\n", + "The Python ASDF library is a standalone package distributed through PyPi and conda-forge.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec270343", + "metadata": {}, + "outputs": [], + "source": [ + "import asdf" + ] + }, + { + "cell_type": "markdown", + "id": "ef8b28cc", + "metadata": {}, + "source": [ + "To open a file use the **open** function. It is useful to look up the keyword arguments it accepts, there are many options specifying how a file should be opened or validated during opening. For this example we will use the default behavior and look at the object." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6986cf41", + "metadata": {}, + "outputs": [], + "source": [ + "af = asdf.open('example.asdf')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bcb917cd", + "metadata": {}, + "outputs": [], + "source": [ + "print(af)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f086d2f5", + "metadata": {}, + "outputs": [], + "source": [ + "af.tree" + ] + }, + { + "cell_type": "markdown", + "id": "6ac4d5af", + "metadata": {}, + "source": [ + "### Getting information about a file\n", + "\n", + "There are two functions that allow introspecting a file, **info** and **search**. They are available as methods on the **AsdFile** object or on the command line. Both are configurable through multiple parameters.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4ee2448f", + "metadata": {}, + "outputs": [], + "source": [ + "af.info?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2c24aac4", + "metadata": {}, + "outputs": [], + "source": [ + "af.search?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "93ab541c", + "metadata": {}, + "outputs": [], + "source": [ + "af.info()" + ] + }, + { + "cell_type": "markdown", + "id": "cdcfe760", + "metadata": {}, + "source": [ + "ASDF is a human readable format, so let's look at the file on disk. There are several things worth pointing out.\n", + "\n", + "\n", + "- An ASDF file has a header which records the version of the ASDF Standard used to write out the file.\n", + "\n", + "- The information about the instrument configuration is stored in one self-contained section.\n", + "\n", + "- The data array is listed as \"unloaded\" (shown above in the Python tree). By default asdf uses lazy loading when opening files. Arrays are loaded into memory only when accessed. This behaviour can be changed through a parameter.\n", + "\n", + "- The description of the data array is within the tree but the binary block and the binary block index are at the end of the file.\n", + "\n", + "- The \"date\" attribute is serialized in isot format. When the file is read in with the Python library, an astropy Time object is directly created.\n", + "\n", + "- (Un)serializing astropy models works in the same way - a model is created in memory when the file is read in.\n", + "\n", + "- When the same object is serialized to disk, it is not copied in the file. Rather a reference to it is created using YAML anchors. In this example **&id002** is the definition of the chebyshev2D model. ***id002** is serialzed as attribute *model2* and is a reference to the original definition of the model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9ccd51b3", + "metadata": {}, + "outputs": [], + "source": [ + "#!less example.asdf\n", + "'''\n", + "#ASDF 1.0.0 \n", + "#ASDF_STANDARD 1.5.0 \n", + "%YAML 1.1 \n", + "%TAG ! tag:stsci.edu:asdf/ \n", + "--- !core/asdf-1.1.0 \n", + "asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',\n", + " name: asdf, version: 2.11.2.dev13+gf9aeb247}\n", + "history:\n", + " extensions:\n", + " - !core/extension_metadata-1.0.0\n", + " extension_class: asdf.extension.BuiltinExtension\n", + " software: !core/software-1.0.0 {name: asdf, version: 2.11.2.dev13+gf9aeb247}\n", + " - !core/extension_metadata-1.0.0\n", + " extension_class: asdf.extension._manifest.ManifestExtension\n", + " extension_uri: asdf://asdf-format.org/transform/extensions/transform-1.5.0\n", + " software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1}\n", + "data: !core/ndarray-1.0.0\n", + " source: 0\n", + " datatype: float64\n", + " byteorder: little\n", + " shape: [5, 6]\n", + "meta:\n", + " date: '2022-05-31T13:29:12.748'\n", + " instrument: {detector: NRCA, filter: FW100W, name: NIRCAM}\n", + " model1: &id002 !transform/ortho_polynomial-1.0.0\n", + " coefficients: !core/ndarray-1.0.0\n", + " source: 1\n", + " datatype: float64\n", + " byteorder: little\n", + " shape: [2, 2]\n", + " inputs: [x, y]\n", + " outputs: [z]\n", + " polynomial_type: chebyshev\n", + " window:\n", + " - &id001 [-1, 1]\n", + " - *id001\n", + " model2: *id002\n", + " telescope: JWST\n", + "...\n", + "BLK^@0^@^@^@^@^@^@^@^@^@^@^@^@^@^@^H^@^@^@^@^@^@^@^H^@^@^@^@^@^@^@^H^@Gb\n", + ".?i/\n", + "<99><99><99><99><99>?<9A><99><99><99><99><99>?#ASDF BLOCK INDEX\n", + "%YAML 1.1\n", + "---\n", + "- 1215\n", + "- 3317\n", + "...\n", + "\n", + "'''" + ] + }, + { + "cell_type": "markdown", + "id": "3e35978f", + "metadata": {}, + "source": [ + "The **asdf** library has search capabilities. A file can be search for an attribute by name, type or value." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "49d2a6e6", + "metadata": {}, + "outputs": [], + "source": [ + "from astropy.modeling.core import Model\n", + "\n", + "af.search(type=Model)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3944743c", + "metadata": {}, + "outputs": [], + "source": [ + "af.search('model')" + ] + }, + { + "cell_type": "markdown", + "id": "8b3e6e38", + "metadata": {}, + "source": [ + "#### Accessing and Modifying a file\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa6541e9", + "metadata": {}, + "outputs": [], + "source": [ + "print(af['meta']['date'])" + ] + }, + { + "cell_type": "markdown", + "id": "0a381e06", + "metadata": {}, + "source": [ + "Reading an custom serialized object creates the object in memory.\n", + "\n", + "For example, the model saved in the file can be directly evaluated." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "21b4bc7b", + "metadata": {}, + "outputs": [], + "source": [ + "chebyshev = af['meta']['model1']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d2ee6d01", + "metadata": {}, + "outputs": [], + "source": [ + "type(chebyshev)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b35ccdf6", + "metadata": {}, + "outputs": [], + "source": [ + "chebyshev(1.2, 2.1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bd8cc87c", + "metadata": {}, + "outputs": [], + "source": [ + "print(af['data'])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "868c0ea2", + "metadata": {}, + "outputs": [], + "source": [ + "af['data'][0,0] = 100" + ] + }, + { + "cell_type": "markdown", + "id": "bb49d1cc", + "metadata": {}, + "source": [ + "By default a file is opened in **r** mode. Once it's opened in **rw** mode, it can be modified." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bc719c85", + "metadata": {}, + "outputs": [], + "source": [ + "af.close()\n", + "\n", + "af_rw = asdf.open('example.asdf', mode='rw')\n", + "\n", + "af_rw['data'][0,0] = 100\n", + "\n", + "print(af_rw['data'])\n", + "af_rw.write_to('example_rw.asdf')" + ] + }, + { + "cell_type": "markdown", + "id": "ec8d5d74", + "metadata": {}, + "source": [ + "### Exercise 1\n", + "\n", + "Using the asdf library open the file provided with the tutorial (**roman.asdf**)\n", + "The file is a simulated image from the Nancy Grace Roman WFI instrument (courtesy of the Roman Instrument Team at STScI), where the data is trimmed to save space.\n", + "\n", + "- Use the **info** and **search** methods to look at the contents of the file.\n", + "- Find the **wcs** attribute.\n", + "- Evaluate the WCS object for some pixel coordinates wihtin the image to calculate the RA, DEC.\n", + "\n", + " Hint: \n", + " - The WCS object is represented using the Generalized World Coordinate System (GWCS) library. It can be evaluated by calling it as a function.\n", + " - GWCS supports the *Astropy Common WCS API*. Use *wcs.pixel_to_world()* to evaluate the same coordinates. The result is an *astropy.coordinates.SkyCoord* object. Use it to transform the result to Galactic cooridnates.\n", + " \n" + ] + }, + { + "cell_type": "markdown", + "id": "d80b3661", + "metadata": {}, + "source": [ + "### Compression\n", + "\n", + "ASDF supports array compression. The currently supported compression types are **zlib**, **bzp2**, **lz4** .\n", + "\n", + "To specify which compression algorithm to use, pass the code to the *set_array_compression* method." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "82392ced", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "ar_zeros = np.zeros((4000, 4000))\n", + "af_rw.set_array_compression(ar_zeros, 'bzp2')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "18b291f1", + "metadata": {}, + "outputs": [], + "source": [ + "af_rw.write_to('compressed.asdf')" + ] + }, + { + "cell_type": "markdown", + "id": "797f367c", + "metadata": {}, + "source": [ + "### Adding *History* items" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1ccdb3a", + "metadata": {}, + "outputs": [], + "source": [ + "af_rw.add_history_entry(\"This file was generated during AAS 240\")" + ] + }, + { + "cell_type": "markdown", + "id": "ad7a45f1", + "metadata": {}, + "source": [ + "### Conclusion\n", + "\n", + "#### Summary\n", + "\n", + "The python library includes optionally extensions which are able to serialize certain astropy objects - models, coordinate frames, units and quantities, tables. It can serialize GWCS objects.\n", + "\n", + "ASDF can serialized custom types, called *tags*. A little work is needed to write *Converters*, which handle the serialization to and deserialization from ASDF files.\n", + "\n", + "The source code for the current extensions is on Github: https://github.com/asdf-format and in the GWCS library at https://github.com/spacetelescope/gwcs.\n", + "\n", + "#### What we didn't cover \n", + "\n", + "ASDF is extensible. It is relatively easy to write an extension which serializes any other Python object. Tutorials are available at https://github.com/asdf-format/tutorials .\n", + "\n", + "ASDF supports compression and there is a mechanism to add custom compression algorithms.\n", + "\n", + "ASDF uses JSON schema to validate the contents of the files. If used this is a powerful way to make sure files are correct. \n", + "\n", + "There's a command line tool **asdftool** which does many of the operations we've shown outside the Python interpreter. Check the options using **asdftool --help**.\n", + "\n", + "ASDF supports the so called **exploded form**. ASDF files can be split into one for the YAML content and one for each of the binary blocks contained within the file, facilitating easier editor access to the YAML, and independent program access to the binary data.\n", + "\n", + "#### Documentation\n", + "\n", + "The ASDF standard is documented at https://asdf-standard.readthedocs.io/en/1.0.2/\n", + "\n", + "Documentation of the Python library is at https://asdf.readthedocs.io/en/stable/\n", + "\n", + "Additional ASDF documentation on various extensions and converters can be found at\n", + "\n", + "https://asdf-astropy.readthedocs.io/en/latest/\n", + "\n", + "\n", + "#### Future work\n", + "\n", + "- Add support for chunking arrays using **zarr**\n", + "\n", + "- Add support for efficient access of large files in the cloud\n", + "\n", + "- Visualization suport\n", + "\n", + "- A C/C++ library, an IDL library?\n", + "\n", + "- Add more compression options\n" + ] + }, + { + "cell_type": "markdown", + "id": "962d8db2", + "metadata": {}, + "source": [ + "### The code used to create *example.asdf* from scratch" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "42e7adfc", + "metadata": {}, + "outputs": [], + "source": [ + "# Create a Time object in isot format\n", + "from astropy import time as atime\n", + "t = atime.Time.now().isot\n", + "\n", + "# Create the data array\n", + "import numpy as np\n", + "data = np.random.randn(30).reshape((5, 6))\n", + "\n", + "# Create a Chebyshev 2D polynomial\n", + "from astropy.modeling.models import *\n", + "p = Chebyshev2D(1, 1)\n", + "p.parameters = .1, .2, .3, .4\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f58b1fe7", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "- Create an empty AsdfFile object\n", + "- Assign the attributes, choosing to assign metadata under a top level *meta* attribute\n", + "- Write the file to disk\n", + "\"\"\"\n", + "jw = asdf.AsdfFile()\n", + "jw['meta']={}\n", + "jw['meta']['telescope'] = 'JWST'\n", + "jw['meta']['instrument'] = {}\n", + "jw['meta']['instrument']['name'] = 'NIRCAM'\n", + "jw['meta']['instrument']['detector'] = 'NRCA'\n", + "jw['meta']['instrument']['filter'] = 'FW100W'\n", + "jw['meta']['date'] = t\n", + "jw['data'] = data\n", + "jw['meta']['model1'] = p\n", + "jw['meta']['model2'] = p\n", + "jw.write_to('example.asdf')\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3c5387ba", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/12-ASDF/README.md b/12-ASDF/README.md new file mode 100644 index 0000000..45e0aa3 --- /dev/null +++ b/12-ASDF/README.md @@ -0,0 +1,3 @@ +### Modeling + +**Authors**: Nadia Dencheva, Perry Greenfield and William Jamieson diff --git a/12-ASDF/roman.asdf b/12-ASDF/roman.asdf new file mode 100644 index 0000000..a5ca31b --- /dev/null +++ b/12-ASDF/roman.asdf @@ -0,0 +1,403 @@ +#ASDF 1.0.0 +#ASDF_STANDARD 1.5.0 +%YAML 1.1 +%TAG ! tag:stsci.edu:asdf/ +--- !core/asdf-1.1.0 +asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf', + name: asdf, version: 2.11.2.dev13+gf9aeb247} +history: + extensions: + - !core/extension_metadata-1.0.0 + extension_class: asdf.extension._manifest.ManifestExtension + extension_uri: asdf://asdf-format.org/astronomy/coordinates/extensions/coordinates-1.0.0 + software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1} + - !core/extension_metadata-1.0.0 + extension_class: asdf.extension.BuiltinExtension + software: !core/software-1.0.0 {name: asdf, version: 2.11.2.dev13+gf9aeb247} + - !core/extension_metadata-1.0.0 + extension_class: asdf.extension._manifest.ManifestExtension + extension_uri: asdf://asdf-format.org/core/extensions/core-1.5.0 + software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1} + - !core/extension_metadata-1.0.0 + extension_class: asdf.extension._manifest.ManifestExtension + extension_uri: asdf://asdf-format.org/transform/extensions/transform-1.5.0 + software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1} + - !core/extension_metadata-1.0.0 + extension_class: asdf.extension._manifest.ManifestExtension + extension_uri: asdf://asdf-format.org/astronomy/gwcs/extensions/gwcs-1.0.0 + software: !core/software-1.0.0 {name: gwcs, version: 0.18.1} +roman: ! + meta: + aperture: ! {name: WFI_CEN, + position_angle: 120} + cal_step: ! {assign_wcs: COMPLETE, + dark: COMPLETE, dq_init: COMPLETE, flat_field: COMPLETE, jump: COMPLETE, linearity: COMPLETE, + photom: COMPLETE, ramp_fit: COMPLETE, saturation: COMPLETE} + calibration_software_version: 0.7.2.dev10+g2d2c5a7 + coordinates: ! {reference_frame: ICRS} + crds_context_used: roman_0032.pmap + crds_software_version: 11.15.0 + ephemeris: ! {earth_angle: 3.3161255787892263, + ephemeris_reference_frame: EME2000, moon_angle: 3.3196162372932148, spatial_x: 100, + spatial_y: 20, spatial_z: 35, sun_angle: 3.316474644639625, time: 59215.0, type: PREDICTED, + velocity_x: 10, velocity_y: 2, velocity_z: 3.5} + exposure: ! {data_problem: false, + duration: 148.96, effective_exposure_time: 135.28, elapsed_exposure_time: 148.96, + end_mjd: 59725.163019444444, end_time: !time/time-1.1.0 '2021-01-01T00:02:28.960', + end_time_mjd: 59215.00172407407, end_time_tdb: 59215.00252481374, exposure_time: 148.96, + frame_divisor: 8, frame_time: 3.04, gain_factor: 2, group_time: 9.12, groupgap: 0, + id: 1, integration_time: 148.96, level0_compressed: true, ma_table_name: High + Latitude Imaging Survey, ma_table_number: 1, mid_mjd: 59725.16215740741, mid_time: !time/time-1.1.0 '2021-01-01T00:01:14.480', + mid_time_mjd: 59215.000862037035, mid_time_tdb: 59215.0016627767, nframes: 8, + ngroups: 6, sca_number: 18, start_mjd: 59725.16129537037, start_time: !time/time-1.1.0 '2021-01-01T00:00:00.000', + start_time_mjd: 59215.0, start_time_tdb: 59215.00080073967, type: WFI_IMAGE} + file_date: !time/time-1.1.0 2022-05-26T15:07:41.126 + filename: r0010001001001001001_01101_0003_WFI18.asdf + guidestar: ! {data_end: 59215.000005787035, + data_start: 59214.99998263889, gs_ctd_ux: 0.0, gs_ctd_uy: 0.0, gs_ctd_x: 0.0, + gs_ctd_y: 0.0, gs_dec: 30.25091085221, gs_epoch: J2000, gs_mag: 17.0, gs_mudec: 0.0, + gs_mura: 0.0, gs_para: 0.02, gs_pattern_error: 0.0, gs_ra: 80.30359022930332, + gs_udec: 0.0, gs_umag: 0.0, gs_ura: 0.0, gw_acq_exec_stat: SUCCESSFUL, gw_fgs_mode: WIM-TRACK, + gw_function_end_time: !time/time-1.1.0 '2021-01-01T00:00:00.500', gw_function_start_time: !time/time-1.1.0 '2020-12-31T23:59:58.500', + gw_id: TEST, gw_start_time: !time/time-1.1.0 '2020-12-31T23:59:58.500', gw_stop_time: !time/time-1.1.0 '2021-01-01T00:00:00.500', + gw_window_xsize: 16, gw_window_xstart: 2040.0, gw_window_ysize: 16, gw_window_ystart: 2040.0} + instrument: ! {detector: WFI18, + name: WFI, optical_element: F158} + model_type: WfiScienceRaw + observation: ! {execution_plan: 1, + exposure: 3, obs_id: '0010001001001001001011010003', observation: 1, observation_label: TEST, + pass: 1, program: 100, segment: 1, survey: N/A, template: NONE, visit: 1, visit_file_activity: '01', + visit_file_group: 1, visit_file_sequence: 1, visit_id: '0010001001001001001'} + origin: STSCI + photometry: ! + conversion_megajanskys: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 MJy.sr**-1, + value: 0.34072752904289383} + conversion_megajanskys_uncertainty: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 MJy.sr**-1, + value: 0.0} + conversion_microjanskys: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 arcsec**-2.uJy, + value: 8.008606539147157} + conversion_microjanskys_uncertainty: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 arcsec**-2.uJy, + value: 0.0} + pixelarea_arcsecsq: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 arcsec**2, + value: 0.011271283149425047} + pixelarea_steradians: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 sr, value: 2.6492509187216547e-13} + pointing: ! {dec_v1: 30.278054573715877, + pa_v3: 0.0, ra_v1: 79.46020983227177} + prd_software_version: 0.0.1 + program: ! {category: GO, + continuation_id: 0, pi_name: 'ROMAN, NANCY G', science_category: NONE, subcategory: NONE, + title: TEST DATA} + ref_file: ! + crds: {context_used: roman_0032.pmap, sw_version: 11.15.0} + sdf_software_version: 0.0.1 + target: ! {catalog_name: GLOBULAR + TEST, dec: 30.030997015952803, dec_uncertainty: 2.777777777777778e-05, proper_motion_dec: 0.0, + proper_motion_epoch: J2000, proper_motion_ra: 0.0, proposer_dec: 30.031, proposer_name: GLOBULAR + TEST, proposer_ra: 79.965, ra: 79.95761402348766, ra_uncertainty: 2.777777777777778e-05, + source_type: EXTENDED, source_type_apt: EXTENDED, type: FIXED} + telescope: ROMAN + velocity_aberration: ! { + dec_offset: 0.0012994248747517645, ra_offset: -0.002096720907928784, scale_factor: 1.0000274179017636} + visit: ! {end_time: !time/time-1.1.0 '2022-05-26T03:54:54.880', + engineering_quality: OK, internal_target: false, pointing_engdb_quality: CALCULATED, + start_time: !time/time-1.1.0 '2022-05-26T03:47:13.000', status: None, target_of_opportunity: false, + total_exposures: 3, type: None} + wcs: ! + name: '' + steps: + - ! + frame: ! + axes_names: [x, y] + axes_order: [0, 1] + axis_physical_types: ['custom:x', 'custom:y'] + name: detector + unit: [!unit/unit-1.0.0 pixel, !unit/unit-1.0.0 pixel] + transform: !transform/compose-1.2.0 + bounding_box: + - [-0.5, 4087.5] + - [-0.5, 4087.5] + forward: + - !transform/compose-1.2.0 + forward: + - !transform/compose-1.2.0 + forward: + - !transform/concatenate-1.2.0 + forward: + - &id001 !transform/shift-1.2.0 + inputs: [x] + offset: 1.0 + outputs: [y] + - *id001 + inputs: [x0, x1] + outputs: [y0, y1] + - !transform/concatenate-1.2.0 + forward: + - !transform/shift-1.2.0 + inputs: [x] + offset: -2044.5 + outputs: [y] + - !transform/shift-1.2.0 + inputs: [x] + offset: -2044.5 + outputs: [y] + inputs: [x0, x1] + outputs: [y0, y1] + inputs: [x0, x1] + outputs: [y0, y1] + - !transform/compose-1.2.0 + forward: + - !transform/compose-1.2.0 + forward: + - !transform/remap_axes-1.3.0 + inputs: [x0, x1] + mapping: [0, 1, 0, 1] + outputs: [x0, x1, x2, x3] + - !transform/concatenate-1.2.0 + forward: + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 0 + datatype: float64 + byteorder: little + shape: [6, 6] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 1 + datatype: float64 + byteorder: little + shape: [6, 6] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + inputs: [x0, y0, x1, y1] + outputs: [z0, z1] + inputs: [x0, x1] + inverse: !transform/compose-1.2.0 + forward: + - !transform/remap_axes-1.3.0 + inputs: [x0, x1] + mapping: [0, 1, 0, 1] + outputs: [x0, x1, x2, x3] + - !transform/concatenate-1.2.0 + forward: + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 2 + datatype: float64 + byteorder: little + shape: [6, 6] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 3 + datatype: float64 + byteorder: little + shape: [6, 6] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + inputs: [x0, y0, x1, y1] + outputs: [z0, z1] + inputs: [x0, x1] + outputs: [z0, z1] + outputs: [z0, z1] + - !transform/compose-1.2.0 + forward: + - !transform/remap_axes-1.3.0 + inputs: [x0, x1] + mapping: [0, 1, 0, 1] + outputs: [x0, x1, x2, x3] + - !transform/concatenate-1.2.0 + forward: + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 4 + datatype: float64 + byteorder: little + shape: [2, 2] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 5 + datatype: float64 + byteorder: little + shape: [2, 2] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + inputs: [x0, y0, x1, y1] + outputs: [z0, z1] + inputs: [x0, x1] + inverse: !transform/compose-1.2.0 + forward: + - !transform/remap_axes-1.3.0 + inputs: [x0, x1] + mapping: [0, 1, 0, 1] + outputs: [x0, x1, x2, x3] + - !transform/concatenate-1.2.0 + forward: + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 6 + datatype: float64 + byteorder: little + shape: [2, 2] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + - !transform/polynomial-1.2.0 + coefficients: !core/ndarray-1.0.0 + source: 7 + datatype: float64 + byteorder: little + shape: [2, 2] + domain: + - [-1, 1] + - [-1, 1] + inputs: [x, y] + outputs: [z] + window: + - [-1, 1] + - [-1, 1] + inputs: [x0, y0, x1, y1] + outputs: [z0, z1] + inputs: [x0, x1] + outputs: [z0, z1] + outputs: [z0, z1] + inputs: [x0, x1] + outputs: [z0, z1] + inputs: [x0, x1] + outputs: [z0, z1] + - !transform/concatenate-1.2.0 + forward: + - !transform/shift-1.2.0 + inputs: [x] + offset: 2622.292618664162 + outputs: [y] + - !transform/shift-1.2.0 + inputs: [x] + offset: -99.46395216083171 + outputs: [y] + inputs: [x0, x1] + outputs: [y0, y1] + inputs: [x0, x1] + outputs: [y0, y1] + - ! + frame: ! + axes_names: [v2, v3] + axes_order: [0, 1] + axis_physical_types: ['custom:v2', 'custom:v3'] + name: v2v3 + unit: [!unit/unit-1.0.0 arcsec, !unit/unit-1.0.0 arcsec] + transform: !transform/compose-1.2.0 + forward: + - !transform/compose-1.2.0 + forward: + - !transform/compose-1.2.0 + forward: + - !transform/concatenate-1.2.0 + forward: + - !transform/scale-1.2.0 + factor: 0.0002777777777777778 + inputs: [x] + outputs: [y] + - !transform/scale-1.2.0 + factor: 0.0002777777777777778 + inputs: [x] + outputs: [y] + inputs: [x0, x1] + outputs: [y0, y1] + - ! + inputs: [lon, lat] + outputs: [x, y, z] + transform_type: spherical_to_cartesian + wrap_lon_at: 180 + inputs: [x0, x1] + outputs: [x, y, z] + - !transform/rotate_sequence_3d-1.0.0 + angles: [0.7284146162956006, 0.027628875600231036, 0.0, 30.25091085221, + -80.30359022930332] + axes_order: zyxyz + inputs: [x, y, z] + outputs: [x, y, z] + rotation_type: cartesian + inputs: [x0, x1] + outputs: [x, y, z] + - ! + inputs: [x, y, z] + outputs: [lon, lat] + transform_type: cartesian_to_spherical + wrap_lon_at: 360 + inputs: [x0, x1] + name: v23tosky + outputs: [lon, lat] + - ! + frame: ! + axes_names: [lon, lat] + axes_order: [0, 1] + axis_physical_types: [pos.eq.ra, pos.eq.dec] + name: world + reference_frame: ! + frame_attributes: {} + unit: [!unit/unit-1.0.0 deg, !unit/unit-1.0.0 deg] + transform: null + wcsinfo: ! {dec_ref: 30.25091085221, + ra_ref: 80.30359022930332, roll_ref: 0.0, s_region: NONE, v2_ref: 2622.292618664162, + v3_ref: -99.46395216083172, v3yangle: -60, vparity: -1} +... +BLK0   8JodpՒa+Rh>{pm=[A<xS2)uu?ع\>8fۮDZic %<DVD +/>aWOЏ!%<tF׵_Cc:ؒ<?Wh376ͼ\p}<yɽa,gJJw>\t=#0+RJ;'WYx>HeB@d<+*=1 ^Pz͘<x;p헊% #BLK0   08/WMkWY`?Ig.?b[6^Y=k"@O8GA%p>[祱=[Z)j]q R>i=_who=$>Kä} \<\thJBLK0   5=ePb/ Aeq#@cx0JҶl>,=IU$@?R;*fW2>!=41=2@kdj xȂDf>W+qi=}PdцSYA +=9IO<8=TyÀ =@lW=BLK0 <II[PYRLXzBLK0 [_dyK4?LXzBLK0 <II[PYRLXzBLK0 [_dyK4?LXz#ASDF BLOCK INDEX +%YAML 1.1 +--- +- 17830 +- 18172 +- 18514 +- 18856 +- 19198 +- 19284 +- 19370 +- 19456 +... diff --git a/README.md b/README.md index eb079ba..dae632a 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,12 @@ As an alternative, a workshop session can be run on mybinder.org via this link: |10:30 - 10:40am | BREAK | | |10:40 - 11:00am | [I/O: FITS and ASCII](05-FITS) | Leo Singer | |11:00 - 11:30am | [Astropy Tables](06-Tables) | Ricky O'Steen | -|11:30 - 12:00pm | Intro to ASDF | Nadia Dencheva | +|11:30 - 12:00pm | [Modeling](07-Models) | Nadia Dencheva | |12:00 - 1:15pm | LUNCH | | |1:15 - 1:35pm | [Visualizing Images with Coordinates](08-Image-coords) | David Shupe | |1:35 - 2:15pm | [Intro to ccdproc and guide](09c-Ccdproc) | Erik Tollerud | |2:15 - 3:00pm | [Photutils](09-Photutils) | *TBD* | -|3:00 - 3:30pm | [Modeling](07-Models) | Nadia Dencheva | +|3:00 - 3:30pm | [Intro to ASDF](12-ASDF) | Nadia Dencheva | |3:30 - 3:45pm | BREAK | | |3:45 - 4:30pm | [Specutils](09b-Specutils) | Ricky O'Steen | |4:30 - 5:00pm | [Astropy Communities & Contributing to Astropy](10-WrapUp) | Erik Tollerud |