I'm coming from Reading metadata in HDF5 file.
I have a HDF5 file with some radar information. I'd like to read this data and geospatial metadata contained in the file to produce a GeoTIFF. Using the accepted answer, I can read the metadata, but I'm not sure how to convert it to something that rasterio
can understand to produce a valid CRS
and transform
that allow to georeference the field.
Right now, the metadata I can get from the HDF5 are these two dicts:
{'projection_indication': b'Y',
'projection_name': b'STEREOGRAPHIC',
'projection_proj4_params': b'+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378.14 +b=6356.75 +x_0=0 y_0=0'}
{'geo_column_offset': array([0.], dtype=float32),
'geo_dim_pixel': b'KM,KM',
'geo_number_columns': array([700], dtype=int32),
'geo_number_rows': array([765], dtype=int32),
'geo_par_pixel': b'X,Y',
'geo_pixel_def': b'LU',
'geo_pixel_size_x': array([1.0000035], dtype=float32),
'geo_pixel_size_y': array([-1.0000048], dtype=float32),
'geo_product_corners': array([ 0. , 49.362064, 0. , 55.973602, 10.856453, 55.388973,
9.0093 , 48.8953 ], dtype=float32),
'geo_row_offset': array([3649.982], dtype=float32)}
From the former I can easily obtain the CRS
, but I don't fully understand the meaning of the parameters in the latter, although I'm pretty sure they implicitly define the transform
.
How can this be used to produce a regular CRS
and tranform
understandable by rasterio
?