{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Code to make old runoff files ##\n", "note: make_old_runoffs.yaml is identical to nowcast.yaml but puts the river output files somewhere other that /results to avoid accidental overwriting" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import arrow\n", "from nowcast.workers import make_runoff_file\n", "from types import SimpleNamespace\n", "import yaml" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "start = arrow.get(2014, 9, 11)\n", "end = arrow.get(2014, 9, 30)\n", "with open('../config/make_old_runoffs.yaml', 'rt') as f:\n", " config = yaml.safe_load(f)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d10.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d10.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d11.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d11.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d12.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d12.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d13.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d13.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d14.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d14.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d15.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d15.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d16.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d16.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d17.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d17.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d18.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d18.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d19.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d19.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d20.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d20.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d21.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d21.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d22.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d22.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d23.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d23.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d24.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d24.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d25.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d25.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d26.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d26.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d27.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d27.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d28.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d28.nc'}\n", "{'long': '/data/sallen/MEOPAR/forcing/RLonFraCElse_y2014m09d29.nc', 'allArms': '/data/sallen/MEOPAR/forcing/RallFraCElse_y2014m09d29.nc'}\n" ] } ], "source": [ "for day in arrow.Arrow.range('day', start, end):\n", " args = SimpleNamespace(run_date=day)\n", " checklist = make_runoff_file.make_runoff_file(args, config)\n", " print (checklist)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "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.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }