Skip to content

Commit

Permalink
[code] Updating data download, and a few import fixes (#95)
Browse files Browse the repository at this point in the history
* [code] adding new data dl and a few import issues fixed
* [code] minor version update to ensure students can see updates
  • Loading branch information
Leah Wasser committed Oct 31, 2018
1 parent cec51fa commit ad143d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions earthpy/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
from download import download



# Data URLs, structured as {'week_name': [(URL, FILENAME, FILETYPE)]}
# If ZIPFILE / TARFILE / etc, we'll unzip to a folder w/ the week's name
# If zipfile, tarfile, etc, unzip to a folder w/ the name
DATA_URLS = {

'co-flood-extras': [('https://ndownloader.figshare.com/files/7010681', 'boulder-precip.csv', 'file'),
('https://ndownloader.figshare.com/files/7010681', 'temperature_example.csv', 'file')],
('https://ndownloader.figshare.com/files/7010681', 'temperature_example.csv', 'file')],
'colorado-flood': ('https://ndownloader.figshare.com/files/12395030', '.', 'zip'),
'spatial-vector-lidar': ('https://ndownloader.figshare.com/files/12459464', '.', 'zip'),
'cold-springs-modis-h5': ('https://ndownloader.figshare.com/files/10960112', '.', 'zip'),
'cold-springs-fire': ('https://ndownloader.figshare.com/files/10960109', '.', 'zip'),
'cs-test-naip': ('https://ndownloader.figshare.com/files/10960211?private_link=18f892d9f3645344b2fe', '.', 'zip'),
'cs-test-landsat': ('https://ndownloader.figshare.com/files/10960214?private_link=fbba903d00e1848b423e', '.', 'zip'),
'ndvi-automation': ('https://ndownloader.figshare.com/files/13431344', '.', 'zip'),

}

Expand Down
3 changes: 2 additions & 1 deletion earthpy/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import geopandas as gpd
import rasterio as rio
from rasterio.mask import mask
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -181,7 +182,7 @@ def crop_image(raster, geoms, all_touched=True):
else:
clip_ext = geoms
# Mask the input image and update the metadata
out_image, out_transform = rio.mask.mask(raster, clip_ext, crop=True, all_touched=all_touched)
out_image, out_transform = mask(raster, clip_ext, crop=True, all_touched=all_touched)
out_meta = raster.meta.copy()
out_meta.update({"driver": "GTiff",
"height": out_image.shape[1],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
DESCRIPTION = 'A set of helper functions to make working with spatial data in open source tools easier. This package is maintained by Earth Lab and was originally designed to support the earth analytics education program.'
MAINTAINER = 'Leah Wasser'
MAINTAINER_EMAIL = 'leah.wasser@colorado.edu'
VERSION = '0.0.3-git'
VERSION = '0.0.3a-git'


def configuration(parent_package='', top_path=None):
Expand Down

0 comments on commit ad143d3

Please sign in to comment.