How to convert LANCE NRT AMSR2 Rain data to GeoTIFF Format using Python

This code converts total column water vapor (‘TotalColWaterVapor’) in the AMSR2 NRT Rain product in HDF-EOS5 format to GeoTIFF.

Data Recipe Type
Data Format Conversion
Supporting Software Information
TYPE ACCESS
Python Script Python Script Open Source Open Source

 This code converts total column water vapor (‘TotalColWaterVapor’) in the AMSR2 NRT Rain product in HDF-EOS5 format to GeoTIFF.

Step 1

Navigate to the folder on your computer where you have saved the AMSR2 NRT Rain HDF-EOS5 data file. 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 ‘h5file’ highlighted in blue below (Line 48). 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 Rain file after the last forward slash as shown.

Step 2

Documentation is provided in the Python code to outline what each section of code does. For this data recipe we are extracting the “TotalColWaterVapor” parameter from the HDF-EOS5 file to create the GeoTIFF file.

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 64). Again, the backslashes need to be changed to forward slashes.

Step 4

Read ‘TotalColWaterVapor’, latitude, and longitude values from the input file.

Step 5

Call the remapping function ‘remapSwath()’ from ConvSwath.py to remap SWATH data to epsg4326 projection.

Step 6

Create and save a GEOTIFF file to a folder on your computer. Line 100 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 1, 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 7

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

 

Example of Geotiff files created by geotiff_rain.py:

Dataset Name NRT AMSR2 Unified Global Swath Surface Precipitation GSFC Profiling Algorithm
Platform Global Change Observation Mission - Water 1 (GCOM-W1) 
Instrument Advanced Microwave Radiometer 2 (AMSR2)
Science Parameter Total Column Water Vapor
Format HDF-EOS5
Data Information Data information

 

Variable Description Dimension Units Scale Factor
TotalColWaterVapor Integrated water vapor in the atmospheric column 2D mm none

 

Have you used our data? Register for updates