Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Marc Farra https://github.com/kamicut
Drew Bollinger https://github.com/drewbo
Sean Gillies https://github.com/sgillies
Alex Kappel https://twitter.com/alex_kappel
Matthew Hanson https://github.com/matthewhanson

See also https://github.com/developmentseed/landsat-util/graphs/contributors.
36 changes: 21 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get install --yes git-core python-pip python-scipy libgdal-dev libatlas-base-dev gfortran libfreetype6-dev libglib2.0-dev zlib1g-dev python-pycurl
ADD . /landsat
RUN pip install setuptools
RUN pip install -U pip
RUN pip install wheel
RUN pip install https://s3-us-west-2.amazonaws.com/ds-satellite-projects/landsat-util/numpy-1.10.4-cp27-cp27mu-linux_x86_64.whl
RUN pip install https://s3-us-west-2.amazonaws.com/ds-satellite-projects/landsat-util/Pillow-3.1.1-cp27-cp27mu-linux_x86_64.whl
RUN pip install https://s3-us-west-2.amazonaws.com/ds-satellite-projects/landsat-util/scikit_image-0.12.3-cp27-cp27mu-manylinux1_x86_64.whl
RUN cd /landsat && pip install -r requirements-dev.txt
RUN sed -i 's/numpy.*//g' /landsat/requirements.txt
RUN sed -i 's/scipy.*//g' /landsat/requirements.txt
RUN sed -i 's/scikit-image.*//g' /landsat/requirements.txt
RUN cd /landsat && pip install -e .
FROM developmentseed/geolambda:full

#RUN \
# yum install -y openssl-devel

ENV \
PYCURL_SSL_LIBRARY=nss

WORKDIR /build

COPY requirements*txt /build/

RUN \
pip-3.6 install -r requirements.txt; \
pip-3.6 install -r requirements-dev.txt;

COPY . /build/

RUN pip-3.6 install .

WORKDIR /home/geolambda
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '2'

services:

base:
build:
context: .
image: 'developmentseed/landsat-util:latest'
entrypoint: /bin/bash
env_file: .env
volumes:
- '.:/home/geolambda/work'

landsat:
image: 'developmentseed/landsat-util:latest'
working_dir: /home/geolambda
entrypoint: landsat
env_file: .env
volumes:
- '.:/home/geolambda/work'

test:
image: 'developmentseed/landsat-util:latest'
working_dir: /home/geolambda
entrypoint: bash -c 'pytest tests/';
env_file: .env
volumes:
- './lambda:/home/geolambda/lambda'
- './tests:/home/geolambda/tests'

package:
image: 'developmentseed/landsat-util:latest'
command: lambda-package.sh
working_dir: /home/geolambda/work
volumes:
- '.:/home/geolambda/work'

testpackage:
image: 'developmentseed/geolambda:base'
command: bash -c "pytest tests/";
working_dir: /home/geolambda
env_file: .env
volumes:
- './tests:/home/geolambda/tests'

13 changes: 10 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ Mac OSX
Ubuntu 14.04
++++++++++++

Use pip to install landsat-util. If you are not using virtualenv, you might have to run ``pip`` as ``sudo``::
Use pip to install landsat-util. Follow these instructions to `install pip on Ubuntu`_::

$: sudo apt-get update
$: sudo apt-get install python-pip python-numpy python-scipy libgdal-dev libatlas-base-dev gfortran libfreetype6-dev
$: pip install landsat-util
$: sudo apt-get install libgdal-dev python3-dev build-essential
$: pip3 install numpy
$: pip3 install landsat-util

.. _`install pip on Ubuntu`: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

If you are not using virtualenv, you might have to use the ``--user`` flag with ``pip`` (see `description of pip user installs`_).

.. _`description of pip user installs`: https://pip.pypa.io/en/stable/user_guide/#user-installs

Other systems
+++++++++++++
Expand Down
22 changes: 0 additions & 22 deletions landsat-util.sublime-project

This file was deleted.

2 changes: 1 addition & 1 deletion landsat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.13.1'
__version__ = '0.14.0'
3 changes: 1 addition & 2 deletions landsat/landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from datetime import datetime
from dateutil.relativedelta import relativedelta
from dateutil.parser import parse
import pycurl
from boto.exception import NoAuthHandlerFound

