{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Patrick BROCKMANN - LSCE (Climate and Environment Sciences Laboratory)
\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Updated: 2019/11/13" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Load the ferret extension" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext ferretmagic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Explore usage of %ferret_run line magic" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for i in [100,500,1000]:\n", " %ferret_run -s 300,300 'set text/font=arial ; plot/thick=2 sin(i[i=1:%(i)s]*0.1)' % locals()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Another example" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "%%ferret\n", "use levitus_climatology" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for i in range(1,3):\n", " %ferret_run -q -s 400,300 'set text/font=arial ; fill salt[k=%(i)s] ; go land' % locals()" ] } ], "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.7.3" } }, "nbformat": 4, "nbformat_minor": 1 }