Skip to content

Commit

Permalink
Updates example data, removes downloading unit test for time being
Browse files Browse the repository at this point in the history
  • Loading branch information
John Brandt committed Jul 21, 2020
1 parent 8057fab commit 8ca32f4
Show file tree
Hide file tree
Showing 4 changed files with 426 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"source": [
"# If using example raw data\n",
"import os\n",
"if not os.path.exists(\"../data/raw/\"):\n",
" os.makedirs(\"../data/raw/\")\n",
"if not os.path.exists(\"../data/example/raw\"):\n",
" os.makedirs(\"../data/example/raw/\")\n",
" \n",
"landscape = 'example-raw'\n",
"landscape = 'example'\n",
"OUTPUT_FOLDER = '../data/{}/'.format(landscape)\n",
"coords = (13.727334, -90.015579)\n",
"coords = (coords[1], coords[0])"
Expand All @@ -58,9 +58,9 @@
"outputs": [],
"source": [
"# Download example raw data - only if you don't have an API key!\n",
"!curl https://restoration-monitoring-external.s3.amazonaws.com/restoration-mapper/example/example-raw.zip \\\n",
" -o ../data/data.zip\n",
"!unzip ../data/data.zip -d ../data/"
"!curl https://restoration-monitoring-external.s3.amazonaws.com/restoration-mapper/example/example.zip \\\n",
" -o ../data/example/raw/data.zip\n",
"!unzip ../data/example/raw/data.zip -d ../data/example/raw/"
]
},
{
Expand Down Expand Up @@ -117,11 +117,14 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../config.yaml\", 'r') as stream:\n",
" key = (yaml.safe_load(stream))\n",
" API_KEY = key['key']\n",
" AWSKEY = key['awskey']\n",
" AWSSECRET = key['awssecret']"
"if os.path.exists(\"../config.yaml\"):\n",
" with open(\"../config.yaml\", 'r') as stream:\n",
" key = (yaml.safe_load(stream))\n",
" API_KEY = key['key']\n",
" AWSKEY = key['awskey']\n",
" AWSSECRET = key['awssecret']\n",
"else:\n",
" API_KEY = \"none\""
]
},
{
Expand Down Expand Up @@ -272,7 +275,7 @@
"}\n",
"\n",
"landscape = 'brazil-buffer'\n",
"OUTPUT_FOLDER = '../tile_data/{}/'.format(landscape)\n",
"OUTPUT_FOLDER = '../data/{}/'.format(landscape)\n",
"coords = landscapes[landscape]\n",
"coords = (coords[1], coords[0])\n",
"print(OUTPUT_FOLDER, coords)"
Expand Down
27 changes: 15 additions & 12 deletions notebooks/4a-download-large-area.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"source": [
"# If using example raw data\n",
"import os\n",
"if not os.path.exists(\"../data/raw/\"):\n",
" os.makedirs(\"../data/raw/\")\n",
"if not os.path.exists(\"../data/example/raw\"):\n",
" os.makedirs(\"../data/example/raw/\")\n",
" \n",
"landscape = 'example-raw'\n",
"landscape = 'example'\n",
"OUTPUT_FOLDER = '../data/{}/'.format(landscape)\n",
"coords = (13.727334, -90.015579)\n",
"coords = (coords[1], coords[0])"
Expand All @@ -58,9 +58,9 @@
"outputs": [],
"source": [
"# Download example raw data - only if you don't have an API key!\n",
"!curl https://restoration-monitoring-external.s3.amazonaws.com/restoration-mapper/example/example-raw.zip \\\n",
" -o ../data/data.zip\n",
"!unzip ../data/data.zip -d ../data/"
"!curl https://restoration-monitoring-external.s3.amazonaws.com/restoration-mapper/example/example.zip \\\n",
" -o ../data/example/raw/data.zip\n",
"!unzip ../data/example/raw/data.zip -d ../data/example/raw/"
]
},
{
Expand Down Expand Up @@ -117,11 +117,14 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../config.yaml\", 'r') as stream:\n",
" key = (yaml.safe_load(stream))\n",
" API_KEY = key['key']\n",
" AWSKEY = key['awskey']\n",
" AWSSECRET = key['awssecret']"
"if os.path.exists(\"../config.yaml\"):\n",
" with open(\"../config.yaml\", 'r') as stream:\n",
" key = (yaml.safe_load(stream))\n",
" API_KEY = key['key']\n",
" AWSKEY = key['awskey']\n",
" AWSSECRET = key['awssecret']\n",
"else:\n",
" API_KEY = \"none\""
]
},
{
Expand Down Expand Up @@ -272,7 +275,7 @@
"}\n",
"\n",
"landscape = 'brazil-buffer'\n",
"OUTPUT_FOLDER = '../tile_data/{}/'.format(landscape)\n",
"OUTPUT_FOLDER = '../data/{}/'.format(landscape)\n",
"coords = landscapes[landscape]\n",
"coords = (coords[1], coords[0])\n",
"print(OUTPUT_FOLDER, coords)"
Expand Down
Loading

0 comments on commit 8ca32f4

Please sign in to comment.