diff --git a/notebooks/lubis_et_al_2024/develop_ncforce_interface.ipynb b/notebooks/lubis_et_al_2024/develop_ncforce_interface.ipynb index 2cce403..608a2ee 100644 --- a/notebooks/lubis_et_al_2024/develop_ncforce_interface.ipynb +++ b/notebooks/lubis_et_al_2024/develop_ncforce_interface.ipynb @@ -47,7 +47,8 @@ "source": [ "import numpy as np\n", "import xarray as xr\n", - "import matplotlib.pyplot as plt" + "import matplotlib.pyplot as plt\n", + "from falwa.utilities import zonal_convergence" ] }, { @@ -58,13 +59,13 @@ "outputs": [], "source": [ "# Load MERRA2 dataset\n", - "uvt_data = xr.open_mfdataset(\"data/MERRA2/[UVT].1980.daily.nc\")\n", - "dtdtlwr_data = xr.open_mfdataset(\"data/MERRA2/DTDTLWR.1980.daily.nc\")" + "uvt_data = xr.open_mfdataset(\"MERRA2/[UVT].1980.daily.nc\")\n", + "dtdtlwr_data = xr.open_mfdataset(\"MERRA2/DTDTLWR.1980.daily.nc\")" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 6, "id": "e48e2173-9f7c-4554-8346-7b2894a36539", "metadata": {}, "outputs": [ @@ -447,10 +448,10 @@ " CDI: Climate Data Interface version 2.0.3 (https://mpimet.mpg.de...\n", " Conventions: CF-1.6\n", " history: Thu Jan 02 14:12:54 2025: cdo seldate,1980-01-01,1980-01-07...\n", - " CDO: Climate Data Operators version 2.0.3 (https://mpimet.mpg.de...
array(['1980-01-01T12:00:00.000000000', '1980-01-02T12:00:00.000000000',\n", + " CDO: Climate Data Operators version 2.0.3 (https://mpimet.mpg.de...
array(['1980-01-01T12:00:00.000000000', '1980-01-02T12:00:00.000000000',\n", " '1980-01-03T12:00:00.000000000', '1980-01-04T12:00:00.000000000',\n", " '1980-01-05T12:00:00.000000000', '1980-01-06T12:00:00.000000000',\n", - " '1980-01-07T12:00:00.000000000'], dtype='datetime64[ns]')
array([ 0., 1., 2., ..., 357., 358., 359.])
array([-90., -89., -88., -87., -86., -85., -84., -83., -82., -81., -80., -79.,\n", + " '1980-01-07T12:00:00.000000000'], dtype='datetime64[ns]')
array([ 0., 1., 2., ..., 357., 358., 359.])
array([-90., -89., -88., -87., -86., -85., -84., -83., -82., -81., -80., -79.,\n", " -78., -77., -76., -75., -74., -73., -72., -71., -70., -69., -68., -67.,\n", " -66., -65., -64., -63., -62., -61., -60., -59., -58., -57., -56., -55.,\n", " -54., -53., -52., -51., -50., -49., -48., -47., -46., -45., -44., -43.,\n", @@ -465,10 +466,10 @@ " 54., 55., 56., 57., 58., 59., 60., 61., 62., 63., 64., 65.,\n", " 66., 67., 68., 69., 70., 71., 72., 73., 74., 75., 76., 77.,\n", " 78., 79., 80., 81., 82., 83., 84., 85., 86., 87., 88., 89.,\n", - " 90.])
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", + " 90.])
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", " 750., 725., 700., 650., 600., 550., 500., 450., 400., 350.,\n", " 300., 250., 200., 150., 100., 70., 50., 40., 30., 20.,\n", - " 10., 7., 5., 4., 3., 2., 1.])
\n",
"
|
PandasIndex(DatetimeIndex(['1980-01-01 12:00:00', '1980-01-02 12:00:00',\n", " '1980-01-03 12:00:00', '1980-01-04 12:00:00',\n", " '1980-01-05 12:00:00', '1980-01-06 12:00:00',\n", " '1980-01-07 12:00:00'],\n", - " dtype='datetime64[ns]', name='time', freq=None))
PandasIndex(Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,\n", + " dtype='datetime64[ns]', name='time', freq=None))
PandasIndex(Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,\n", " ...\n", " 350.0, 351.0, 352.0, 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0],\n", - " dtype='float64', name='lon', length=360))
PandasIndex(Index([-90.0, -89.0, -88.0, -87.0, -86.0, -85.0, -84.0, -83.0, -82.0, -81.0,\n", + " dtype='float64', name='lon', length=360))
PandasIndex(Index([-90.0, -89.0, -88.0, -87.0, -86.0, -85.0, -84.0, -83.0, -82.0, -81.0,\n", " ...\n", " 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, 89.0, 90.0],\n", - " dtype='float64', name='lat', length=181))
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0,\n", + " dtype='float64', name='lat', length=181))
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0,\n", " 775.0, 750.0, 725.0, 700.0, 650.0, 600.0, 550.0, 500.0, 450.0,\n", " 400.0, 350.0, 300.0, 250.0, 200.0, 150.0, 100.0, 70.0, 50.0,\n", " 40.0, 30.0, 20.0, 10.0, 7.0, 5.0, 4.0, 3.0, 2.0,\n", " 1.0],\n", - " dtype='float64', name='level'))
array([ 0., 1., 2., ..., 357., 358., 359.])
array([ 0., 1., 2., ..., 357., 358., 359.])
PandasIndex(Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,\n", + " axis: X
array([ 0., 1., 2., ..., 357., 358., 359.])
array([ 0., 1., 2., ..., 357., 358., 359.])
PandasIndex(Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,\n", " ...\n", " 350.0, 351.0, 352.0, 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0],\n", - " dtype='float64', name='lon', length=360))
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", + " coordinate: pressure
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", " 750., 725., 700., 650., 600., 550., 500., 450., 400., 350.,\n", " 300., 250., 200., 150., 100., 70., 50., 40., 30., 20.,\n", - " 10., 7., 5., 4., 3., 2., 1.])
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", + " 10., 7., 5., 4., 3., 2., 1.])
array([1000., 975., 950., 925., 900., 875., 850., 825., 800., 775.,\n", " 750., 725., 700., 650., 600., 550., 500., 450., 400., 350.,\n", " 300., 250., 200., 150., 100., 70., 50., 40., 30., 20.,\n", - " 10., 7., 5., 4., 3., 2., 1.])
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0,\n", + " 10., 7., 5., 4., 3., 2., 1.])
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0,\n", " 775.0, 750.0, 725.0, 700.0, 650.0, 600.0, 550.0, 500.0, 450.0,\n", " 400.0, 350.0, 300.0, 250.0, 200.0, 150.0, 100.0, 70.0, 50.0,\n", " 40.0, 30.0, 20.0, 10.0, 7.0, 5.0, 4.0, 3.0, 2.0,\n", " 1.0],\n", - " dtype='float64', name='level'))