0% found this document useful (0 votes)
3 views

asf_datarecipe_python_download_script_v1

This document provides instructions for using a Python script to download selected metadata from a search queue in .csv or .metalink formats. Users must have Earthdata login credentials and a compatible version of Python installed on their system. The document outlines the steps to create the necessary files, sort the products, download the script, and execute it to initiate the download process.

Uploaded by

gngonyo03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

asf_datarecipe_python_download_script_v1

This document provides instructions for using a Python script to download selected metadata from a search queue in .csv or .metalink formats. Users must have Earthdata login credentials and a compatible version of Python installed on their system. The document outlines the steps to create the necessary files, sort the products, download the script, and execute it to initiate the download process.

Uploaded by

gngonyo03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Python Download Script Instructions – use with .csv or .metalink files, v.

1
Purpose:
Users often like to download the metadata for multiple products from a search then sort and
eliminate some of the products before downloading. This script allows you to download only the
data you decide to keep.
If you want to download all items in your queue, use the <Download Python Script(.py)> button in
the lower left of the download queue window. Using this option automatically loads the script
with all items in the queue. Instructions for using this bulk download option can be viewed HERE.

Requirements for use:



Earthdata login credentials

Mac, Windows, or Linux

Python 2.6.5, 2.7.5, or 3.0
o
Python comes installed with Mac OS X
§
To upgrade on Mac

https://www.python.org/downloads/
o
See installation tips below
o
Windows users will have to download and install it.
§
https://www.python.org/downloads/windows/

See installation tips below
Steps:
1. Create a csv or metalink file
Conduct a search in Vertex and add products from the search results into your download queue.
Create a csv or metalink file by clicking either the <Download Metadata (.csv)> or the <Bulk
Download (.metalink)> button located at the bottom of the download queue window.

1
2. Sort the products (optional)
You can open the .csv (spreadsheet) or .metalink (text editor) file and sort the data, deleting product
rows that you don’t want to download. However, do not delete any columns – all columns must be
retained for the script to work.

3. Get the script


Download the bulk_download.py script to the same directory as the csv or metalink file.

https://bulk-download.asf.alaska.edu/

4. Run the script


a. Open a Command window (Windows) or a Terminal window (Mac).
For Windows 7
• Click the Start Menu button in the bottom left corner of the screen

• Type cmd in the “Search programs and files” box and <Enter>

• Command line window and prompt


For Windows 10
• Click on the Start menu button (Windows icon) and type cmd

2
For Mac OS X
• Click on the Finder icon in the toolbar
• Highlight “Applications” in the Favorites list
• Type Terminal in the Search box
• Double-click to open

b. At the prompt enter one of these commands, depending on whether you


downloaded a .csv or .metalink file:
Substitute your file name for filename

python bulk_download.py filename.csv


python bulk_download.py filename.metalink

c. If you are not already logged in, you will be prompted to login with your Earthdata Login
credentials.

d. Download will begin.

Appendix
Instructions for Installing Python

Installing Python for Mac OS X

1. Go to https://www.python.org/downloads/ and click on the <Download Python 3.5.2> button

3
2. Open the downloaded file (*.pkg)

3. The Python Installer window opens. Click <Continue>

4. Click <Continue>

4
5. Click <Continue>

6. Click <Agree> to agree to the license agreement

7. Click <Continue>

8. Click <Install>

9. If prompted, enter your username and password


to allow the installation to proceed

10. Installation begins

11. Installation is complete

5
Installing Python for Windows

1. Go to https://www.python.org/downloads/release/python-352/

2. Download the appropriate Windows executable installer file


a. Windows x86-64 for a 64-bit operating system
b. Windows x86 for a 32-bit operating system

6
3. Open the downloaded file
4. In the Install Python 2.5.2 window, make sure the “Install launcher for all users” and
“Add Python 3.5 to PATH” boxes are checked. Click on “Install Now”

5. If prompted, allow changes to be made to the computer


6. Installation begins

7
7. Installation is complete

You might also like