In this data recipe, learn how to convert NASA's Land, Atmosphere Near real-time Capability for Earth observation (LANCE) Near Real-Time (NRT) AMSR2 Ocean data to GeoTIFF Format using Python. This code converts total precipitable water (‘TotalPrecipitableWater’) in the AMSR2 NRT Ocean product in HDF-EOS5 format to GeoTIFF.
Supporting Software Information
The Python script used in this data recipe is open source.
How to Use
This code converts total precipitable water (‘TotalPrecipitableWater’) in the AMSR2 NRT Ocean product in HDF-EOS5 format to GeoTIFF.
Step 1
Navigate to the folder on your computer where you have saved the AMSR2 NRT Ocean 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 51). 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 Ocean 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 “TotalPrecipitableWater” 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 67). Again, the backslashes need to be changed to forward slashes.
Step 4
Read ‘TotalPrecipitableWater’, 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 103 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.
Dataset Information
Dataset Name | NRT AMSR2 Unified L2B Global Swath Ocean Products |
---|---|
Platform | Global Change Observation Mission - Water 1 (GCOM-W1) |
Instrument | Advanced Microwave Radiometer 2 (AMSR2) |
Science Parameter | Total Precipitable Water |
Format | HDF-EOS5 |
Data Information | CMR Search |
Key Parameters
Variable | Description | Dimension | Units | Scale Factor |
---|---|---|---|---|
TotalPrecipitableWater | Integrated water vapor in the atmospheric column | 2D | mm | none |