Skip to content

Commit 78fa1b0

Browse files
committed
Stylistic tutorial edits v2 in 09_DataCorrection_Becker_Adusumilli
1 parent 6478d6f commit 78fa1b0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

09_DataCorrection_Becker_Adusumilli/data_correction_rendered.ipynb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@
9898
" for dataset in datasets[group]:\n",
9999
" DS = '/gt%d%s/%s/%s' % (pair, beam, group, dataset)\n",
100100
" try:\n",
101-
" temp[dataset] = np.array(h5f[DS]) \n",
102-
" if '_FillValue' in h5f[DS].attrs: # Convert Fortran NaNs to Python NaNs\n",
101+
" temp[dataset] = np.array(h5f[DS])\n",
102+
" # Convert Fortran NaNs to Python NaNs\n",
103+
" if '_FillValue' in h5f[DS].attrs:\n",
103104
" fill_value = h5f[DS].attrs['_FillValue']\n",
104105
" temp[dataset][temp[dataset] == fill_value] = np.NaN\n",
105106
" except KeyError:\n",
@@ -199,9 +200,9 @@
199200
"name": "stdout",
200201
"output_type": "stream",
201202
"text": [
202-
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.cpg to ../external_data/IceShelf_Antarctica_v1.cpg\n",
203-
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.dbf to ../external_data/IceShelf_Antarctica_v1.dbf\n",
204203
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.shx to ../external_data/IceShelf_Antarctica_v1.shx\n",
204+
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.dbf to ../external_data/IceShelf_Antarctica_v1.dbf\n",
205+
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.cpg to ../external_data/IceShelf_Antarctica_v1.cpg\n",
205206
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.prj to ../external_data/IceShelf_Antarctica_v1.prj\n",
206207
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.shp to ../external_data/IceShelf_Antarctica_v1.shp\n"
207208
]
@@ -280,7 +281,8 @@
280281
"coords = np.squeeze(np.dstack((xp,yp)))\n",
281282
"poly_mpl = path.Path(coords)\n",
282283
"\n",
283-
"# Add 'mask' dataset (containing the x-y coordinate pairs within the mask) to list D6 for each beam/pair combination\n",
284+
"# Add 'mask' dataset (containing the x-y coordinate pairs within the mask) to list D6 for each \n",
285+
"# beam/pair combination\n",
284286
"for Di in D6:\n",
285287
" Di['mask'] = poly_mpl.contains_points(np.transpose([Di['x'],Di['y']]))\n",
286288
"\n",
@@ -349,7 +351,7 @@
349351
"plt.subplot(122)\n",
350352
"plot_moa()\n",
351353
"for Di in D6:\n",
352-
" plt.scatter(Di['x'][::20],Di['y'][::20],c = Di['tide_load'][::20],s = 0.1,\\\n",
354+
" plt.scatter(Di['x'][::20],Di['y'][::20],c = Di['tide_load'][::20],s = 0.1, \\\n",
353355
" vmin=-0.01,vmax=0.01)\n",
354356
"\n",
355357
"cbar = plt.colorbar()\n",
@@ -405,7 +407,7 @@
405407
"plt.figure(figsize = (10,8))\n",
406408
"plot_moa()\n",
407409
"for Di in D6:\n",
408-
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],\\\n",
410+
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20], \\\n",
409411
" c = Di['dac'][Di['mask']][::20],s = 0.1,vmin=0,vmax=0.5)\n",
410412
"cbar = plt.colorbar()\n",
411413
"cbar.set_label('dynamic atmosphere correction [m]', rotation=270, labelpad = 12)\n",
@@ -688,7 +690,7 @@
688690
"for Di in D6:\n",
689691
" h_MSL = Di['h_li'] - MDT_corr - Di['geoid_h']\n",
690692
" thickness = ((1/rho_ice - 1/rho_ocean)**(-1)) * ((h_MSL - Di['FAC_interp'])/rho_ice)\n",
691-
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],\\\n",
693+
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20], \\\n",
692694
" c = thickness[Di['mask']][::20],s = 0.1)\n",
693695
" plt.clim([0,1000])\n",
694696
"cbar = plt.colorbar()\n",

0 commit comments

Comments
 (0)