Skip to content

Instantly share code, notes, and snippets.

@dwtkns
Last active October 1, 2017 20:19

Revisions

  1. dwtkns revised this gist Jul 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion l8get
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,6 @@ function l8get() {
    gsutil cp gs://earthengine-public/landsat/L8/$path/$row/$id.tar.bz .

    echo ""
    echo tar -jxvf *.tar.bz '*_B[4328].TIF'
    echo "tar -jxvf *.tar.bz '*_B[4328].TIF'"

    }
  2. dwtkns created this gist Jul 7, 2014.
    22 changes: 22 additions & 0 deletions l8get
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers
    # For example:
    # l8get LC81690352014169LGN00

    # The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue)

    # On OSX this would go into your ~/.bash_profile file.
    # Requires gsutil from https://developers.google.com/storage/docs/gsutil_install
    # Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/

    function l8get() {
    id="$1"
    path=${id:3:3}
    row=${id:6:3}
    yr=${id:9:4}

    gsutil cp gs://earthengine-public/landsat/L8/$path/$row/$id.tar.bz .

    echo ""
    echo tar -jxvf *.tar.bz '*_B[4328].TIF'

    }