Dear counterparts,
Hope all is well.
I'm reading HSAF file and trying to reproject it to new grid using pyresample.
I'm getting the attached error message.
Maybe you have a solution.
Your help will be appreciated.
Elyakom Vadislavsky
IMS
My code:
# SEE domain
# lon : 4.05 to 45.25 by 0.1 degrees_east
# lat : 25.05 to 52.95 by 0.1 degrees_north
dx = dy = 0.1
lon_min = 4.05
lon_max = 45.25
lat_min = 25.05
lat_max = 52.95
# Area definitions for satpy resample
area_id = "SEE" # Identifier for the area
description = "South East Europe domain" # Human-readable description of the area
proj_id = "WGS84" # ID of projection
projection = CRS.from_epsg(4326) #, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' # Dictionary or string with Proj.4 parameters
width = int((lon_max-lon_min)/dx+1) # x dimension in number of pixels, aka number of grid columns
height = int((lat_max-lat_min)/dy+1) # y dimension in number of pixels, aka number of grid rows
area_extent_ll = (lon_min,lat_min,lon_max,lat_max) # Area extent in lons lats as a tuple (lower_left_lon, lower_left_lat, upper_right_lon, upper_right_lat)
pixel_size_x = dx
pixel_size_y = dy
scn=Scene(reader='hsaf_grib', filenames=[grib])
print(scn.available_dataset_names())
scn.load(['h05B'])
my_area = AreaDefinition(area_id, description, proj_id, projection, width, height, area_extent_ll,pixel_size_x,pixel_size_y )
print(my_area)
local_scene = scn.resample(my_area)
error message:
File "/ims_home/vadislavskye/.local/lib/python3.9/site-packages/pyresample/geometry.py", line 2288, in get_proj_coords
raise ValueError("'rotation' is not supported with dask operations.")
ValueError: 'rotation' is not supported with dask operations.
Dear Dave and Martin,
Thank you very much for your fast response and major help.
I've followed your comments and managed to resample the HSAF grib to the target grid domain.
It went smoothly, really an elegant solution, applause to the PYTROLL team.
Also I've exported the data to NetCDF using satpy.
Attached image.
Best regards,
Elyakom
P.S
The inconsistency in the output image is sourced in the grib data and not due to the resampling process.
-----------------------------------------------------------------------------------------------------------------------------------