Last active
March 24, 2020 02:05
-
-
Save JiaweiZhuang/6b8581dc9b5dd4e0cdfaae4f385cefe2 to your computer and use it in GitHub Desktop.
Illustrating an ESMPy bug with strongly stretched grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Debugging ESMPy with strongly stretched grid" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline\n", | |
"import matplotlib.pyplot as plt\n", | |
"import numpy as np\n", | |
"import ESMF" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"# packages in environment at /opt/conda:\n", | |
"#\n", | |
"esmpy 7.1.0.dev46 py27_1 nesii/channel/dev-esmf\n" | |
] | |
} | |
], | |
"source": [ | |
"!conda list esmpy" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Prepare data" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Input grid and data" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# cell centers\n", | |
"lon_in, lat_in = np.meshgrid(np.linspace(-20, 20, 5), np.linspace(-15, 15, 4))\n", | |
"# cell bounds\n", | |
"lon_in_b, lat_in_b = np.meshgrid(np.linspace(-25, 25, 6), np.linspace(-20, 20, 5))\n", | |
"\n", | |
"# stretch the grid in diagonal direction?\n", | |
"# Switch to False will remove the bug\n", | |
"stretch = True\n", | |
"if stretch:\n", | |
" lon_in += lat_in \n", | |
" lat_in += lon_in\n", | |
" lon_in_b += lat_in_b\n", | |
" lat_in_b += lon_in_b" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Text(0.5,1,u'input data and grid')" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEICAYAAABcVE8dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3XmcHHWd//HXJzOTTI5JQi7IaYIC\nBhYiMBy/BQEVQRBh+QkuriIq/nB3ZWHXlUtcf+y6/ETxwgcKD354gOCPSxG8lkNAVk4TICJErkTJ\nJCEJue+5Pr8/qmrSM1PdXd1d3V3T834+Hnmku7q76puZ5DWVb1V3mbsjIiKNb0S9ByAiIrWh4IuI\nDBMKvojIMKHgi4gMEwq+iMgwoeCLiAwTCr5UzMxeMLPj6j2OOGb2iJl9qt7jKJWZfdzMfpfi+j5v\nZjcWePzPZnZ8WtuTbGqu9wBk6HP3A2qxHTP7IdDh7l+o0vr/DHzK3R+sxvrryd3/T73HIPWnPXyR\nBmdm2rETQMGXFOROB5jZFWZ2h5ndbGZbwume9gHPvczMXjSzDWb2AzNrDR8bNI1hZm5mbzOz84CP\nABeb2VYz+3mesbzXzP5kZpvM7FrAch57q5k9ZGbrzOxNM7vVzCaGj/0ImAP8PFz/xeHyO83sjXB9\nj5pZ3v/NmNknzGxJ+OdeamafznnsODPrMLN/NbM1ZrbKzD6R8/hkM7vXzDab2dPAW4t8zT9mZn8J\n/yz/FvM9uMvMbjGzzcDHw2W35Lz+7JzXX15oW9I4FHyphlOB24CJwL3AtQMe/whwIkHU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OwTzeM+TcwZIjcbyE+CPwB+AnwMz6z0uggOfy4Hnwl/X5zx2eTiml4CT\najim0wl+UO8CVgP31XtM4bZPJjgD5TWCqaeabXvAOP4fsAroCr9O5xLMA/8GeCX8fVINx3M0wRTE\nH3L+Hp1czzGF4zoIeDYc1x+BL4bL9ybYUXgVuBMYVafv43HsPkunpmPSRyuIiAwTDTOlIyIihSn4\nIiLDhIIvIjJMKPgiIsOEgi8iMkwo+CIiw4SCLyIyTPx/gLN6oRXoZaoAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f22900dcfd0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"data = np.arange(20).reshape(4, 5) # a boring data\n", | |
"\n", | |
"plt.pcolormesh(lon_in_b, lat_in_b, data)\n", | |
"plt.scatter(lon_in, lat_in, label='cell center')\n", | |
"plt.legend()\n", | |
"plt.title('input data and grid')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Output Grid" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Just a simple rectilinear grid" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"lon_out_b = np.linspace(-50, 50, 51)\n", | |
"lon_out = 0.5*(lon_out_b[1:]+lon_out_b[:-1])\n", | |
"\n", | |
"lat_out_b = np.linspace(-80, 80, 51)\n", | |
"lat_out = 0.5*(lat_out_b[1:]+lat_out_b[:-1])\n", | |
"\n", | |
"# 1D -> 2D\n", | |
"lon_out, lat_out = np.meshgrid(lon_out, lat_out)\n", | |
"lon_out_b, lat_out_b = np.meshgrid(lon_out_b, lat_out_b)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Regridding" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Convenience function\n", | |
"Adapted from https://github.com/JiaweiZhuang/xESMF/blob/master/xesmf/backend.py" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def esmf_grid(lon, lat):\n", | |
" '''\n", | |
" Create an ESMF.Grid object, for contrusting ESMF.Field and ESMF.Regrid\n", | |
" '''\n", | |
" staggerloc = ESMF.StaggerLoc.CENTER\n", | |
" \n", | |
" grid = ESMF.Grid(np.array(lon.shape), staggerloc=staggerloc,\n", | |
" coord_sys=ESMF.CoordSys.SPH_DEG)\n", | |
" lon_pointer = grid.get_coords(coord_dim=0, staggerloc=staggerloc)\n", | |
" lat_pointer = grid.get_coords(coord_dim=1, staggerloc=staggerloc)\n", | |
"\n", | |
" lon_pointer[...] = lon\n", | |
" lat_pointer[...] = lat\n", | |
"\n", | |
" return grid\n", | |
"\n", | |
"def add_corner(grid, lon_b, lat_b):\n", | |
" '''\n", | |
" Add corner information to ESMF.Grid for conservative regridding.\n", | |
" '''\n", | |
" staggerloc = ESMF.StaggerLoc.CORNER \n", | |
" \n", | |
" grid.add_coords(staggerloc=staggerloc)\n", | |
" lon_b_pointer = grid.get_coords(coord_dim=0, staggerloc=staggerloc)\n", | |
" lat_b_pointer = grid.get_coords(coord_dim=1, staggerloc=staggerloc)\n", | |
"\n", | |
" lon_b_pointer[...] = lon_b\n", | |
" lat_b_pointer[...] = lat_b" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## The regridding process" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# make ESMF.Grid object\n", | |
"\n", | |
"grid_in = esmf_grid(lon_in, lat_in)\n", | |
"add_corner(grid_in, lon_in_b, lat_in_b)\n", | |
"\n", | |
"grid_out = esmf_grid(lon_out, lat_out)\n", | |
"add_corner(grid_out, lon_out_b, lat_out_b)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"`line_type=ESMF.LineType.GREAT_CIRCLE` fixes the previous \"diffusion\" issue." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# make ESMF.Regrid object\n", | |
"\n", | |
"sourcefield = ESMF.Field(grid_in)\n", | |
"destfield = ESMF.Field(grid_out)\n", | |
"regrid = ESMF.Regrid(sourcefield, destfield, \n", | |
" regrid_method=ESMF.RegridMethod.BILINEAR,\n", | |
" unmapped_action=ESMF.UnmappedAction.IGNORE,\n", | |
" line_type=ESMF.LineType.GREAT_CIRCLE)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# Apply regridding\n", | |
"\n", | |
"sourcefield.data[...] = data\n", | |
"destfield = regrid(sourcefield, destfield)\n", | |
"data_out = destfield.data" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Check output data" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Now the result is correct" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.collections.QuadMesh at 0x7f227b1a75d0>" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDI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ZLxdB9/39ETM/B6cD7+7OQyv2AL9dVa8EzgYu6r7/S4Abq2oNcGO33Yr3A3fP2v4ocHl3Lp4A\nLlySXj0PBv4Puxy4mB9+SKy5ZSKq6itVtafbvJmZ5yhg5lxcVVU7q+oBZu7COmsp+riIzgI2VdX9\nVbULuIqZ89CEqtpaVbd2r59iJuhWMXMOrux2uxJ4x9L0cHElWQ28je6ZoyRh5pb0a7pdDupzYeB3\nkpwPfK+qbn9O1dAyEa34FeDPu9ctnosWv+deSU4FXgPcArz02Wdruq8nLl3PFtXHmRkU7uu2XwI8\nOWuAdFD/fIy9D/+QcoBlIj4E/HzfYT1lh/y9rHOdi6q6ttvnMmb+S/+5Zw/r2f+QPxcH0OL3/COS\nHAN8AfhAVf1gZmDbliRvBx6pqm8k+VfPFvfsetD+fDQV+EPLRCT5CeA04PbuB3k1cGu3vv9huUzE\nXEtmACRZB7wdOKf2P6xxWJ6LA2jxe/4hSY5gJuw/V1Vf7IofTnJyVW3tpjgfWboeLpo3AucneStw\nFDMrBX+cmWneqW6Uf1D/fDilA1TVHVV1YlWdWlWnMvNL/tqq+j4NLhOR5Dzgg8D5VbV9VtV1wNok\nRyY5jZkL2V9bij4uoq8Da7o7MVYwc9H6uiXu06Lp5qivAO6uqo/NqroOWNe9Xgdcu9h9W2xVdWlV\nre4yYi3wl1X1HuAm4J3dbgf1uWhqhD9Ph/oyEfPxh8CRwPXd/3hurqpfrao7k1wN3MXMVM9FVbV3\nCfu54KpqT5L3AV8GlgOfqao7l7hbi+mNwC8BdyT5Zlf2IeAjwNVJLmTmrrZ3LVH/DgYfBK5K8p+B\n25j5A3lQcmkFSWqEUzqS1AgDX5IaYeBLUiMMfElqhIEvSY0w8CWpEQa+JDXi/wEwXVkrPoPSNgAA\nAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f22900dcb10>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.pcolormesh(lon_out_b, lat_out_b, data_out)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Conservative method" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# make ESMF.Regrid object\n", | |
"regrid_con = ESMF.Regrid(sourcefield, destfield, \n", | |
" regrid_method=ESMF.RegridMethod.CONSERVE,\n", | |
" unmapped_action=ESMF.UnmappedAction.IGNORE,\n", | |
" )" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# Apply regridding\n", | |
"sourcefield.data[...] = data\n", | |
"destfield = regrid_con(sourcefield, destfield)\n", | |
"data_out_con = destfield.data.copy() # to avoid being overwritten by the next operation" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The result is correct in 7.1.0.dev46." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.collections.QuadMesh at 0x7f227b127110>" | |
] | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAGFRJREFUeJzt3X+w19V95/Hn6/7kgl6BKEr4UUiK\nMSYmagla3Xa30TZqMmK7sUM2bal1lm1iUtMkjb9m0unsuhvbTjTdpu7cqXbMjFO0xFTWyW6iNslu\nNguKxh9BUAgoXH6j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bLEVD8fN+k9vfgXOBTxXXIxQDwpYh4P3AxcEPx898MPB4Rc4DHi++5uBFYNez7HcCd\nxbXYBVw/Kr16B5zw3+pO4Cu8dZFYdttERMT3I2Kg+LqM2joKqF2LxRFxMCLWU3sKa95o9HEEzQPW\nRsS6iDgELKZ2HbIQEVsi4uni815qiW4atWtwX3HYfcA1o9PDkSVpOvBxijVHkkTtkfQlxSFj+lo4\n4RckXQ1siohn3xZKbRORiz8C/kfxOcdrkePPXErSLOACYDlw5pG1NcWfU0avZyPqLmqDwqHi+7uA\n3cMGSGP670fV5/BPKMfYJuJW4LfKqpWUnfDPsta7FhHxcHHMbdT+SX//kWolx5/w1+IYcvyZf4Gk\nU4BvA1+IiD21gW1eJH0C2B4RT0n6N0eKSw4ds38/skr4qW0iJJ0HzAaeLf4iTweeLvb3Pym3iai3\nZQaApIXAJ4DL4uhijZPyWhxDjj/zW0jqpJbs74+Ih4ribZKmRsSWYopz++j1cMRcClwt6SpgHLWd\ngu+iNs3bUYzyx/TfD0/pABHxfERMiYhZETGL2n/kF0bEVjLcJkLSFcBNwNURsX9YaCmwQFK3pNnU\nbmQ/MRp9HEFPAnOKJzG6qN20XjrKfRoxxRz1PcCqiPj6sNBSYGHxeSHw8Ej3baRFxC0RMb3IEQuA\nf4mITwM/AD5ZHDamr0VWI/wGnejbRDTib4Fu4NHiXzzLIuKPI2KlpAeBF6hN9dwQEYOj2M+Wi4gB\nSZ8Dvge0A/dGxMpR7tZIuhT4feB5Sc8UZbcCXwMelHQ9tafarh2l/o0FNwGLJf0n4KfUfkGOSd5a\nwcwsE57SMTPLhBO+mVkmnPDNzDLhhG9mlgknfDOzTDjhm5llwgnfzCwT/w9l5Bvn+81IpgAAAABJ\nRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f227b1be150>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.pcolormesh(lon_out_b, lat_out_b, data_out_con)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Use fractional normalization" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.collections.QuadMesh at 0x7f227b09c910>" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAFs1JREFUeJzt3X2MX9V54PHvMzOe8Qt+wRACtb3F\nVZ1tyFuTUMKG3W4baENeBKyUVK66XStFa6UiXdIXBQjSVrvaSElbNUnVNN1RyS5IaIGStFhVWsJb\nV+ru8mIIBIxDmAAxxgbjgIEFY3s8z/4xl/VA7vkZ/+5vZmyf70ey/Lvn3HvPmevxM2eee8+5kZlI\nko5/Q/PdAUnS3DDgS1IlDPiSVAkDviRVwoAvSZUw4EtSJQYS8CPidyNiS0Q8FBH/IyIWRsTaiLgr\nIh6NiOsjYnQQbUmS+tM54EfEKuA/AGdm5juBYWA98CXgy5m5DngeuLhrW5Kk/g0qpTMCLIqIEWAx\nsBP4EHBjU381cNGA2pIk9WGk6wky86mI+BNgG7AX+A5wL7AnMyeb3bYDq9qOj4iNwEaAYYbfv5hl\nXbskSVV5ied3Z+ZbDrdf54AfEScCFwJrgT3AXwMfadm1dQ2HzBwHxgGWxcr8QJzbtUuSVJVb88Yf\nvZn9BpHSOQ94PDOfzcwDwLeADwIrmhQPwGpgxwDakiT1aRABfxtwdkQsjogAzgUeBu4APtHsswG4\naQBtSZL61DngZ+ZdTN+cvQ94sDnn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CICLOANYD7wDO\nB/4iIobnrZdzoPn6vsb098EZwK8316EWk8DvZ+bbgbOBS5qv/3LgtsxcB9zWbNfiUmDrjO0vAV9u\nrsXzwMXz0qs3wYD/el8GPsfrJ4lVt0xEZn4nMyebzTuZnkcB09fiuszcl5mPM/0U1lnz0cc5dBYw\nkZmPZeZ+4Dqmr0MVMnNnZt7XfH6J6UC3iulrcHWz29XARfPTw7kVEauBj9HMOYqIYPqR9BubXY7q\na2HAb0TEBcBTmfnAG6pKy0TU4reAv28+13gtavyaW0XE6cB7gbuAt742t6b5+5T569mc+grTg8Kp\nZvskYM+MAdJR/f3R9Tn8Y8phlon4PPCrbYe1lB3zz7L2uhaZeVOzz5VM/0p/7WuHtex/zF+Lw6jx\na/4JEXEC8E3gs5n54vTAti4R8XFgV2beGxG/9Fpxy65H7fdHVQG/tExERLwLWAs80Hwjrwbua9b3\nPy6Xiei1ZAZARGwAPg6cm4cmaxyX1+IwavyaXyciFjAd7K/NzG81xc9ExGmZubNJce6avx7OmXOA\nCyLio8BCplcK/grTad6RZpR/VH9/mNIBMvPBzDwlM0/PzNOZ/k/+vsx8mgqXiYiI84HLgAsy85UZ\nVZuA9RExFhFrmb6Rffd89HEO3QOsa57EGGX6pvWmee7TnGly1FcBWzPzT2dUbQI2NJ83ADfNdd/m\nWmZekZmrmxixHrg9M38DuAP4RLPbUX0tqhrh9+lYXyaiH38OjAG3NL/x3JmZn87MLRFxA/Aw06me\nSzLz4Dz2c9Zl5mREfAa4GRgGvpGZW+a5W3PpHOA3gQcj4v6m7PPAF4EbIuJipp9q++Q89e9ocBlw\nXUT8F+C7TP+APCq5tIIkVcKUjiRVwoAvSZUw4EtSJQz4klQJA74kVcKAL0mVMOBLUiX+H1WXshx0\n2v52AAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f227b16f190>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# make ESMF.Regrid object\n", | |
"regrid_frac = ESMF.Regrid(sourcefield, destfield, \n", | |
" regrid_method=ESMF.RegridMethod.CONSERVE,\n", | |
" unmapped_action=ESMF.UnmappedAction.IGNORE,\n", | |
" norm_type=ESMF.NormType.FRACAREA)\n", | |
"\n", | |
"# Apply regridding\n", | |
"sourcefield.data[...] = data\n", | |
"destfield = regrid_frac(sourcefield, destfield)\n", | |
"data_out_frac = destfield.data\n", | |
"\n", | |
"plt.pcolormesh(lon_out_b, lat_out_b, data_out_frac)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.colorbar.Colorbar at 0x7f227afdc950>" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3XmcHHWd//HXeyYHtyCRK4mAu6CA\nB4YY2EVXBOSILEF/4sZ1NSBuRFHBRRHwXNRdvBZUEDYKK7jI4YFkXRQiqHgsaIBwg0RACImE4Qgg\nR5jM5/dHfQc63dUzPVPVk57q9/PxqMd0fetb3++3aro/Xf2t+lYpIjAzs2rpWdcNMDOz8jm4m5lV\nkIO7mVkFObibmVWQg7uZWQU5uJuZVVBHBndJL5V0vaTHJX1oDOq7RdJe7a7HRk/SLyS9pw3ltu1/\nL+lMSZ9sR9lmw5mwrhvQxHHALyLi1WUXLOnbwLKI+MRgWkTsUnY91nna+b+XdBjwnoh4bU3ZR5ZR\nttlodOSRO7AtcEuzhZJ6x7AtY0JSp37RVnJ/d4sOf191bNsqISI6agKuBN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v9If7dY\ndy0blVPJDpIGH2U0qmHy1h6VvJ/7MLdMOBHYL2+1nLSOuU60laHNkj5O1gVw3uBqOfk7ZptaMN7b\nvxZJGwE/AI6JiMeyA93xSdJBwMqIuFbSXoPJOVnH7f9rvKtkcG82DFjSK4DtgRvSB2sacF26D31H\n3zJhuKHNkuYBBwH7xPODFzp6m1ow3tv/HEkTyQL7eRHxw5T8gKStI2JF6gJcue5aOGJ7AgdLmg2s\nR3Z32FMZxTB5a4+u6paJiJsiYouI2C4itiMLHjMi4s+M41smSDqAbATbwRHxZM2iYYc2d7jfAzuk\nKzAmkZ0cXriO2zRiqS/6LOC2iPiPmkULyYaSQ4tDyjtFRJwQEdPS52gucGVEvINRDJO39qjkkfso\njYdbJjRzGjAZWJR+kVwdEUcONbR5PIiIfkkfAC4DeoGzI+KWddys0dgTeCdwk6QlKe1E4GTgIklH\nkF25deg6al+ZRjxM3trDtx8wM6ugruqWMTPrFg7uZmYV5OBuZlZBDu5mZhXk4G5mVkEO7mZmFeTg\nbmZWQf8fHA03m7Rj46EAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f227b102bd0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Difference at the edge\n", | |
"plt.pcolormesh(lon_out_b, lat_out_b, data_out_frac-data_out_con, \n", | |
" cmap='RdBu_r', vmin=-10, vmax=10)\n", | |
"plt.title('fraction area norm. - destination area norm.')\n", | |
"plt.colorbar()" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.13" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": true, | |
"sideBar": true, | |
"skip_h1_title": false, | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": "block", | |
"toc_window_display": false | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment