EMIT Methane Downloader
EMIT Methane Downloader
EmitDownloader fetches NASA EMIT (Earth Surface Mineral Dust Source Investigation) Level-2B methane products for any bounding-box AOI from NASA's LP DAAC. It stages them into a Unity Catalog Volume.
EMIT is an imaging spectrometer on the International Space Station that resolves methane plumes at 60 m. Two EMIT L2B products are fetched together: EMITL2BCH4ENH (per-scene CH4 enhancement COGs) and EMITL2BCH4PLM (per-plume complex products — a COG plus a GeoJSON outline with JPL's emission-rate estimate).
Unlike the Planetary-Computer-backed downloaders (NaipDownloader, DemDownloader, TropomiDownloader), EMIT is served from NASA's LP DAAC via earthaccess and requires authentication. EmitDownloader reads the token from the EARTHDATA_TOKEN environment variable (earthaccess.login(strategy="environment"), via the internal databricks.labs.gbx.earthdata.EarthdataClient). Populate it from a Unity Catalog secret before calling download():
import os
token = dbutils.secrets.get("<catalog>", "<schema>", "earthdata_token")
os.environ["EARTHDATA_TOKEN"] = token
Create an Earthdata Login account and token first if you don't have one.
- GeoBrix installed (the env wheel for the runtime), and
earthaccessas a separate step after it:%pip install "earthaccess>=0.11,<1" "botocore<1.44.0"(the env wheels have no[earthdata]extra; installingearthaccessraises the runtime'sfsspec). See Installation. - Unity Catalog Volume already exists at
/Volumes/{catalog}/{schema}/{volume}/... EARTHDATA_TOKENset in the environment (see above) before callingdownload()
How It Works
EmitDownloader is a thin wrapper over the generic EarthdataClient — the Earthdata analog of StacClient — supplying only the EMIT-specific CMR short names, an asset classifier, and a validation function:
-
discover(bbox, temporal=None)— CMR search (earthaccess.search_data) for bothEMITL2BCH4ENHandEMITL2BCH4PLMover the AOI. Each granule's data links are classified into an asset label (ch4enh,plm_cog, orplm_geojson) or skipped. Returns a metadata-only DataFrame:item_id,asset_name,href. -
download(bbox, out_dir, temporal=None, force=False, ...)— logs in (EARTHDATA_TOKEN), runsdiscover()internally, then fetches each asset driver-side. EMIT/LP DAAC auth mints short-lived per-request credentials that don't fan out like anonymous hrefs, so download is not Spark-distributed. Each asset is validated. The enhancement/plume COGs need a rasterio window read to succeed above a size floor. The plume GeoJSON needs to parse and carry at least one feature. Returns the shared result DataFrame:item_id,asset_name,out_file_path,out_file_sz,is_out_file_valid,last_update. -
Two readers, because EMIT ships two different product shapes:
read_enh(out_dir)— loads the CH4 enhancement COGs asraster_gbxtiles ((source, tile)schema).read_plumes(out_dir)— loads the plume-complex GeoJSON metadata (geojson_gbx) into a typed, per-plume frame with the outline as WKB.
Serverless-safe: no spark.conf.set, _jvm-bridge access, or runtime Spark-config mutation.