Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Capture and define SMAP products and layers

Introduction

Data products from the Soil Moisture Active Passive (SMAP) mission contain many layers. Different layers are interesting for different tasks. This post describes how to capture SMAP products and define which layers to retrieve in the postgres database of Karttur’s GeoImagine Framework. The next post covers how to use postgres SQL for changing the retrieval status of individual layers.

Prerequisites

You must have the complete SPIDE installed as described in the post Install and setup spatial data IDE. You must have setup Karttur’s GeoImagine Framework, either by importing or by copying (drag and drop). The Framework postgres database must be setup and the processes defined.

Get the layers

The layers included in each SMAP product are summarised on the Earthdata pages of the National Snow and Ice Data Center (NSIDC). The description of the layers, however, is much better in the downloadable .hdf files. To insert the layers in the database semi-automatically you need one (1) downloaded fie representing the product you want register. Further, the downloaded file must be saved in the predefined hierarchical structure of the Framework. This will assure that layers exploded from the .hdf are saved under the correct path. The easiest way to achieve this is to download SMAP products with the Framework itself, as described in the previous post. You can also download a single product file manually from NSIDC and create the correct path manually.

With a .hdf file representing the SMAP prodict you want to register in the SMAP.template table in place, open a terminal window. The newly opened window should have your home directory as working directory (you can try that by typing $ pwd at the prompt.)

Do not change the directory, but let the terminal operate from your home directory. Then use gdalinfo to get the information on the product file. You have to give the full path to the file, but that will also preserve the full path in the report from gdalinfo:

$ gdalinfo /Volumes/Pegasus6/SMAP/SPL3SMP-E.002/region/original/global/20150331/SMAP_L3_SM_P_E_20150331_R16010_001.h

gdalinfo returns a very long report (several thousand of lines). Just copy the result to an empty plain text editor, and save it as a .txt file.

Open the stand alone module definetemplate.py under the geoimagine.smap package. Glue the full path to the .txt file you just saved as follows:

srcFPN = ['/Users/thomasgumbricht/Dropbox/projects/geoimagine/USERS/karttur/SMAP/gdalinfo-excerpts/SPL3SMP-E.txt',4310]

and run the module.

The module will generate an xml coded database entry in your Python IDE. This entry has to be manually copied and pasted to the template definition (default name = ‘SMAP_template_v80_sql.xml’), as shown under Hide/Show.

Run the Framework command for adding the rows to the table smap.templates.

You have to manually set the layers you want the system to download. Either by editing directly in the xml code (above) or using SQL as outlined in the next post.