Skip to content

Commit bd2c626

Browse files
Removing UnitConverters from tutorials
1 parent 7fccebf commit bd2c626

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

docs/user_guide/examples/tutorial_dt_integrators.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@
123123
"U_max_surface = np.nanmax(np.hypot(ds_fields.uo, ds_fields.vo))\n",
124124
"print(f\"U_max = {str(np.round(U_max_surface, 2))} m s-1\")\n",
125125
"\n",
126-
"# convert to degrees s-1 (at lat = 30 deg S, lon = 31 deg E)\n",
127-
"U_max_surface_deg = parcels.GeographicPolar().to_target(U_max_surface, 0, -30, 31)\n",
126+
"# convert to degrees s-1 (at lat = 30 deg S)\n",
127+
"U_max_surface_deg = U_max_surface / (1852 * 60 * np.cos(np.deg2rad(-30)))\n",
128128
"print(f\" == {str(np.round(U_max_surface_deg * 1e5, 2))}e-5 degrees s-1\")"
129129
]
130130
},
@@ -135,7 +135,7 @@
135135
"source": [
136136
"```{admonition} 🖥️ Spherical grids and unit converters\n",
137137
":class: seealso\n",
138-
"Our displacement occurs in units of longitude and latitde, but our velocity field is in m/s. Read the [UnitConversion guide](./tutorial_unitconverters.ipynb) to see how Parcels uses `parcels.GeographicPolar()` under the hood to convert from m s<sup>-1</sup> to degrees s<sup>-1</sup>.\n",
138+
"Our displacement occurs in units of longitude and latitde, but our velocity field is in m/s. That's why we have to convert the units of velocity from m/s to degrees/s. In Parcels, this is done automatically for `VectorFields` when using a `spherical` grid. See the [UnitConversion guide](./tutorial_unitconverters.ipynb) guide for more information.\n",
139139
"```"
140140
]
141141
},
@@ -822,7 +822,7 @@
822822
],
823823
"metadata": {
824824
"kernelspec": {
825-
"display_name": "test-notebooks",
825+
"display_name": "docs",
826826
"language": "python",
827827
"name": "python3"
828828
},
@@ -836,7 +836,7 @@
836836
"name": "python",
837837
"nbconvert_exporter": "python",
838838
"pygments_lexer": "ipython3",
839-
"version": "3.13.9"
839+
"version": "3.14.2"
840840
}
841841
},
842842
"nbformat": 4,

docs/user_guide/examples/tutorial_nemo_curvilinear.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@
9797
"V = parcels.Field(\n",
9898
" \"V\", ds_fields[\"V\"], grid, interp_method=parcels.interpolators.XLinear\n",
9999
")\n",
100-
"U.units = parcels.GeographicPolar()\n",
101-
"V.units = (\n",
102-
" parcels.GeographicPolar()\n",
103-
") # U and V need GeographicPolar for C-Grid interpolation to work correctly\n",
104100
"UV = parcels.VectorField(\n",
105101
" \"UV\", U, V, vector_interp_method=parcels.interpolators.CGrid_Velocity\n",
106102
")\n",

0 commit comments

Comments
 (0)