{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Fish Eggs and Larvae\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from datetime import datetime, timedelta\nfrom opendrift.readers.reader_constant import Reader as ConstantReader\nfrom opendrift.models.larvalfish import LarvalFish\n\no = LarvalFish(loglevel=50)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "No horizontal movement, here only investigating vertical mixing and swimming\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "r = ConstantReader(\n {'x_sea_water_velocity': 0, 'y_sea_water_velocity': 0, 'x_wind': 0, 'y_wind': 0,\n 'sea_water_temperature': 10,\n 'land_binary_mask': 0, 'ocean_vertical_diffusivity': .02})\no.add_reader(r)\no.set_config('general:use_auto_landmask', False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Seeding 20 fish eggs, which will hatch as larvae after some time, depending om temperature\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "time = datetime(2020, 7, 1, 12)\no.seed_elements(lon=4, lat=60, time=[time, time+timedelta(hours=24)], number=20)\n\no.run(duration=timedelta(days=40))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After 20 days eggs are hatched as Larvae, and starting to grow\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.plot_property('weight')\no.plot_property('length')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We see that larvae (after hatching) avoid the upper meters at daytime, to avoid predators.\nVertical motion is a combination of vertical mixing, buoyancy and swimming.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.plot_property('z')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Mean daily depth shows more clearly the diurnal migration of larvae\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.plot_property('z', mean=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 }