Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.5 and filter by bounding box coordinates #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ develop-eggs
.installed.cfg
lib
lib64
*idea

# Installer logs
pip-log.txt
Expand Down
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ get_modis
Description
--------------

This repository contains a Python script (and executable) that allows one to download MODIS data granules for different products and periods.
This repository contains a Python 3.5 script (and executable) that allows one to download MODIS data granules for different products, periods and non-reprojected images (with lat/lon coordinates).

The code is quite simple and generic, and should work with most standard Python installations.

Expand Down Expand Up @@ -38,6 +38,8 @@ issuing the ``-h`` or ``--help`` commands:
collection number), the year, the MODIS reference tile and additionally, where
to save the data to, and whether to verbose. The user may also select a
temporal period in terms of days of year.
New: Now this program is compatible with Python 3.5 and it can download non-reprojected
MODIS images with lat/lon coordinates (now it parses the hdf associated xml for the bounding box).

EXAMPLES

Expand Down Expand Up @@ -72,6 +74,7 @@ issuing the ``-h`` or ``--help`` commands:
MODIS product name with collection tag at the end
(e.g. MOD09GA.005)
--tile=TILE, -t TILE Required tile (h17v04, for example)
--coordinates=COORDINATES, -c COORDINATES Required bounding box in the form: lat,lon,lat,lon (upperleft, downright point)
--year=YEAR, -y YEAR Year of interest
--output=DIR_OUT, -o DIR_OUT
Output directory
Expand All @@ -89,5 +92,6 @@ Useful things to bear in mind:
* The product must have an indication of the collection follwing the product name. i.e. ``MCD45A1.005``)
* The ``--begin`` and ``--end`` flags are optional, and yu can ignore them if you just want the complete year
* Use the ``--proxy`` option to set the required proxy. It should be read from the environment variable, but this is added flexiblity
* Use ``-t`` for TILE **OR** ``-c`` for COORDINATES NOT AT THE SAME TIME, otherwise it downloads only by coordinates

The code has some logic not to download files several times, and the overall behaviour rests on the ``--quick`` flag: if this flag is **not** set, then the program will look at the remote available files and skip any files that are present and have the same file size as the remote. In some cases, this could lead to duplicities are re-processing takes place. If the ``--quick`` flag is set, then when the remote list of available dates is created, any present files that match the requested product and year will be ignored, irrespective of file size. This can mean that files that failed to download half way through will not the downloaded, but it's an overall faster process if a download failed halfway through a year.
Loading