View source: R/AgroSoil_generic_functions.R
h5_to_tiff | R Documentation |
Loads SMAP Level 4 Global 3-hourly at 9 km Soil moisture product and converts them into .tif files for easy further data processing. In addition, the output .tif file is reprojected into WGS84.
h5_to_tiff(h5.lst, mapInfo.crs_EASE2, mapInfo.crs_WGS84, out_dir)
h5.lst |
Path to folder containing downloaded SMAP .h5 files |
mapInfo.crs_EASE2 |
SMAP CRS string. E.g. CRS("+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") |
mapInfo.crs_WGS84 |
Destination Raster file's crs. |
out_dir |
Path to folder to write .tif raster files |
library(rhdf5) library(raster) h5.lst <- list.files(".h5 folder path", pattern = glob2rx("*.h5"), full.names = T) mapInfo.crs_EASE2 <- CRS("+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") mapInfo.crs_WGS84 <- CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0") out_dir <- path to folder for writing .tif files h5_to_tiff(h5.lst, mapInfo.crs_EASE2, mapInfo.crs_WGS84, out_dir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.