Skip to content

Instantly share code, notes, and snippets.

@danielballan
Created May 3, 2022 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielballan/94db0189f7642bd6138146ac123d2625 to your computer and use it in GitHub Desktop.
Save danielballan/94db0189f7642bd6138146ac123d2625 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "fleet-sherman",
"metadata": {},
"source": [
"The software environment at `jupyter.nsls2.bnl.gov` uses Databroker version 2.0. The main reason is that Databroker 2.0 is *secure-able*; it is at least *possible* to apply access controls to data. (What exactly those access controls *are* is a matter of policy, out of scope for this document.)\n",
"\n",
"But Databroker 2.0 also comes with some nice usability improvements that you can use if you want, especially for imaging workflows. You can also continue to use the older-style usage; we know there are many notebooks that rely on that, and we don't intend to break them!\n",
"\n",
"First we have a new way of getting set up:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "desperate-center",
"metadata": {},
"outputs": [],
"source": [
"from tiled.client import from_profile\n",
"\n",
"c = from_profile(\"chx\", \"dask\")"
]
},
{
"cell_type": "markdown",
"id": "tender-supervisor",
"metadata": {},
"source": [
"Like `db`, this object lets you access all the data from CHX. Unlike `db` it shows a little more useful information right away."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "vocational-tribute",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Catalog {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...} ~132660 entries>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c"
]
},
{
"cell_type": "markdown",
"id": "mighty-dryer",
"metadata": {},
"source": [
"Searching on `c` returns another `Catalog` with a subset of the entries. Let's narrow it to results since July 2021."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "planned-november",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Catalog {50247, 50248, 50249, 50250, 50251, 50252, 50253, ...} ~1171 entries>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from databroker.queries import TimeRange\n",
"\n",
"# Let's look at just some recent Runs.\n",
"results = c.search(TimeRange(since=\"2021-07\"))\n",
"results"
]
},
{
"cell_type": "markdown",
"id": "spoken-pilot",
"metadata": {},
"source": [
"Let's pick out a specific Run. This works exactly like with `db`. We can access Runs by (numeric) `scan_id` or (string) `uid`."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "blessed-geology",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<BlueskyRun {'primary'} scan_id=50247 uid='f5098dde' 2021-07-01 00:51>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"results[50247]"
]
},
{
"cell_type": "markdown",
"id": "surprised-sender",
"metadata": {},
"source": [
"Let's look at what is in here. This is fast; it doesn't actually read the large array data yet."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "wicked-annotation",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
"Dimensions: (dim_0: 10800, dim_1: 1065, dim_2: 1030, time: 1)\n",
"Coordinates:\n",
" * time (time) float64 1.625e+09\n",
"Dimensions without coordinates: dim_0, dim_1, dim_2\n",
"Data variables:\n",
" eiger1m_single_image (time, dim_0, dim_1, dim_2) float64 dask.array&lt;chunksize=(1, 10, 1065, 1030), meta=np.ndarray&gt;\n",
" eiger1m_single_stats1_total (time) float64 0.0\n",
" eiger1m_single_stats2_total (time) float64 0.0\n",
" eiger1m_single_stats3_total (time) float64 1.638e+14\n",
" eiger1m_single_stats4_total (time) float64 1.638e+14\n",
" eiger1m_single_stats5_total (time) float64 1.638e+14</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-dc05bd9d-697b-479e-84b3-4c8c85a2f328' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-dc05bd9d-697b-479e-84b3-4c8c85a2f328' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>dim_0</span>: 10800</li><li><span>dim_1</span>: 1065</li><li><span>dim_2</span>: 1030</li><li><span class='xr-has-index'>time</span>: 1</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-a4f4d981-bc1a-4794-a717-d215f6a92639' class='xr-section-summary-in' type='checkbox' checked><label for='section-a4f4d981-bc1a-4794-a717-d215f6a92639' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.625e+09</div><input id='attrs-6792d5be-3d13-4310-a47d-7fcc94f8d5bc' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6792d5be-3d13-4310-a47d-7fcc94f8d5bc' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-73be5063-5116-472d-b2f7-c145cdf674e2' class='xr-var-data-in' type='checkbox'><label for='data-73be5063-5116-472d-b2f7-c145cdf674e2' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([1.625126e+09])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-96cc9791-3902-492b-a3d1-e14ba996663a' class='xr-section-summary-in' type='checkbox' checked><label for='section-96cc9791-3902-492b-a3d1-e14ba996663a' class='xr-section-summary' >Data variables: <span>(6)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_image</span></div><div class='xr-var-dims'>(time, dim_0, dim_1, dim_2)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1, 10, 1065, 1030), meta=np.ndarray&gt;</div><input id='attrs-c24fe905-da57-49de-802a-f17234b772ef' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c24fe905-da57-49de-802a-f17234b772ef' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-23c1704a-663a-4c02-b1c8-88273a485ed7' class='xr-var-data-in' type='checkbox'><label for='data-23c1704a-663a-4c02-b1c8-88273a485ed7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 88.27 GiB </td> <td> 83.69 MiB </td></tr>\n",
" <tr><th> Shape </th><td> (1, 10800, 1065, 1030) </td> <td> (1, 10, 1065, 1030) </td></tr>\n",
" <tr><th> Count </th><td> 1080 Tasks </td><td> 1080 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"348\" height=\"159\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"25\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"25\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"25\" y1=\"0\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 25.412616514582485,0.0 25.412616514582485,25.412616514582485 0.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"12.706308\" y=\"45.412617\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
" <text x=\"45.412617\" y=\"12.706308\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,45.412617,12.706308)\">1</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"165\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"95\" y1=\"38\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"95\" y2=\"38\" style=\"stroke-width:2\" />\n",
" <line x1=\"97\" y1=\"2\" x2=\"97\" y2=\"40\" />\n",
" <line x1=\"99\" y1=\"4\" x2=\"99\" y2=\"42\" />\n",
" <line x1=\"101\" y1=\"6\" x2=\"101\" y2=\"45\" />\n",
" <line x1=\"103\" y1=\"8\" x2=\"103\" y2=\"47\" />\n",
" <line x1=\"105\" y1=\"10\" x2=\"105\" y2=\"49\" />\n",
" <line x1=\"108\" y1=\"13\" x2=\"108\" y2=\"51\" />\n",
" <line x1=\"110\" y1=\"15\" x2=\"110\" y2=\"53\" />\n",
" <line x1=\"112\" y1=\"17\" x2=\"112\" y2=\"56\" />\n",
" <line x1=\"114\" y1=\"19\" x2=\"114\" y2=\"58\" />\n",
" <line x1=\"117\" y1=\"22\" x2=\"117\" y2=\"60\" />\n",
" <line x1=\"119\" y1=\"24\" x2=\"119\" y2=\"62\" />\n",
" <line x1=\"121\" y1=\"26\" x2=\"121\" y2=\"64\" />\n",
" <line x1=\"123\" y1=\"28\" x2=\"123\" y2=\"67\" />\n",
" <line x1=\"125\" y1=\"30\" x2=\"125\" y2=\"69\" />\n",
" <line x1=\"128\" y1=\"33\" x2=\"128\" y2=\"71\" />\n",
" <line x1=\"130\" y1=\"35\" x2=\"130\" y2=\"73\" />\n",
" <line x1=\"132\" y1=\"37\" x2=\"132\" y2=\"75\" />\n",
" <line x1=\"134\" y1=\"39\" x2=\"134\" y2=\"78\" />\n",
" <line x1=\"136\" y1=\"41\" x2=\"136\" y2=\"80\" />\n",
" <line x1=\"139\" y1=\"44\" x2=\"139\" y2=\"82\" />\n",
" <line x1=\"141\" y1=\"46\" x2=\"141\" y2=\"84\" />\n",
" <line x1=\"143\" y1=\"48\" x2=\"143\" y2=\"87\" />\n",
" <line x1=\"145\" y1=\"50\" x2=\"145\" y2=\"89\" />\n",
" <line x1=\"147\" y1=\"52\" x2=\"147\" y2=\"91\" />\n",
" <line x1=\"150\" y1=\"55\" x2=\"150\" y2=\"93\" />\n",
" <line x1=\"152\" y1=\"57\" x2=\"152\" y2=\"95\" />\n",
" <line x1=\"154\" y1=\"59\" x2=\"154\" y2=\"98\" />\n",
" <line x1=\"156\" y1=\"61\" x2=\"156\" y2=\"100\" />\n",
" <line x1=\"158\" y1=\"63\" x2=\"158\" y2=\"102\" />\n",
" <line x1=\"161\" y1=\"66\" x2=\"161\" y2=\"104\" />\n",
" <line x1=\"163\" y1=\"68\" x2=\"163\" y2=\"106\" />\n",
" <line x1=\"165\" y1=\"70\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"95.0,0.0 165.58823529411765,70.58823529411765 165.58823529411765,109.107441452518 95.0,38.519206158400344\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"133\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"97\" y1=\"2\" x2=\"135\" y2=\"2\" />\n",
" <line x1=\"99\" y1=\"4\" x2=\"137\" y2=\"4\" />\n",
" <line x1=\"101\" y1=\"6\" x2=\"139\" y2=\"6\" />\n",
" <line x1=\"103\" y1=\"8\" x2=\"142\" y2=\"8\" />\n",
" <line x1=\"105\" y1=\"10\" x2=\"144\" y2=\"10\" />\n",
" <line x1=\"108\" y1=\"13\" x2=\"146\" y2=\"13\" />\n",
" <line x1=\"110\" y1=\"15\" x2=\"148\" y2=\"15\" />\n",
" <line x1=\"112\" y1=\"17\" x2=\"150\" y2=\"17\" />\n",
" <line x1=\"114\" y1=\"19\" x2=\"153\" y2=\"19\" />\n",
" <line x1=\"117\" y1=\"22\" x2=\"155\" y2=\"22\" />\n",
" <line x1=\"119\" y1=\"24\" x2=\"157\" y2=\"24\" />\n",
" <line x1=\"121\" y1=\"26\" x2=\"159\" y2=\"26\" />\n",
" <line x1=\"123\" y1=\"28\" x2=\"161\" y2=\"28\" />\n",
" <line x1=\"125\" y1=\"30\" x2=\"164\" y2=\"30\" />\n",
" <line x1=\"128\" y1=\"33\" x2=\"166\" y2=\"33\" />\n",
" <line x1=\"130\" y1=\"35\" x2=\"168\" y2=\"35\" />\n",
" <line x1=\"132\" y1=\"37\" x2=\"170\" y2=\"37\" />\n",
" <line x1=\"134\" y1=\"39\" x2=\"173\" y2=\"39\" />\n",
" <line x1=\"136\" y1=\"41\" x2=\"175\" y2=\"41\" />\n",
" <line x1=\"139\" y1=\"44\" x2=\"177\" y2=\"44\" />\n",
" <line x1=\"141\" y1=\"46\" x2=\"179\" y2=\"46\" />\n",
" <line x1=\"143\" y1=\"48\" x2=\"181\" y2=\"48\" />\n",
" <line x1=\"145\" y1=\"50\" x2=\"184\" y2=\"50\" />\n",
" <line x1=\"147\" y1=\"52\" x2=\"186\" y2=\"52\" />\n",
" <line x1=\"150\" y1=\"55\" x2=\"188\" y2=\"55\" />\n",
" <line x1=\"152\" y1=\"57\" x2=\"190\" y2=\"57\" />\n",
" <line x1=\"154\" y1=\"59\" x2=\"192\" y2=\"59\" />\n",
" <line x1=\"156\" y1=\"61\" x2=\"195\" y2=\"61\" />\n",
" <line x1=\"158\" y1=\"63\" x2=\"197\" y2=\"63\" />\n",
" <line x1=\"161\" y1=\"66\" x2=\"199\" y2=\"66\" />\n",
" <line x1=\"163\" y1=\"68\" x2=\"201\" y2=\"68\" />\n",
" <line x1=\"165\" y1=\"70\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"165\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"133\" y1=\"0\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"95.0,0.0 133.3325253747995,0.0 203.92076066891715,70.58823529411765 165.58823529411765,70.58823529411765\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"165\" y1=\"70\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"165\" y1=\"109\" x2=\"203\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"165\" y1=\"70\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
" <line x1=\"203\" y1=\"70\" x2=\"203\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"165.58823529411765,70.58823529411765 203.92076066891715,70.58823529411765 203.92076066891715,109.107441452518 165.58823529411765,109.107441452518\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"184.754498\" y=\"129.107441\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1030</text>\n",
" <text x=\"223.920761\" y=\"89.847838\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,223.920761,89.847838)\">1065</text>\n",
" <text x=\"120.294118\" y=\"93.813324\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,120.294118,93.813324)\">10800</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_stats1_total</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0</div><input id='attrs-1f37b5fa-c8d8-4667-bbdc-6b1a8e55a92e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-1f37b5fa-c8d8-4667-bbdc-6b1a8e55a92e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-09bac743-a2da-45c5-8cfe-330b2567bcaf' class='xr-var-data-in' type='checkbox'><label for='data-09bac743-a2da-45c5-8cfe-330b2567bcaf' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><pre>array([0.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_stats2_total</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0</div><input id='attrs-6757200b-d328-4f4b-8421-597a27c165d3' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-6757200b-d328-4f4b-8421-597a27c165d3' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7b52e507-9664-4654-9602-42443a42909e' class='xr-var-data-in' type='checkbox'><label for='data-7b52e507-9664-4654-9602-42443a42909e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><pre>array([0.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_stats3_total</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.638e+14</div><input id='attrs-7b765db2-f9cd-4f5c-b618-1e756bfb9333' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-7b765db2-f9cd-4f5c-b618-1e756bfb9333' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1d134eea-bac2-4271-ba69-1680bb4e8d0d' class='xr-var-data-in' type='checkbox'><label for='data-1d134eea-bac2-4271-ba69-1680bb4e8d0d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><pre>array([1.63822938e+14])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_stats4_total</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.638e+14</div><input id='attrs-5c3e6559-748e-4e5e-9a61-e7dcc67cad8a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-5c3e6559-748e-4e5e-9a61-e7dcc67cad8a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-92d208aa-0994-4521-8696-98e343e8001e' class='xr-var-data-in' type='checkbox'><label for='data-92d208aa-0994-4521-8696-98e343e8001e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><pre>array([1.63822938e+14])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>eiger1m_single_stats5_total</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.638e+14</div><input id='attrs-88242971-4ad4-4d77-9859-758fd23ee762' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-88242971-4ad4-4d77-9859-758fd23ee762' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-208f575d-69ca-4f80-9041-3a372a27214c' class='xr-var-data-in' type='checkbox'><label for='data-208f575d-69ca-4f80-9041-3a372a27214c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div><div class='xr-var-data'><pre>array([1.63822938e+14])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-8fca3ad5-63a5-45c9-a8ec-d41b06b541f6' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-8fca3ad5-63a5-45c9-a8ec-d41b06b541f6' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (dim_0: 10800, dim_1: 1065, dim_2: 1030, time: 1)\n",
"Coordinates:\n",
" * time (time) float64 1.625e+09\n",
"Dimensions without coordinates: dim_0, dim_1, dim_2\n",
"Data variables:\n",
" eiger1m_single_image (time, dim_0, dim_1, dim_2) float64 dask.array<chunksize=(1, 10, 1065, 1030), meta=np.ndarray>\n",
" eiger1m_single_stats1_total (time) float64 0.0\n",
" eiger1m_single_stats2_total (time) float64 0.0\n",
" eiger1m_single_stats3_total (time) float64 1.638e+14\n",
" eiger1m_single_stats4_total (time) float64 1.638e+14\n",
" eiger1m_single_stats5_total (time) float64 1.638e+14"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds = results[50247]['primary'].read() # 'ds' is short for 'dataset'\n",
"ds"
]
},
{
"cell_type": "markdown",
"id": "abroad-alcohol",
"metadata": {},
"source": [
"Let's pull out an image. We can see below its dimensions and size in bytes. This is useful because it gives us a sense of how expensive it would be to load and/or process.\n",
"\n",
"Notice that Area Detector images are always 4D. The first axis the \"Event\" axis. For time series it will have 1 element; for scans it will have more. The second axis represents images within one \"acquisition\". The third and fourth axes are, of course, the dimension on the face of the detector."
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "whole-cleaners",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;eiger1m_single_image&#x27; (time: 1, dim_0: 10800, dim_1: 1065, dim_2: 1030)&gt;\n",
"dask.array&lt;remote-dask-array-http://local-tiled-app/metadata/f5098dde-7d32-4de8-8749, shape=(1, 10800, 1065, 1030), dtype=float64, chunksize=(1, 10, 1065, 1030), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" * time (time) float64 1.625e+09\n",
"Dimensions without coordinates: dim_0, dim_1, dim_2\n",
"Attributes:\n",
" object: eiger1m_single</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'eiger1m_single_image'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>time</span>: 1</li><li><span>dim_0</span>: 10800</li><li><span>dim_1</span>: 1065</li><li><span>dim_2</span>: 1030</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-82088d4c-6cda-40d1-b7fc-62c45870ad9d' class='xr-array-in' type='checkbox' checked><label for='section-82088d4c-6cda-40d1-b7fc-62c45870ad9d' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(1, 10, 1065, 1030), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 88.27 GiB </td> <td> 83.69 MiB </td></tr>\n",
" <tr><th> Shape </th><td> (1, 10800, 1065, 1030) </td> <td> (1, 10, 1065, 1030) </td></tr>\n",
" <tr><th> Count </th><td> 1080 Tasks </td><td> 1080 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"348\" height=\"159\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"25\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"25\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"25\" y1=\"0\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 25.412616514582485,0.0 25.412616514582485,25.412616514582485 0.0,25.412616514582485\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"12.706308\" y=\"45.412617\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1</text>\n",
" <text x=\"45.412617\" y=\"12.706308\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,45.412617,12.706308)\">1</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"165\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"95\" y1=\"38\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"95\" y2=\"38\" style=\"stroke-width:2\" />\n",
" <line x1=\"97\" y1=\"2\" x2=\"97\" y2=\"40\" />\n",
" <line x1=\"99\" y1=\"4\" x2=\"99\" y2=\"42\" />\n",
" <line x1=\"101\" y1=\"6\" x2=\"101\" y2=\"45\" />\n",
" <line x1=\"103\" y1=\"8\" x2=\"103\" y2=\"47\" />\n",
" <line x1=\"105\" y1=\"10\" x2=\"105\" y2=\"49\" />\n",
" <line x1=\"108\" y1=\"13\" x2=\"108\" y2=\"51\" />\n",
" <line x1=\"110\" y1=\"15\" x2=\"110\" y2=\"53\" />\n",
" <line x1=\"112\" y1=\"17\" x2=\"112\" y2=\"56\" />\n",
" <line x1=\"114\" y1=\"19\" x2=\"114\" y2=\"58\" />\n",
" <line x1=\"117\" y1=\"22\" x2=\"117\" y2=\"60\" />\n",
" <line x1=\"119\" y1=\"24\" x2=\"119\" y2=\"62\" />\n",
" <line x1=\"121\" y1=\"26\" x2=\"121\" y2=\"64\" />\n",
" <line x1=\"123\" y1=\"28\" x2=\"123\" y2=\"67\" />\n",
" <line x1=\"125\" y1=\"30\" x2=\"125\" y2=\"69\" />\n",
" <line x1=\"128\" y1=\"33\" x2=\"128\" y2=\"71\" />\n",
" <line x1=\"130\" y1=\"35\" x2=\"130\" y2=\"73\" />\n",
" <line x1=\"132\" y1=\"37\" x2=\"132\" y2=\"75\" />\n",
" <line x1=\"134\" y1=\"39\" x2=\"134\" y2=\"78\" />\n",
" <line x1=\"136\" y1=\"41\" x2=\"136\" y2=\"80\" />\n",
" <line x1=\"139\" y1=\"44\" x2=\"139\" y2=\"82\" />\n",
" <line x1=\"141\" y1=\"46\" x2=\"141\" y2=\"84\" />\n",
" <line x1=\"143\" y1=\"48\" x2=\"143\" y2=\"87\" />\n",
" <line x1=\"145\" y1=\"50\" x2=\"145\" y2=\"89\" />\n",
" <line x1=\"147\" y1=\"52\" x2=\"147\" y2=\"91\" />\n",
" <line x1=\"150\" y1=\"55\" x2=\"150\" y2=\"93\" />\n",
" <line x1=\"152\" y1=\"57\" x2=\"152\" y2=\"95\" />\n",
" <line x1=\"154\" y1=\"59\" x2=\"154\" y2=\"98\" />\n",
" <line x1=\"156\" y1=\"61\" x2=\"156\" y2=\"100\" />\n",
" <line x1=\"158\" y1=\"63\" x2=\"158\" y2=\"102\" />\n",
" <line x1=\"161\" y1=\"66\" x2=\"161\" y2=\"104\" />\n",
" <line x1=\"163\" y1=\"68\" x2=\"163\" y2=\"106\" />\n",
" <line x1=\"165\" y1=\"70\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"95.0,0.0 165.58823529411765,70.58823529411765 165.58823529411765,109.107441452518 95.0,38.519206158400344\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"133\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"97\" y1=\"2\" x2=\"135\" y2=\"2\" />\n",
" <line x1=\"99\" y1=\"4\" x2=\"137\" y2=\"4\" />\n",
" <line x1=\"101\" y1=\"6\" x2=\"139\" y2=\"6\" />\n",
" <line x1=\"103\" y1=\"8\" x2=\"142\" y2=\"8\" />\n",
" <line x1=\"105\" y1=\"10\" x2=\"144\" y2=\"10\" />\n",
" <line x1=\"108\" y1=\"13\" x2=\"146\" y2=\"13\" />\n",
" <line x1=\"110\" y1=\"15\" x2=\"148\" y2=\"15\" />\n",
" <line x1=\"112\" y1=\"17\" x2=\"150\" y2=\"17\" />\n",
" <line x1=\"114\" y1=\"19\" x2=\"153\" y2=\"19\" />\n",
" <line x1=\"117\" y1=\"22\" x2=\"155\" y2=\"22\" />\n",
" <line x1=\"119\" y1=\"24\" x2=\"157\" y2=\"24\" />\n",
" <line x1=\"121\" y1=\"26\" x2=\"159\" y2=\"26\" />\n",
" <line x1=\"123\" y1=\"28\" x2=\"161\" y2=\"28\" />\n",
" <line x1=\"125\" y1=\"30\" x2=\"164\" y2=\"30\" />\n",
" <line x1=\"128\" y1=\"33\" x2=\"166\" y2=\"33\" />\n",
" <line x1=\"130\" y1=\"35\" x2=\"168\" y2=\"35\" />\n",
" <line x1=\"132\" y1=\"37\" x2=\"170\" y2=\"37\" />\n",
" <line x1=\"134\" y1=\"39\" x2=\"173\" y2=\"39\" />\n",
" <line x1=\"136\" y1=\"41\" x2=\"175\" y2=\"41\" />\n",
" <line x1=\"139\" y1=\"44\" x2=\"177\" y2=\"44\" />\n",
" <line x1=\"141\" y1=\"46\" x2=\"179\" y2=\"46\" />\n",
" <line x1=\"143\" y1=\"48\" x2=\"181\" y2=\"48\" />\n",
" <line x1=\"145\" y1=\"50\" x2=\"184\" y2=\"50\" />\n",
" <line x1=\"147\" y1=\"52\" x2=\"186\" y2=\"52\" />\n",
" <line x1=\"150\" y1=\"55\" x2=\"188\" y2=\"55\" />\n",
" <line x1=\"152\" y1=\"57\" x2=\"190\" y2=\"57\" />\n",
" <line x1=\"154\" y1=\"59\" x2=\"192\" y2=\"59\" />\n",
" <line x1=\"156\" y1=\"61\" x2=\"195\" y2=\"61\" />\n",
" <line x1=\"158\" y1=\"63\" x2=\"197\" y2=\"63\" />\n",
" <line x1=\"161\" y1=\"66\" x2=\"199\" y2=\"66\" />\n",
" <line x1=\"163\" y1=\"68\" x2=\"201\" y2=\"68\" />\n",
" <line x1=\"165\" y1=\"70\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"95\" y1=\"0\" x2=\"165\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"133\" y1=\"0\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"95.0,0.0 133.3325253747995,0.0 203.92076066891715,70.58823529411765 165.58823529411765,70.58823529411765\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"165\" y1=\"70\" x2=\"203\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"165\" y1=\"109\" x2=\"203\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"165\" y1=\"70\" x2=\"165\" y2=\"109\" style=\"stroke-width:2\" />\n",
" <line x1=\"203\" y1=\"70\" x2=\"203\" y2=\"109\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"165.58823529411765,70.58823529411765 203.92076066891715,70.58823529411765 203.92076066891715,109.107441452518 165.58823529411765,109.107441452518\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"184.754498\" y=\"129.107441\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1030</text>\n",
" <text x=\"223.920761\" y=\"89.847838\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,223.920761,89.847838)\">1065</text>\n",
" <text x=\"120.294118\" y=\"93.813324\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,120.294118,93.813324)\">10800</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table></div></div></li><li class='xr-section-item'><input id='section-f001a91e-93ce-4afb-a291-ffa1536cb295' class='xr-section-summary-in' type='checkbox' checked><label for='section-f001a91e-93ce-4afb-a291-ffa1536cb295' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.625e+09</div><input id='attrs-421b1d0c-5054-41e2-be7f-b072d2398a9c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-421b1d0c-5054-41e2-be7f-b072d2398a9c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-14e644b8-fc6d-46d4-af9a-e6c292508520' class='xr-var-data-in' type='checkbox'><label for='data-14e644b8-fc6d-46d4-af9a-e6c292508520' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([1.625126e+09])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-8eb7519f-9b63-431b-b211-d3a839efdb90' class='xr-section-summary-in' type='checkbox' checked><label for='section-8eb7519f-9b63-431b-b211-d3a839efdb90' class='xr-section-summary' >Attributes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'eiger1m_single_image' (time: 1, dim_0: 10800, dim_1: 1065, dim_2: 1030)>\n",
"dask.array<remote-dask-array-http://local-tiled-app/metadata/f5098dde-7d32-4de8-8749, shape=(1, 10800, 1065, 1030), dtype=float64, chunksize=(1, 10, 1065, 1030), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" * time (time) float64 1.625e+09\n",
"Dimensions without coordinates: dim_0, dim_1, dim_2\n",
"Attributes:\n",
" object: eiger1m_single"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"img = ds['eiger1m_single_image']\n",
"img"
]
},
{
"cell_type": "markdown",
"id": "increasing-danger",
"metadata": {},
"source": [
"Let's slice into the 4D image array `img` to obtain a 2D array (one image frame) that we can visualize."
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "unknown-malta",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;eiger1m_single_image&#x27; (dim_1: 1065, dim_2: 1030)&gt;\n",
"dask.array&lt;getitem, shape=(1065, 1030), dtype=float64, chunksize=(1065, 1030), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" time float64 1.625e+09\n",
"Dimensions without coordinates: dim_1, dim_2\n",
"Attributes:\n",
" object: eiger1m_single</pre><div class='xr-wrap' hidden><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'eiger1m_single_image'</div><ul class='xr-dim-list'><li><span>dim_1</span>: 1065</li><li><span>dim_2</span>: 1030</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-0acefd04-6db4-4f5a-abf6-0b4ff51f2d1e' class='xr-array-in' type='checkbox' checked><label for='section-0acefd04-6db4-4f5a-abf6-0b4ff51f2d1e' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(1065, 1030), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 8.37 MiB </td> <td> 8.37 MiB </td></tr>\n",
" <tr><th> Shape </th><td> (1065, 1030) </td> <td> (1065, 1030) </td></tr>\n",
" <tr><th> Count </th><td> 1081 Tasks </td><td> 1 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"166\" height=\"170\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"116\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"120\" x2=\"116\" y2=\"120\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"116\" y1=\"0\" x2=\"116\" y2=\"120\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 116.05633802816901,0.0 116.05633802816901,120.0 0.0,120.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"58.028169\" y=\"140.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1030</text>\n",
" <text x=\"136.056338\" y=\"60.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,136.056338,60.000000)\">1065</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table></div></div></li><li class='xr-section-item'><input id='section-a72f4edc-eb2d-4e62-833b-0fbfe873332e' class='xr-section-summary-in' type='checkbox' checked><label for='section-a72f4edc-eb2d-4e62-833b-0fbfe873332e' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>time</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.625e+09</div><input id='attrs-dd65d277-455e-44e6-9e60-ba3ff91ea763' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-dd65d277-455e-44e6-9e60-ba3ff91ea763' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8ff98ded-ca97-4fcd-9d5e-b293fe32d52d' class='xr-var-data-in' type='checkbox'><label for='data-8ff98ded-ca97-4fcd-9d5e-b293fe32d52d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(1.6251259e+09)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-d34d07ee-e114-4c54-b194-fb1947f15de9' class='xr-section-summary-in' type='checkbox' checked><label for='section-d34d07ee-e114-4c54-b194-fb1947f15de9' class='xr-section-summary' >Attributes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>object :</span></dt><dd>eiger1m_single</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'eiger1m_single_image' (dim_1: 1065, dim_2: 1030)>\n",
"dask.array<getitem, shape=(1065, 1030), dtype=float64, chunksize=(1065, 1030), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" time float64 1.625e+09\n",
"Dimensions without coordinates: dim_1, dim_2\n",
"Attributes:\n",
" object: eiger1m_single"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"frame = img[0, 0]\n",
"frame"
]
},
{
"cell_type": "markdown",
"id": "drawn-consideration",
"metadata": {},
"source": [
"If we hand this to matplotlib, matplotlib will cause it to finally be loaded and plot it."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "revised-cannon",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2ce76c2303914ae9acaaf0855f1469cc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x2b4ff2aec850>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib widget\n",
"\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.imshow(frame, vmax=1000)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "possible-sewing",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment