{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Vietnam\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from datetime import datetime, timedelta\nfrom opendrift.models.leeway import Leeway\n\no = Leeway(loglevel=20) # Set loglevel to 0 for debug information\n\n# Adding readers for global Thredds datasets:\n# - Ocean forecast from global Hycom\n# - Weather forecast from NOAA/NCEP\no.add_readers_from_list([\n 'https://www.ncei.noaa.gov/thredds-coastal/dodsC/hycom/hycom_sfc_agg/HYCOM_Surface_Aggregation_best.ncd',\n 'https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/ncep_global/NCEP_Global_Atmospheric_Model_best.ncd'])\n\n# Seed some particles\nobject_type = 26 # 26 = Life-raft, no ballast\no.seed_elements(lon=107.8, lat=10.0, radius=1000, number=1000,\n object_type=object_type, time=datetime.utcnow())\n\n# Run model\no.run(duration=timedelta(days=3),\n time_step=timedelta(hours=1),\n time_step_output=timedelta(hours=3))\n\n# Print and plot results\nprint(o)\no.plot(fast=True)\no.animation(fast=True)" ] } ], "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.11.6" } }, "nbformat": 4, "nbformat_minor": 0 }