Skip to content

Commit

Permalink
Add zarr streaming example.
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Jun 7, 2024
1 parent dc2f60a commit 3297b56
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
22 changes: 20 additions & 2 deletions talks/FrevaZarrStreaming/LoadData.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@
"res = requests.get(\n",
" f\"{url}/api/databrowser/load/freva\", \n",
" params=search_params, \n",
" headers={\"Authorization\": f\"Bearer {auth['access_token']}\"},\n",
" headers={\n",
" \"Authorization\": f\"Bearer {auth['access_token']\n",
" }\"},\n",
" stream=True\n",
")"
]
Expand Down Expand Up @@ -1027,7 +1029,7 @@
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
"slide_type": "slide"
},
"tags": []
},
Expand Down Expand Up @@ -1071,6 +1073,22 @@
"source": [
"dset[\"ua\"].mean(dim=(\"lon\", \"lat\")).plot(x=\"time\", yincrease=False)"
]
},
{
"cell_type": "markdown",
"id": "43e6475e-e1ad-4aff-a3e9-4d165bc47bfb",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"## What's next?\n",
"- Add json payload to `load` endpoint that allows the users to pre-precess data. For example select a region by uploading a geojson shape file.\n",
"- Implement a backend handle to open tape archives"
]
}
],
"metadata": {
Expand Down
20 changes: 18 additions & 2 deletions talks/FrevaZarrStreaming/index.slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -7611,7 +7611,9 @@ <h3 id="Workflow">Workflow<a class="anchor-link" href="#Workflow">¶</a></h3><ul
<div class="highlight hl-ipython3"><pre><span></span><span class="n">res</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">url</span><span class="si">}</span><span class="s2">/api/databrowser/load/freva"</span><span class="p">,</span>
<span class="n">params</span><span class="o">=</span><span class="n">search_params</span><span class="p">,</span>
<span class="n">headers</span><span class="o">=</span><span class="p">{</span><span class="s2">"Authorization"</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"Bearer </span><span class="si">{</span><span class="n">auth</span><span class="p">[</span><span class="s1">'access_token'</span><span class="p">]</span><span class="si">}</span><span class="s2">"</span><span class="p">},</span>
<span class="n">headers</span><span class="o">=</span><span class="p">{</span>
<span class="s2">"Authorization"</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"Bearer </span><span class="si">{</span><span class="n">auth</span><span class="p">[</span><span class="s1">'access_token'</span><span class="p">]</span>
<span class="w"> </span><span class="si">}</span><span class="s2">"</span><span class="p">},</span>
<span class="n">stream</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>
</pre></div>
Expand Down Expand Up @@ -8364,7 +8366,7 @@ <h3 id="Workflow">Workflow<a class="anchor-link" href="#Workflow">¶</a></h3><ul
</div>
</div>
</div>
</div>
</div></section></section><section><section>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=bbb5b7d1-a330-43dc-877c-639a420de085">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
Expand Down Expand Up @@ -8407,6 +8409,20 @@ <h3 id="Workflow">Workflow<a class="anchor-link" href="#Workflow">¶</a></h3><ul
</div>
</div>
</div>
</div></section></section><section><section>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=43e6475e-e1ad-4aff-a3e9-4d165bc47bfb">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
<h2 id="What's-next?">What's next?<a class="anchor-link" href="#What's-next?"></a></h2><ul>
<li>Add json payload to <code>load</code> endpoint that allows the users to pre-precess data. For example select a region by uploading a geojson shape file.</li>
<li>Implement a backend handle to open tape archives</li>
</ul>
</div>
</div>
</div>
</div></section></section>
</div>
</div>
Expand Down

0 comments on commit 3297b56

Please sign in to comment.