from .downloader import Downloader, IncorrectSceneId, RemoteFileDoesntExist, USGSInventoryAccessMissing
Expand Down Expand Up @@ -493,5 +492,5 @@ def __main__():
if __name__ == "__main__":
try:
__main__()
except (KeyboardInterrupt, pycurl.error):
except KeyboardInterrupt:
exit('Received Ctrl + C... Exiting! Bye.', 1)
6 changes: 3 additions & 3 deletions landsat/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def search(self, paths_rows=None, lat=None, lon=None, address=None, start_date=N
'path': three_digit(r['path']),
'thumbnail': r['browseURL'],
'date': r['acquisitionDate'],
'cloud': r['cloudCoverFull']
'cloud': r['cloud_coverage']
},
'geometry': {
'type': 'Polygon',
Expand Down Expand Up @@ -147,7 +147,7 @@ def search(self, paths_rows=None, lat=None, lon=None, address=None, start_date=N
'row': three_digit(i['row']),
'thumbnail': i['browseURL'],
'date': i['acquisitionDate'],
'cloud': i['cloudCoverFull']}
'cloud': i['cloud_coverage']}
for i in r_dict['results']]

return result
Expand Down Expand Up @@ -288,7 +288,7 @@ def cloud_cover_prct_range_builder(self, min=0, max=100):
:returns:
String
"""
return 'cloudCoverFull:[%s+TO+%s]' % (min, max)
return 'cloud_coverage:[%s+TO+%s]' % (min, max)

def address_builder(self, address):
""" Builds lat and lon query from a geocoded address.
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pdoc>=0.3.1
nose>=1.3.7
coverage>=4.0
Sphinx>=1.3.1
wheel>=0.26.0
mock>=1.3.0
jsonschema==2.5.1
pytest==3.6.1
27 changes: 13 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
usgs==0.1.9
requests==2.7.0
python-dateutil==2.5.1
numpy==1.10.4
termcolor==1.1.0
rasterio==0.32.0
six>=1.8.0
scipy==0.17.0
scikit-image==0.12.3
homura==0.1.3
boto==2.39.0
polyline==1.3
geocoder==1.9.0
matplotlib==1.5.1
usgs>=0.2.1
requests~=2.7
python-dateutil>=2.5.1,<3.*
numpy>=1.10.4,<2.*
termcolor~=1.1
rasterio~=0.36
six~=1.8
scipy~=0.17
scikit-image>=0.12.3,<1.*
homura>=0.1.3,<1.*
boto~=2.39
polyline~=1.3
geocoder~=1.9
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def readme():
license='CCO',
platforms='Posix; MacOS X; Windows',
install_requires=INSTALL_REQUIRES,
test_suite='nose.collector',
tests_require=TEST_REQUIRES,
**setup_kwargs
)
10 changes: 5 additions & 5 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_query_builder(self):
self.assertRaises(ValueError, self.s.query_builder, paths_rows='003,004,010')

# full example
expected_string = ('acquisitionDate:[2014-01-01+TO+2014-11-12]+AND+cloudCoverFull:[10+TO+28]+AND+upperLeftCo'
expected_string = ('acquisitionDate:[2014-01-01+TO+2014-11-12]+AND+cloud_coverage:[10+TO+28]+AND+upperLeftCo'
'rnerLatitude:[23+TO+1000]+AND+lowerRightCornerLatitude:[-1000+TO+23]+AND+lowerLeftCorner'
'Longitude:[-1000+TO+21]+AND+upperRightCornerLongitude:[21+TO+1000]+AND+((path:003+AND+ro'
'w:004))')
Expand All @@ -99,19 +99,19 @@ def test_lat_lon_builder(self):
def test_cloud_cover_prct_range_builder(self):
# no input
string = self.s.cloud_cover_prct_range_builder()
self.assertEqual('cloudCoverFull:[0+TO+100]', string)
self.assertEqual('cloud_coverage:[0+TO+100]', string)

# just min
string = self.s.cloud_cover_prct_range_builder(3)
self.assertEqual('cloudCoverFull:[3+TO+100]', string)
self.assertEqual('cloud_coverage:[3+TO+100]', string)

# just max
string = self.s.cloud_cover_prct_range_builder(max=30)
self.assertEqual('cloudCoverFull:[0+TO+30]', string)
self.assertEqual('cloud_coverage:[0+TO+30]', string)

# both inputs
string = self.s.cloud_cover_prct_range_builder(7, 10)
self.assertEqual('cloudCoverFull:[7+TO+10]', string)
self.assertEqual('cloud_coverage:[7+TO+10]', string)

def test_date_range_builder(self):
string = self.s.date_range_builder('2014-01-01', '2015-01-01')
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ deps =
pip>=8.1.1
jsonschema
mock>=1.3.0
nose>=1.3.7
pytest
commands =
pip install -r requirements.txt
Expand Down