{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Code route to capturing movies of multiple regions in an IDV bundle\n", "\n", "### From a current-weather IDV bundle\n", "\n", "## Note: may take a few minutes, during which time if ties up your IDV session" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Hide the GUI while loading ipython_IDV\n", "\n", "import os\n", "os.environ['drilsdown.showui'] = \"False\"\n", "%reload_ext ipython_IDV\n", "\n", "from ipython_IDV import Idv" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Set the URL to a bundle file on RAMADDA, s simple test case\n", "# https://geodesystems.com/repository/entry/show/example_grid.xidv?entryid=4728e5eb-fa89-4af8-8162-e2f66a9cd0c9\n", " \n", "# Change /show? to /get? in the URL above to make it work here: \n", "Idv.file_url =\"https://geodesystems.com/repository/entry/get/example_grid.xidv?entryid=4728e5eb-fa89-4af8-8162-e2f66a9cd0c9\"\n", "\n", "# Set a few bounding boxes for the image regions you'd like to capture\n", "bboxes = [[50,-130,40,-100],[50,-100,40,-75]]\n", "\n", "# Loop over your bounding boxes, capturing movies (just one time in this simple bundle)\n", "for i in range(len(bboxes)):\n", " bbox=bboxes[i];\n", " Idv.load_bundle(Idv.file_url,bbox);\n", " label = \"BBOX:\" + repr(bbox[0]) +\"/\" + repr(bbox[1]) +\" \" + repr(bbox[2]) +\"/\" + repr(bbox[3]);\n", " Idv.make_movie(caption=label,display=True)\n" ] } ], "metadata": { "anaconda-cloud": {}, "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.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }