Question: I need download Modis imagery automatically from the website: <https://earthdata.nasa.gov/>.

I found this link: <http://gis-techniques.blogspot.com/2010/06/getting-modis-image-automatically-from.html>

but I can't run it. In that code there's the line:

`logFileread=open(r"D:\MODIS\MOD09\lpdaac.txt",'r')`

I don't know the structure of this file.I don't know how to create it.
If anyone knows the answer, please tell me.

Answer: 
The comment above the line in question says: 

```
# Read the log file to retrive the information of latest downloaded data

```

It looks like this file keeps track of which directories (dates) have already been downloaded. Further down the same file is referenced again (here to write, not read):

```
# Write download information in the log file
logFwrite=open(r"H:\MODIS_LST_NDVI\MOD11A2\lpdaac.txt",'w')

```

Running the script the first time, you haven't downloaded anything yet, so I wouldn't expect anything in that file. What happens if you just create an empty file, and change the script to point to that (both places)?
You can also use [this script](https://github.com/jgomezdans/get_modis). It's quite easy to use to get MOD09/MYD09:
The following example downloads daily surface reflectance from the TERRA platform for tile h17v04 for 2004, between DoY 153 and 243, and putting it in folder `/tmp/`

`bash
$ ./get_modis.py --username YOUR_USERNAME --password YOUR_PASSWORD \
 -v -p MOD09GA.006 -s MOLT -y 2004 -t h17v04 -o /tmp/ -b 153 -e 243`