Skip to content
Prev 28807 / 29559 Next

Question on hierarchical data format 5 .h5 file format

Gabriel shared the data with me (off-list, 1Gb) and it contains two hdf5 
datasets, one containing the raster of the longitude and latitude, the 
other rasters with the attributres (LST) but no coordinates. I could get 
a (rough: factor 50 downsampling) plot with stars using:

library(stars) 

lat = 
read_stars("HDF5:ECOSTRESS_L1B_GEO_11712_012_20200730T061029_0601_01.h5://Geolocation/latitude")
lon = 
read_stars("HDF5:ECOSTRESS_L1B_GEO_11712_012_20200730T061029_0601_01.h5://Geolocation/longitude")

var = 
"HDF5:ECOSTRESS_L2_LSTE_11712_012_20200730T061029_0601_01.h5://SDS/LST" 

lst = read_stars(var, curvilinear = list(x = lon, y = lat)) 

plot(lst, downsample = 50, axes = TRUE, reset = FALSE)

library(rnaturalearth)
ne = ne_countries(returnclass = "sf") 

plot(st_geometry(ne), add = TRUE, border = 'yellow')
# california border seems to make sense


but I'm not sure how to make a regular raster (in some CRS) out of this 
for exporting to GeoTIFF.
On 14/11/2021 11:00, Edzer Pebesma wrote: