diff --git a/nblibrary/lnd/Global_TerrestrialCouplingIndex_VisualCompareObs.ipynb b/nblibrary/lnd/Global_TerrestrialCouplingIndex_VisualCompareObs.ipynb index dc02a5d..a505626 100755 --- a/nblibrary/lnd/Global_TerrestrialCouplingIndex_VisualCompareObs.ipynb +++ b/nblibrary/lnd/Global_TerrestrialCouplingIndex_VisualCompareObs.ipynb @@ -930,58 +930,77 @@ "metadata": {}, "outputs": [], "source": [ - "def plotScatter(seasonstr, caseSel = None): \n", + "def plotScatter(seasonstr, caseSel=None):\n", " node_lats = uxgrid.face_lat.values\n", " node_lons = uxgrid.face_lon.values\n", "\n", " predictions = []\n", - " \n", - " fig,axs = plt.subplots(1,1,figsize=(8,8))\n", - " \n", - " \n", - " CI_model = (\n", - " couplingIndex_DS[\"CouplingIndex\"]\n", - " .sel(season=seasonstr)\n", - " )\n", - " \n", - " iSeason = np.where(seasons == seasonstr)[0]\n", + "\n", + " fig, axs = plt.subplots(1, 1, figsize=(8, 8))\n", + "\n", + " CI_model = couplingIndex_DS[\"CouplingIndex\"].sel(season=seasonstr)\n", + "\n", + " iSeason = np.where(seasons == seasonstr)[0]\n", " iStations = np.where(np.isfinite(terraCI_fluxnetConverted[:, iSeason]) == True)[0]\n", - " \n", + "\n", " for iPoint in range(len(iStations)):\n", " this_lon = lon_fluxnet[iStations[iPoint]] # lon1\n", " this_lat = lat_fluxnet[iStations[iPoint]] # lat1\n", " obs_point = np.array((this_lon, this_lat))\n", - " \n", - " # Get subset of relevant points \n", - " i = np.where( (node_lats>=(this_lat-2)) & (node_lats<=(this_lat+2)) & \n", - " (node_lons>=(this_lon-2)) & (node_lons<=(this_lon+2)))[0]\n", - " \n", + "\n", + " # Get subset of relevant points\n", + " i = np.where(\n", + " (node_lats >= (this_lat - 2))\n", + " & (node_lats <= (this_lat + 2))\n", + " & (node_lons >= (this_lon - 2))\n", + " & (node_lons <= (this_lon + 2))\n", + " )[0]\n", + "\n", " minDistance = 100\n", - " for iSelClose in range(len(i)): \n", - " # Find point in uxarray? Use euclidian distance \n", - " distance = np.linalg.norm(obs_point - np.array((node_lons[i[iSelClose]], node_lats[i[iSelClose]])) )\n", - " \n", - " if ( (distance