{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Activate packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "using Plots" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Read two-dimensional arrays for lon, lat, drwn3_Rirr, and cci_Rrs_490" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "done\n" ] } ], "source": [ "dirIn=\"samples/\"\n", "\n", "fld = Array{Float32,2}(undef,(720,360))\n", "fid = open(dirIn*\"lon.bin\"); read!(fid,fld); lon = hton.(fld)\n", "\n", "fld = Array{Float32,2}(undef,(720,360))\n", "fid = open(dirIn*\"lat.bin\"); read!(fid,fld); lat = hton.(fld)\n", "\n", "fld = Array{Float32,2}(undef,(720,360))\n", "fid = open(dirIn*\"cci_Rrs_490.bin\"); read!(fid,fld); cci_Rrs_490 = hton.(fld)\n", "cci_Rrs_490[findall(cci_Rrs_490.==0)].=NaN\n", "\n", "fld = Array{Float32,3}(undef,(720,360,13));\n", "fid = open(dirIn*\"drwn3_Rirr.bin\"); read!(fid,fld); drwn3_Rirr = hton.(fld)\n", "drwn3_Rirr[findall(drwn3_Rirr.==0)].=NaN\n", "\n", "println(\"done\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Display cci and model fields" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "-150\n", "\n", "\n", "-100\n", "\n", "\n", "-50\n", "\n", "\n", "0\n", "\n", "\n", "50\n", "\n", "\n", "100\n", "\n", "\n", "150\n", "\n", "\n", "-90\n", "\n", "\n", "-60\n", "\n", "\n", "-30\n", "\n", "\n", "0\n", "\n", "\n", "30\n", "\n", "\n", "60\n", "\n", "\n", "90\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "0.005\n", "\n", "\n", "0.010\n", "\n", "\n", "0.015\n", "\n", "\n", "0.020\n", "\n", "\n", "0.025\n", "\n", "\n", "0.030\n", "\n", "\n", "0.035\n", "\n", "\n", "0.040\n", "\n", "\n", "\n", "\n", "\n", "\n" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heatmap(vec(lon[:,1]),vec(lat[1,:]), transpose(cci_Rrs_490))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "-150\n", "\n", "\n", "-100\n", "\n", "\n", "-50\n", "\n", "\n", "0\n", "\n", "\n", "50\n", "\n", "\n", "100\n", "\n", "\n", "150\n", "\n", "\n", "-90\n", "\n", "\n", "-60\n", "\n", "\n", "-30\n", "\n", "\n", "0\n", "\n", "\n", "30\n", "\n", "\n", "60\n", "\n", "\n", "90\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "0.01\n", "\n", "\n", "0.02\n", "\n", "\n", "0.03\n", "\n", "\n", "0.04\n", "\n", "\n", "0.05\n", "\n", "\n", "0.06\n", "\n", "\n", "0.07\n", "\n", "\n", "\n", "\n", "\n", "\n" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heatmap(vec(lon[:,1]),vec(lat[1,:]), transpose(drwn3_Rirr[:,:,3]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Activate packages" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Your turn!\n", "\n", "- Take code snipets from `OceanColourAlgorithms.ipynb`\n", "- Turn them into functions\n", "- Apply to all points in `drwn3_Rirr`\n", "- Plot the resulting map of `Rrs`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.1.0", "language": "julia", "name": "julia-1.1" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.1.0" } }, "nbformat": 4, "nbformat_minor": 2 }