Skip to content

Commit 186e82a

Browse files
committed
Final documentation tweaks.
1 parent 61ad464 commit 186e82a

File tree

7 files changed

+44
-12
lines changed

7 files changed

+44
-12
lines changed

docs/src/main/paradox/_template/page.st

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
.md-left { float: left; }
3232
.md-right { float: right; }
3333
.md-clear { clear: both; }
34+
table { font-size: 80%; }
35+
code { font-size: 0.75em !important; }
3436
</style>
3537
</head>
3638

@@ -132,7 +134,7 @@
132134
<div class="row site-footer-content">
133135
<div class="small-12 text-center large-9 column">
134136
<div class="copyright">
135-
<span class="text">&copy; $page.properties.("date.year")$
137+
<span class="text">Copyright &copy; $page.properties.("date.year")$
136138
<a href="http://www.astraea.earth/">Astraea, Inc.</a></span>
137139
</div>
138140
</div>

pyrasterframes/src/main/python/docs/getting-started.pymd

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Getting Started
22

3-
There are @ref:[several ways](getting-started.md#other-options) to use RasterFrames, and @ref:[several languages](languages.md) with which you can use it. Let's start with the simplest: the Python shell. To get started you will need:
3+
@@@ note
4+
5+
If you are new to Earth-observing imagery, you might consider looking at the [Concepts](concepts.md) section first.
6+
7+
@@@
8+
9+
There are @ref:[several ways](getting-started.md#other-options) to use RasterFrames, and @ref:[several languages](languages.md) with which you can use it.
10+
11+
The simplest way to get started with RasterFrames is via the the Python shell. To get started you will need:
412

513
1. [Python](https://www.python.org/) installed. Version 3.6 or greater is recommended.
614
1. [`pip`](https://pip.pypa.io/en/stable/installing/) installed. If you are using Python 3, `pip` may already be installed.

pyrasterframes/src/main/python/docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ The source code can be found on GitHub at [locationtech/rasterframes](https://gi
3939

4040
@@@ index
4141
* [Overview](description.md)
42-
* [Concepts](concepts.md)
4342
* [Getting Started](getting-started.md)
43+
* [Concepts](concepts.md)
4444
* [Raster Data I/O](raster-io.md)
4545
* [Vector Data](vector-data.md)
4646
* [Raster Processing](raster-processing.md)

pyrasterframes/src/main/python/docs/languages.pymd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ red_nir_monthly_2017 = modis \
3030
col('B01').alias('red'),
3131
col('B02').alias('nir')
3232
) \
33-
.where((year('acquisition_date') == 2017) & (dayofmonth('acquisition_date') == 15) & (col('granule_id') == 'h21v09'))
33+
.where(
34+
(year('acquisition_date') == 2017) &
35+
(dayofmonth('acquisition_date') == 15) &
36+
(col('granule_id') == 'h21v09')
37+
)
38+
red_nir_monthly_2017.printSchema()
3439
```
3540

3641
### Step 3: Read tiles

pyrasterframes/src/main/python/docs/raster-catalogs.pymd

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ scene1_B01 = "https://modis-pds.s3.amazonaws.com/MCD43A4.006/04/09/2018185/MCD43
4343
scene2_B01 = "https://modis-pds.s3.amazonaws.com/MCD43A4.006/04/09/2018188/MCD43A4.A2018188.h04v09.006.2018198232008_B01.TIF"
4444

4545
# a pandas DF
46-
one_d_cat = pd.DataFrame({'B01': [scene1_B01, scene2_B01]})
46+
one_d_cat_pd = pd.DataFrame({'B01': [scene1_B01, scene2_B01]})
4747

4848
# equivalent spark DF
49-
one_d_cat = spark.createDataFrame([Row(B01=scene1_B01), Row(B01=scene2_B01)])
49+
one_d_cat_df = spark.createDataFrame([Row(B01=scene1_B01), Row(B01=scene2_B01)])
5050

5151
# equivalent CSV string
52-
one_d_cat = '\n'.join(['B01', scene1_B01, scene2_B01])
52+
one_d_cat_csv = '\n'.join(['B01', scene1_B01, scene2_B01])
53+
```
54+
55+
This is what it looks like in DataFrame form:
56+
57+
```python, view_spark_cat_1
58+
one_d_cat_df.show(truncate=False)
5359
```
5460

5561
### Two-D
@@ -63,19 +69,25 @@ scene2_B01 = "https://modis-pds.s3.amazonaws.com/MCD43A4.006/04/09/2018188/MCD43
6369
scene2_B02 = "https://modis-pds.s3.amazonaws.com/MCD43A4.006/04/09/2018188/MCD43A4.A2018188.h04v09.006.2018198232008_B02.TIF"
6470

6571
# Pandas DF
66-
my_cat = pd.DataFrame([
72+
two_d_cat_pd = pd.DataFrame([
6773
{'B01': [scene1_B01], 'B02': [scene1_B02]},
6874
{'B01': [scene2_B01], 'B02': [scene2_B02]}
6975
])
7076

7177
# or
72-
my_cat_df = spark.createDataFrame([
78+
two_d_cat_df = spark.createDataFrame([
7379
Row(B01=scene1_B01, B02=scene1_B02),
7480
Row(B01=scene2_B01, B02=scene2_B02)
7581
])
7682

7783
# As CSV string
78-
my_cat = '\n'.join(['B01,B02', scene1_B01 + "," + scene1_B02, scene2_B01 + "," + scene2_B02])
84+
tow_d_cat_csv = '\n'.join(['B01,B02', scene1_B01 + "," + scene1_B02, scene2_B01 + "," + scene2_B02])
85+
```
86+
87+
This is what it looks like in DataFrame form:
88+
89+
```python, view_spark_cat_1
90+
two_d_cat_df.show(truncate=False)
7991
```
8092

8193
## Using External Catalogs

pyrasterframes/src/main/python/docs/raster-write.pymd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ os.remove(outfile)
9393

9494
[GeoTrellis][GeoTrellis] is one of the key libraries upon which RasterFrames is built. It provides a Scala language API for working with geospatial raster data. GeoTrellis defines a [tile layer storage](https://geotrellis.readthedocs.io/en/latest/guide/tile-backends.html) format for persisting imagery mosaics. RasterFrames can write data from a `RasterFrameLayer` into a [GeoTrellis Layer](https://geotrellis.readthedocs.io/en/latest/guide/tile-backends.html). RasterFrames provides a `geotrellis` DataSource that supports both @ref:[reading](raster-read.md#geotrellis-layers) and @ref:[writing](raster-write.md#geotrellis-layers) GeoTrellis layers.
9595

96-
> An example is forthcoming. In the mean time referencing the [`GeoTrellisDataSourceSpec` test code](https://github.com/locationtech/rasterframes/blob/develop/datasource/src/test/scala/org/locationtech/rasterframes/datasource/geotrellis/GeoTrellisDataSourceSpec.scala) may help
96+
> An example is forthcoming. In the mean time referencing the [`GeoTrellisDataSourceSpec` test code](https://github.com/locationtech/rasterframes/blob/develop/datasource/src/test/scala/org/locationtech/rasterframes/datasource/geotrellis/GeoTrellisDataSourceSpec.scala) may help.
9797

9898
## Parquet
9999

pyrasterframes/src/main/python/pyrasterframes/rf_ipython.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def tile_to_png(tile, fig_size=None):
2929
import io
3030
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
3131
from matplotlib.figure import Figure
32+
import matplotlib.colors as colors
33+
from matplotlib import cm
3234

3335
# Set up matplotlib objects
3436
nominal_size = 2 # approx full size for a 256x256 tile
@@ -39,7 +41,10 @@ def tile_to_png(tile, fig_size=None):
3941
canvas = FigureCanvas(fig)
4042
axis = fig.add_subplot(1, 1, 1)
4143

42-
axis.imshow(tile.cells)
44+
data = tile.cells
45+
norm = colors.LogNorm(data.min(), data.max())
46+
47+
axis.imshow(data, norm=norm, cmap=cm.get_cmap("RdBu"))
4348
axis.set_aspect('equal')
4449
axis.xaxis.set_ticks([])
4550
axis.yaxis.set_ticks([])

0 commit comments

Comments
 (0)