Skip to main content

Description

This code converts the soil moisture (‘SoilMoistureNPD’) parameter in the AMSR2 NRT Land product in HDF-EOS5 format to GeoTIFF. Documentation is provided in the Python code to outline what each section of code does.

Supporting Software Information

TYPEACCESS
Python ScriptOpen Source

How to use

This code converts the soil moisture (‘SoilMoistureNPD’) parameter in the AMSR2 NRT Land product in HDF-EOS5 format to GeoTIFF. Documentation is provided in the Python code to outline what each section of code does.

Step 1

The output projection information that will be used to georeference the AMSR2 NRT Land data are defined below. The projection is NSIDC EASE-Grid Global.

Screenshot of code showing the projection information

Step 2

Navigate to the folder on your computer where you have saved the AMSR2 NRT Land HDF-EOS5 data file(s). From the address bar, copy the file path (i.e., ‘C:\Users\lwang\Documents\AMSR\data\’). Paste the file path within the quotation marks for the variable ‘files’ highlighted in blue below (Line 66). For Python, the backslashes need to be changed to forward slashes. At the end of the file path, add the filename of the AMSR2 NRT Land file after the last forward slash as shown.

Screenshot of step 2 of the input code hightlighted

The above shows how to make a GeoTIFF for a parameter from a single file. To make GeoTIFF from multiple input files, simply add all input files to the ‘files’ variable in Line 66:

Screenshot showing part 2 of step 2 with code highlighted

An alternative way to specify multiple files to be processed is to comment off ‘files = …’ in Line 66, and uncomment Line 69 as shown below:

Screenshot of an alternate code input highlighted

Step 3

Users can set ‘useGIBScolors’ to True/False to elect the use of GIBS color scheme or not. In the case of using GIBS color scheme, unzip the colormaps.zip in the code folder (i.e., unzipped from Geotiff_recipes.zip) to get a folder labeled ‘colormaps’. It contains a set of GIBS colormap files to use. Save this folder on your computer. From the address bar, copy the file path (i.e., ‘C:\Users\lwang\Documents\AMSR\colormaps\’). Paste the file path within the quotation marks for the variable ‘gibsMapDir’ highlighted in blue below (Line 77). Again, the backslashes need to be changed to forward slashes.

Screenshot of code for step 3

Step 4

For this data recipe we are extracting the “SoilMoistureNPD” parameter from the HDF-EOS5 file to create the GeoTIFF file (Line 73). In the case of multiple input files, a “for” loop is used to loop through each data file, extract ‘SoilMoistureNPD’, and concatenate (Line 83 to Line 89). Only take data with good samples (Line 96). Read latitude and longitude values from the input file (Line 100, 101).

Screenshot of step 4 code part 1
Screenshot of part 2 of step 4
Screenshot of step 4 part 3

Step 5

Perform a geographic transformation to georeference the data according to the NSIDC EASE-Grid Global parameters:

Screenshot of step 5 code block

Step 6

Create and save a GEOTIFF file to a folder on your computer. Line 149 defines the GeoTIFF filename. Create or locate a folder on your computer where you would like this GeoTIFF file to be saved. As done in STEP 2, copy the file path and paste it within the code in the area highlighted in blue below. Make sure a forward slash is included at the end of the file path.

Step 6 code block highlighted.

Step 7

Simply run the code and check your output folder, a GeoTIFF file should now be located within the folder.

Screenshot of the output folder showing the resulting file

Example of GeoTIFF files created by geotiff_land.py:

Example of GeoTIFF files created by geotiff_land.py

Dataset Information

Dataset NameNRT AMSR2 Unified L2B Half-Orbit 25 km EASE-Grid Surface Soil Moisture Beta V2
PlatformGlobal Change Observation Mission - Water 1 (GCOM-W1) 
InstrumentAdvanced Microwave Radiometer 2 (AMSR2)
Science ParameterSoil Moisture
FormatHDF-EOS5
Data InformationCMR Search

Key Parameters

VariableDescriptionDimensionUnitsScale Factor
SoilMoistureNPDSoil moisture as determined by the NPD algorithm1Dcm3/cm3none

Details

Last Updated

Published on

Data Centers

Global Hydrometeorology Resource Center DAAC (GHRC DAAC)