python download script instructions – use with .csv or .metalink … · 2020. 7. 13. · python...

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

Upload: others

Post on 27-Jan-2021

16 views

Category:

Documents


0 download

TRANSCRIPT

  • PythonDownloadScriptInstructions–usewith.csvor.metalinkfiles, v.1

    Purpose:Usersoftenliketodownloadthemetadataformultipleproductsfromasearchthensortandeliminatesomeoftheproductsbeforedownloading.Thisscriptallowsyoutodownloadonlythedatayoudecidetokeep.

    Ifyouwanttodownloadallitemsinyourqueue,usethebuttoninthe lower left of the download queuewindow. Using this option automatically loads the scriptwithallitemsinthequeue.InstructionsforusingthisbulkdownloadoptioncanbeviewedHERE.

    Requirementsforuse:•Earthdatalogincredentials•Mac,Windows,orLinux•Python2.6.5,2.7.5,or3.0o

    PythoncomesinstalledwithMacOSX§ToupgradeonMac•

    https://www.python.org/downloads/oSeeinstallationtipsbelowo

    Windowsuserswillhavetodownloadandinstallit.§https://www.python.org/downloads/windows/•

    Seeinstallationtipsbelow

    Steps:1. CreateacsvormetalinkfileConductasearchinVertexandaddproductsfromthesearchresultsintoyourdownloadqueue.Createacsvormetalinkfilebyclickingeithertheorthebuttonlocatedatthebottomofthedownloadqueuewindow.

    1

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

  • 2. Sorttheproducts(optional)Youcanopenthe.csv(spreadsheet)or.metalink(texteditor)fileandsortthedata,deleting productrowsthatyoudon’twanttodownload.However,donotdeleteanycolumns–all columnsmustberetainedforthescripttowork.

    3. GetthescriptDownloadthebulk_download.pyscript tothesamedirectoryasthe csvor metalinkfile.

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

    4. Runthescripta. OpenaCommandwindow(Windows)oraTerminalwindow(Mac).

    ForWindows7• ClicktheStartMenubuttoninthebottomleftcornerofthescreen

    • Typecmdinthe“Searchprogramsandfiles”boxand

    • CommandlinewindowandpromptForWindows10• ClickontheStartmenubutton(Windowsicon)andtypecmd

    2

  • ForMacOSX•• Highlight“Applications”intheFavoriteslist• TypeTerminalintheSearchbox• Double-clicktoopen

    b. Atthepromptenteroneofthesecommands,dependingonwhetheryoudownloadeda.csvor.metalinkfile:Substituteyourfile nameforfilename

    python bulk_download.py filename.csv python bulk_download.py filename.metalink

    c. Ifyouarenotalreadyloggedin,youwillbepromptedtologinwithyourEarthdata Logincredentials.

    d. Downloadwillbegin.

    AppendixInstructionsforInstalling Python

    InstallingPythonforMacOSX

    1. Gotohttps://www.python.org/downloads/andclickonthe button

    3

    ClickontheFindericoninthetoolbar

  • 2. Openthedownloadedfile(*.pkg)

    3. ThePythonInstallerwindowopens.Click

    4. Click

    4

  • 5. Click

    6. Clicktoagreetothelicenseagreement

    7. Click

    8. Click

    9. Ifprompted,enteryourusernameandpasswordtoallowtheinstallationtoproceed

    10. Installationbegins

    11. Installationiscomplete

    5

  • InstallingPythonforWindows

    1. Gotohttps://www.python.org/downloads/release/python-352/

    2. DownloadtheappropriateWindowsexecutableinstallerfilea. Windowsx86-64fora64-bitoperatingsystemb. Windowsx86fora32-bitoperatingsystem

    6

  • 3. Openthedownloadedfile4. IntheInstallPython2.5.2window,makesurethe“Installlauncherforallusers”and

    “AddPython3.5toPATH”boxesarechecked.Clickon“InstallNow”

    5. Ifprompted,allowchangestobemadetothecomputer6. Installationbegins

    7

  • 7. Installationiscomplete

    8

    UntitledUntitled