Skip to content

Commit

Permalink
improve/streamline tutorial notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Winkel committed Nov 18, 2017
1 parent de476d5 commit 58c6512
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 132 deletions.
76 changes: 56 additions & 20 deletions notebooks/03a_path_propagation_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Query height profile"
"Use the following, if you already have the SRTMDATA environment variable set, but not downloaded any \".hgt\" files so far."
]
},
{
Expand All @@ -87,6 +87,42 @@
"collapsed": true
},
"outputs": [],
"source": [
"# pathprof.SrtmConf.set(download='missing', server='viewpano')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you neither have the environment variable set nor \".hgt\" files downloaded (you can use any target directory, of course):"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# pathprof.SrtmConf.set(download='missing', server='viewpano', srtm_dir='.')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Query height profile"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"lon_t, lat_t = 6.8836 * apu.deg, 50.525 * apu.deg\n",
"lon_r, lat_r = 7.3334 * apu.deg, 50.635 * apu.deg\n",
Expand All @@ -95,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand All @@ -111,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -151,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {
"collapsed": true
},
Expand All @@ -165,7 +201,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {
"collapsed": false
},
Expand All @@ -187,7 +223,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -283,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -327,7 +363,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"metadata": {
"collapsed": false
},
Expand All @@ -346,7 +382,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -443,7 +479,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"metadata": {
"collapsed": false
},
Expand All @@ -469,7 +505,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 15,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -509,7 +545,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 16,
"metadata": {
"collapsed": false
},
Expand All @@ -526,7 +562,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 17,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -574,7 +610,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 18,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -615,7 +651,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 19,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -662,7 +698,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 20,
"metadata": {
"collapsed": false
},
Expand All @@ -683,7 +719,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 21,
"metadata": {
"collapsed": false
},
Expand All @@ -709,7 +745,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 22,
"metadata": {
"collapsed": true
},
Expand All @@ -724,7 +760,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 23,
"metadata": {
"collapsed": false
},
Expand All @@ -750,7 +786,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 24,
"metadata": {
"collapsed": false
},
Expand Down
55 changes: 49 additions & 6 deletions notebooks/03c_attenuation_maps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,49 @@
"from pycraf import conversions as cnv"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"With pycraf it is very easy to query SRTM data for arbitrary positions. However, you will need to have to download such SRTM data, either in advance or during your session. Please see the [documentation](https://bwinkel.github.io/pycraf/pathprof/working_with_srtm.html) for more details."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use the following, if you already have the SRTMDATA environment variable set, but not downloaded any \".hgt\" files so far."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# pathprof.SrtmConf.set(download='missing', server='viewpano')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you neither have the environment variable set nor \".hgt\" files downloaded (you can use any target directory, of course):"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# pathprof.SrtmConf.set(download='missing', server='viewpano', srtm_dir='.')"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -88,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {
"collapsed": true
},
Expand All @@ -115,7 +158,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand All @@ -130,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {
"collapsed": true
},
Expand All @@ -155,7 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -239,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {
"collapsed": true
},
Expand Down Expand Up @@ -271,7 +314,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {
"collapsed": true
},
Expand Down
12 changes: 6 additions & 6 deletions notebooks/03d_more_on_srtm_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@
"fig, axes = plt.subplots(1, 3, figsize=(15, 4))\n",
"fig.subplots_adjust(bottom=0.1, top=0.9, right=0.9)\n",
"cax = fig.add_axes((0.9, 0.1, 0.02, 0.8))\n",
"im = axes[0].imshow(heights_linear, **imkwargs)\n",
"axes[1].imshow(heights_nn, **imkwargs)\n",
"axes[2].imshow(heights_spline, **imkwargs)\n",
"im = axes[0].imshow(heights_linear.to(u.m).value, **imkwargs)\n",
"axes[1].imshow(heights_nn.to(u.m).value, **imkwargs)\n",
"axes[2].imshow(heights_spline.to(u.m).value, **imkwargs)\n",
"cbar = plt.colorbar(im, cax=cax)"
]
},
Expand Down Expand Up @@ -439,9 +439,9 @@
"fig, axes = plt.subplots(1, 3, figsize=(15, 4))\n",
"fig.subplots_adjust(bottom=0.1, top=0.9, right=0.9)\n",
"cax = fig.add_axes((0.9, 0.1, 0.02, 0.8))\n",
"im = axes[0].imshow(heights_linear_vp, **imkwargs)\n",
"axes[1].imshow(heights_nn_vp, **imkwargs)\n",
"axes[2].imshow(heights_spline_vp, **imkwargs)\n",
"im = axes[0].imshow(heights_linear_vp.to(u.m).value, **imkwargs)\n",
"axes[1].imshow(heights_nn_vp.to(u.m).value, **imkwargs)\n",
"axes[2].imshow(heights_spline_vp.to(u.m).value, **imkwargs)\n",
"cbar = plt.colorbar(im, cax=cax)"
]
},
Expand Down
132 changes: 50 additions & 82 deletions notebooks/B01_wind_turbine_generic.ipynb

Large diffs are not rendered by default.

25 changes: 7 additions & 18 deletions notebooks/B02_wind_turbine_terrain.ipynb

Large diffs are not rendered by default.

0 comments on commit 58c6512

Please sign in to comment.