Skip to content

Commit

Permalink
Grammatical, trimming, and formalizing text
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnow03 authored Mar 22, 2024
1 parent 4b0c5b3 commit 3b932a3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions docs/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"\n",
"Welcome to the [`flipnslide`](https://github.com/elliesch/flipnslide) documentation! \n",
"\n",
"On this page we'll demonstrate a \"quick-start\" example that will allow you to run `flipnslide` and output a machine learning-ready dataset for immediate use with deep learning algorithms. We'll show you how to use `flipnslide` to download an image from the Earth Observation satellite [Landsat](https://landsat.gsfc.nasa.gov), tile and augment that image according to the Flip-n-Slide strategy (Abrahams et al. 2024), and output the tiled dataset as either a `numpy` array or a `PyTorch` tensor.\n",
"On this page we will demonstrate a \"quick-start\" example that will allow you to run `flipnslide` and output a machine learning-ready dataset for immediate use with deep learning algorithms. We show you how to use `flipnslide` to download an image from the Earth-observing satellite [Landsat](https://landsat.gsfc.nasa.gov), tile and augment that image according to the Flip-n-Slide strategy (Abrahams et al. 2024), and output the tiled dataset as either a `numpy` array or a `PyTorch` tensor.\n",
"\n",
"We'll start by installing `flipnslide`."
"We will start by installing `flipnslide`."
]
},
{
Expand Down Expand Up @@ -43,7 +43,7 @@
"user_expressions": []
},
"source": [
"Now we'll import the `FlipnSlide` tiling method from the `flipnslide` package."
"Next, we import the `FlipnSlide` tiling method from the `flipnslide` package."
]
},
{
Expand All @@ -67,13 +67,13 @@
"source": [
"## Creating a set of tiles from the Planetary Computer Database\n",
"\n",
"To use `flipnslide` to create a dataset of preprocessed, augmented tiles directly from an image we haven't downloaded yet, we need to define two variables: 1) coordinates, and 2) a time range.\n",
"To use `flipnslide` to create a dataset of preprocessed, augmented tiles directly from an image we have not downloaded yet, we need to define two variables: 1) coordinates, and 2) a time range.\n",
"\n",
"The `coordinates` variable should be a list of longitude/lattitude coordinates in decimal degrees that bound the area that you are interested in. The coordinate list should follow the order of `[South, North, East, West]`.\n",
"\n",
"The `time_range` variable should be a string containing the start and end date of the time range that you are interested in. The current version of `flipnslide` will take the time average of all timestamps so as to minimize NaNs, but future versions will output a monthly median.\n",
"The `time_range` variable should be a string containing the start and end date of the time range that you are interested in. The current version of `flipnslide` takes the time average of all timestamps so as to minimize NaNs, but future versions will output a monthly median.\n",
"\n",
"For the purposes of this example, we'll define an area around New York City, observed in the first two months of 2023."
"For the purposes of this example, we define an area around New York City, observed in the first two months of 2023."
]
},
{
Expand All @@ -96,10 +96,10 @@
"user_expressions": []
},
"source": [
"Let's employ `flipnslide` to create a set of `numpy` tiles from these two variables alone. We'll set the `verbose` flag to `True` so we can see the steps that the algorithm is taking to download and process our image. \n",
"Let's employ `flipnslide` to create a set of `numpy` tiles from these two variables alone. We set the `verbose` flag to `True` so we can see the steps that the algorithm is taking to download and process our image. \n",
"\n",
"```{Note}\n",
"Because we're downloading a large image with many timestamps, this will take a longer time than running `flipnslide` directly on a downloaded image.\n",
"Because we are downloading a large image with many timestamps, this will take a longer time than running `flipnslide` directly on a downloaded image.\n",
"```"
]
},
Expand Down Expand Up @@ -239,7 +239,7 @@
"user_expressions": []
},
"source": [
"Let's see the size of the dataset we created."
"Check the size of the dataset we created."
]
},
{
Expand Down Expand Up @@ -272,10 +272,10 @@
"We can see that we have a dataset of 10 tiles that are 256x256 each in 4 color channels.\n",
"\n",
"```{Note}\n",
"If you're running into errors when the image is being tiled, make sure that you have defined a coordinate bounding box that is large enough for tiling. We choose a smaller image here for the sake of fitting onto the Read the Docs server. Ideally, you'd want the side of your overall image to be at least 10x the side of your output tiles.\n",
"If you are running into errors when the image is being tiled, make sure that you have defined a coordinate bounding box that is large enough for tiling. We choose a smaller image here for the sake of fitting onto the Read the Docs server. Ideally, you want the side of your overall image to be at least 10x the side of your output tiles.\n",
"```\n",
"\n",
"Next, let's see how to use `flipnslide` on existing data."
"Next, we demonstrate how to apply `flipnslide` on existing data."
]
},
{
Expand All @@ -287,7 +287,7 @@
"source": [
"## Running `flipnslide` on Pre-Downloaded Image Data\n",
"\n",
"We can run `flipnslide` directly on a large image, as long as it's a `numpy` nd.array. For the sake of memory space in this tutorial, we'll create a sample image from random `numpy` data."
"We can run `flipnslide` directly on a large image, as long as it's a `numpy` nd.array. For the sake of memory space in this tutorial, we create a sample image from random `numpy` data."
]
},
{
Expand Down Expand Up @@ -321,7 +321,7 @@
"user_expressions": []
},
"source": [
"Once we have our image in memory, we can run `flipnslide`. Let's test creating tiles of size 64x64 to be output as a pytorch tensor, and saved to memory. Since we ran `verbose` when we downloaded our image in the previous section, we'll run this one quietly."
"Once we have our image in memory, we can run `flipnslide`. Let's test creating tiles of size 64x64 to be output as a pytorch tensor, and saved to memory. Since we ran `verbose` when we downloaded our image in the previous section, we choose to run this one quietly."
]
},
{
Expand All @@ -344,9 +344,9 @@
"user_expressions": []
},
"source": [
"Notice how running this saved a file called `flipnslide_tiles.pt` in your directory. By calling `save=True`, we saved a local copy of our tensor, but if you don't want a local copy, leave out this keyword.\n",
"Notice how running this saved a file called `flipnslide_tiles.pt` in your directory. By calling `save=True`, we saved a local copy of our tensor, but if you do not want a local copy, leave out this keyword.\n",
"\n",
"Let's check on the shape of our tiles."
"Check on the shape of our tiles."
]
},
{
Expand Down Expand Up @@ -391,7 +391,7 @@
"user_expressions": []
},
"source": [
"We can see that our code output a dataset of 11,866 tiles with a size 64x64 and 3 color channels as a `PyTorch` tensor.\n",
"Our code output a dataset of 11,866 tiles with a size 64x64 and 3 color channels as a `PyTorch` tensor.\n",
"\n",
"Both the `numpy` array from the example using the downloaded image from NYC and the `PyTorch` tensor from this example are ready for immediate use with machine learning algorithms."
]
Expand Down

0 comments on commit 3b932a3

Please sign in to comment.