Useful Tools

Some useful tools and guidance using NASA's Black Marble Products

Python scripts to read, convert (GeoTiff), and display (QGIS) VNP46 files. If you do not have GDAL install, you can use the QGIS python console (Plugins -> Python Console) to run the script.

Download the source code to convert NASA's Black Marble HDF5 product to GeoTiff HERE and HDF4 product to GeoTiff HERE

Below are some details on using the tool

Location of the input folder containing HDF images

os.chdir('C:\\InputFolder')

Current script only reads the first file (if there are multiple files in the input folder).The rasterFiles[ ] index can be modified to select one specific file, or iterate through all files within the input folder

hdflayer = gdal.Open(rasterFiles[0], gdal.GA_ReadOnly)

Reading specfic raster layer - GetSubDatasets()[0][0] for first layer, GetSubDatasets()[1][0] for second layer, and so on

hdflayer.GetSubDatasets()[0][0]

Location of the folder for output images

outputFolder = "C:\\OutputFolder\\"

Display output GeoTiff image in QGIS (Only if the script is executed within QGIS python Console)

iface.addRasterLayer(outputRaster, outputNameFinal)

Tool to unpack QF Mask Layer for a specific bit depth to GeoTiff.

Access Python script to unpack QF Mask layer for a given bit range from the NASA's Black Marble VNP46A1/A2 Products into GeoTiff through Black Marble GitHub Repository

Global Black Marble tile grid in vector layer.

Download global Black Marble Grid Reference vector layer in Shapefile format Here

Python and R packages developed by Wordbank to download and process Black Marble data from the NASA LAADS Archive

BlackMarblePY: Github Page, Package Website

BlackMarbleR: Github Page, Package Website

Authors: Robert Andrew Marty and Gabriel Stefanini Vicente, WorldBank.