Skip to content

Commit 454ed2c

Browse files
committed
Add automatic gestion of the case where you want to estimate spatial grid with a certain radius but coeffs radius do not correspond so internal change_reference() is applied
1 parent 6cbbbca commit 454ed2c

4 files changed

Lines changed: 485 additions & 198 deletions

File tree

doc/tutorials/Advanced_lnharmo_validation.ipynb

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 1,
25+
"execution_count": 2,
2626
"id": "08455b0e-32fb-49fd-b247-79a8067cb24c",
2727
"metadata": {},
2828
"outputs": [],
@@ -75,7 +75,7 @@
7575
},
7676
{
7777
"cell_type": "code",
78-
"execution_count": 2,
78+
"execution_count": 3,
7979
"id": "07df9789-d606-489b-9a71-1a424f806c91",
8080
"metadata": {},
8181
"outputs": [],
@@ -84,18 +84,15 @@
8484
"\n",
8585
"ds_ref = xr.open_dataset(file_model, engine='lenapyGfc', no_date=True)\n",
8686
"\n",
87-
"# Convert radius and GM of reference to be coherent with ICGEM computation\n",
88-
"ds_ref = ds_ref.lnharmo.change_reference(new_radius=6378137.0, new_earth_gravity_constant=3.986005e14)\n",
89-
"\n",
90-
"# Default ds.attrs radius and earth_gravity_constant are used for the computation (set with change_reference())\n",
91-
"grid_lenapy = ds_ref.lnharmo.to_grid(unit='potential', ellipsoidal_earth=False)\n",
87+
"# Inside convertion of SH coefficients by giving a_earth and GM of the new reference to be coherent with ICGEM computation\n",
88+
"grid_lenapy = ds_ref.lnharmo.to_grid(unit='potential', ellipsoidal_earth=False, a_earth=6378137.0, earth_gravity_constant=3.986005e14)\n",
9289
"\n",
93-
"grid_lenapy_ellps = ds_ref.lnharmo.to_grid(unit='potential', ellipsoidal_earth=True, f_earth=1/298.257222101)"
90+
"grid_lenapy_ellps = ds_ref.lnharmo.to_grid(unit='potential', ellipsoidal_earth=True, f_earth=1/298.257222101, a_earth=6378137.0, earth_gravity_constant=3.986005e14)"
9491
]
9592
},
9693
{
9794
"cell_type": "code",
98-
"execution_count": 3,
95+
"execution_count": 4,
9996
"id": "28ee5716-c77e-4a0e-a872-b97184a7b0b5",
10097
"metadata": {},
10198
"outputs": [
@@ -150,7 +147,7 @@
150147
},
151148
{
152149
"cell_type": "code",
153-
"execution_count": 4,
150+
"execution_count": 5,
154151
"id": "9f129e2a-c5a6-4869-abcd-b4e8628dae41",
155152
"metadata": {},
156153
"outputs": [
@@ -214,7 +211,7 @@
214211
},
215212
{
216213
"cell_type": "code",
217-
"execution_count": 5,
214+
"execution_count": 6,
218215
"id": "8821900e-a794-4ba1-a1ce-edc9b5ff9ace",
219216
"metadata": {},
220217
"outputs": [],
@@ -229,7 +226,7 @@
229226
},
230227
{
231228
"cell_type": "code",
232-
"execution_count": 6,
229+
"execution_count": 7,
233230
"id": "7dd1e41a-d705-44b8-a17b-ae21e3e9bd51",
234231
"metadata": {},
235232
"outputs": [
@@ -282,7 +279,7 @@
282279
},
283280
{
284281
"cell_type": "code",
285-
"execution_count": 7,
282+
"execution_count": 8,
286283
"id": "ef5824e1-54e2-4007-af08-065457822d3c",
287284
"metadata": {},
288285
"outputs": [

0 commit comments

Comments
 (0)