Skip to content

Instantly share code, notes, and snippets.

View kapadia's full-sized avatar
💭
eating a pecan bar

Amit Kapadia kapadia

💭
eating a pecan bar
View GitHub Profile
@kapadia
kapadia / main.py
Created February 1, 2023 21:50
Interface with LP DAAC using Earthdata token
import os
import rasterio as rio
url = "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T22KDF.2023030T133831.v2.0/HLS.S30.T22KDF.2023030T133831.v2.0.B05.tif"
token = os.environ.get("NASA_EARTHDATA_TOKEN")
gdal_env = {
"GDAL_HTTP_HEADERS": f"Authorization: Bearer {token}",
"GDAL_DISABLE_READDIR_ON_OPEN": "EMPTY_DIR",
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
· Running 111 total benchmarks (1 commits * 1 environments * 111 benchmarks)
[ 0.00%] ·· Building for existing-py_usr_bin_python
[ 0.00%] ·· Benchmarking existing-py_usr_bin_python
[ 0.90%] ··· Running bench_app.LaplaceInplace.time_it ok
[ 0.90%] ····
========= ==========
update
--------- ----------
inplace 214.81ms
normal 357.44ms
· Running 111 total benchmarks (1 commits * 1 environments * 111 benchmarks)
[ 0.00%] ·· Building for existing-py_usr_bin_python
[ 0.00%] ·· Benchmarking existing-py_usr_bin_python
[ 0.90%] ··· Running bench_app.LaplaceInplace.time_it ok
[ 0.90%] ····
========= ==========
update
--------- ----------
inplace 208.85ms
normal 359.32ms
#!/usr/bin/env python
import math
import json
import pyproj
R = 6371000
def tile_gall_peters_projection():
#!/usr/bin/env python
import os
import json
import gzip
import requests
from datetime import datetime
from dateutil.parser import parse