Skip to content

Commit 6478d6f

Browse files
committed
Stylistic tutorial edits in 09_DataCorrection_Becker_Adusumilli
1 parent 3da0bc6 commit 6478d6f

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

09_DataCorrection_Becker_Adusumilli/data_correction_rendered.ipynb

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
" DS = '/gt%d%s/%s/%s' % (pair, beam, group, dataset)\n",
100100
" try:\n",
101101
" temp[dataset] = np.array(h5f[DS]) \n",
102-
" if '_FillValue' in h5f[DS].attrs: # Converting Fortran NaNs to Python NaNs\n",
102+
" if '_FillValue' in h5f[DS].attrs: # Convert Fortran NaNs to Python NaNs\n",
103103
" fill_value = h5f[DS].attrs['_FillValue']\n",
104104
" temp[dataset][temp[dataset] == fill_value] = np.NaN\n",
105105
" except KeyError:\n",
@@ -137,7 +137,8 @@
137137
],
138138
"source": [
139139
"%%bash\n",
140-
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/byrd_moa.mat /home/jovyan/external_data/ "
140+
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/byrd_moa.mat \\\n",
141+
" /home/jovyan/external_data/ "
141142
]
142143
},
143144
{
@@ -199,16 +200,17 @@
199200
"output_type": "stream",
200201
"text": [
201202
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.cpg to ../external_data/IceShelf_Antarctica_v1.cpg\n",
202-
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.shx to ../external_data/IceShelf_Antarctica_v1.shx\n",
203203
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.dbf to ../external_data/IceShelf_Antarctica_v1.dbf\n",
204+
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.shx to ../external_data/IceShelf_Antarctica_v1.shx\n",
204205
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.prj to ../external_data/IceShelf_Antarctica_v1.prj\n",
205206
"download: s3://pangeo-data-upload-oregon/icesat2/data-correction/IceShelf_Antarctica_v1.shp to ../external_data/IceShelf_Antarctica_v1.shp\n"
206207
]
207208
}
208209
],
209210
"source": [
210211
"%%bash\n",
211-
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ --recursive --exclude \"*\" --include \"IceShelf_Antarctica_v1.*\""
212+
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ \\\n",
213+
" --recursive --exclude \"*\" --include \"IceShelf_Antarctica_v1.*\""
212214
]
213215
},
214216
{
@@ -278,7 +280,8 @@
278280
"coords = np.squeeze(np.dstack((xp,yp)))\n",
279281
"poly_mpl = path.Path(coords)\n",
280282
"\n",
281-
"for Di in D6: # Add 'mask' dataset (containing the x-y coordinate pairs within the mask) to list D6 for each beam/pair combination\n",
283+
"# Add 'mask' dataset (containing the x-y coordinate pairs within the mask) to list D6 for each beam/pair combination\n",
284+
"for Di in D6:\n",
282285
" Di['mask'] = poly_mpl.contains_points(np.transpose([Di['x'],Di['y']]))\n",
283286
"\n",
284287
"plt.figure(figsize = (10,8))\n",
@@ -346,7 +349,8 @@
346349
"plt.subplot(122)\n",
347350
"plot_moa()\n",
348351
"for Di in D6:\n",
349-
" plt.scatter(Di['x'][::20],Di['y'][::20],c = Di['tide_load'][::20],s = 0.1,vmin=-0.01,vmax=0.01)\n",
352+
" plt.scatter(Di['x'][::20],Di['y'][::20],c = Di['tide_load'][::20],s = 0.1,\\\n",
353+
" vmin=-0.01,vmax=0.01)\n",
350354
"\n",
351355
"cbar = plt.colorbar()\n",
352356
"cbar.set_label('ocean load tide height [m]', rotation=270, labelpad = 12)\n",
@@ -401,7 +405,8 @@
401405
"plt.figure(figsize = (10,8))\n",
402406
"plot_moa()\n",
403407
"for Di in D6:\n",
404-
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],c = Di['dac'][Di['mask']][::20],s = 0.1,vmin=0,vmax=0.5)\n",
408+
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],\\\n",
409+
" c = Di['dac'][Di['mask']][::20],s = 0.1,vmin=0,vmax=0.5)\n",
405410
"cbar = plt.colorbar()\n",
406411
"cbar.set_label('dynamic atmosphere correction [m]', rotation=270, labelpad = 12)\n",
407412
"\n",
@@ -474,7 +479,8 @@
474479
],
475480
"source": [
476481
"%%bash\n",
477-
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ --recursive --exclude \"*\" --include \"FDM_*.nc\""
482+
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ \\\n",
483+
" --recursive --exclude \"*\" --include \"FDM_*.nc\""
478484
]
479485
},
480486
{
@@ -496,8 +502,10 @@
496502
"FAC = Dataset(external_data + '/FDM_FirnAir_ANT27_1979-2016.nc')\n",
497503
"\n",
498504
"print(FAC.file_format)\n",
499-
"print(FAC.dimensions.keys()) # In this case, dimensions represent the physical dimensions assigned to each variable\n",
500-
"print(FAC.variables.keys()) # Variables are arrays of values where the bulk of the information is stored"
505+
"print(FAC.dimensions.keys())\n",
506+
"print(FAC.variables.keys())\n",
507+
"\n",
508+
"# In this case, dimensions represent the physical dimensions assigned to each variable. Variables are arrays of values where the bulk of the information is stored"
501509
]
502510
},
503511
{
@@ -593,7 +601,8 @@
593601
"metadata": {},
594602
"outputs": [],
595603
"source": [
596-
"inds = np.where((lon_fac > 147) & (lon_fac < 163) & (lat_fac > -82) & (lat_fac < -78)) # Subsetting area around Byrd\n",
604+
"# Subset area around Byrd\n",
605+
"inds = np.where((lon_fac > 147) & (lon_fac < 163) & (lat_fac > -82) & (lat_fac < -78))\n",
597606
"mean_fac_byrd = np.squeeze(meanFirnAir_16[inds]).ravel()\n",
598607
"xy = np.empty((len(x_fac[inds]),2))\n",
599608
"xy[:,0] = np.squeeze(x_fac[inds]).ravel()\n",
@@ -679,7 +688,8 @@
679688
"for Di in D6:\n",
680689
" h_MSL = Di['h_li'] - MDT_corr - Di['geoid_h']\n",
681690
" thickness = ((1/rho_ice - 1/rho_ocean)**(-1)) * ((h_MSL - Di['FAC_interp'])/rho_ice)\n",
682-
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],c = thickness[Di['mask']][::20],s = 0.1)\n",
691+
" plt.scatter(Di['x'][Di['mask']][::20],Di['y'][Di['mask']][::20],\\\n",
692+
" c = thickness[Di['mask']][::20],s = 0.1)\n",
683693
" plt.clim([0,1000])\n",
684694
"cbar = plt.colorbar()\n",
685695
"cbar.set_label('thickness [m]', rotation=270, labelpad = 12)\n",
@@ -723,7 +733,8 @@
723733
],
724734
"source": [
725735
"%%bash\n",
726-
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ --recursive --exclude \"*\" --include \"SMB_*.nc\""
736+
"aws s3 cp s3://pangeo-data-upload-oregon/icesat2/data-correction/ /home/jovyan/external_data/ \\\n",
737+
" --recursive --exclude \"*\" --include \"SMB_*.nc\""
727738
]
728739
},
729740
{

0 commit comments

Comments
 (0)