PyDDA wind retrieval using single DWR

Is there any example notebook available to use pydda for single DWR?

Hello, you would simply use the same workflows, but only use one Grid in the list of grids input into pydda.retrieval.get_dd_wind_field. Hope this helps!

Thanks @rcjackson for the suggestion. I tried the way but while initializing using era5 I am getting an error as “Grid is not subscriptable”. Can u please suggest what can be done to resolve it.

Command:

Grid1 = pydda.initialization.wind_fields.make_initialization_from_era5(Grid1, vel_field=‘corrected_velocity’, dest_era_file=f’./ERA_{str(xg1.time.dt.strftime(“%Y%m%d_%H%M%S”).values[0])}.nc’)

Error Msg:

TypeError Traceback (most recent call last)
/tmp/ipykernel_87775/582985091.py in
----> 1 Grid1 = pydda.initialization.wind_fields.make_initialization_from_era5(Grid1, vel_field=‘corrected_velocity’,
2 dest_era_file=f’./ERA_{str(xg1.time.dt.strftime(“%Y%m%d_%H%M%S”).values[0])}.nc’)

~/anaconda3/lib/python3.9/site-packages/pydda/initialization/wind_fields.py in make_initialization_from_era5(Grid, file_name, vel_field, dest_era_file, method)
93
94 grid_time = datetime.strptime(
—> 95 Grid[“time”].attrs[“units”], “seconds since %Y-%m-%dT%H:%M:%SZ”
96 )
97 hour_rounded_to_nearest_1 = int(round(float(grid_time.hour)))

TypeError: ‘Grid’ object is not subscriptable

Hello,

PyDDA 2.0 now uses an xarray-based Grid object for analysis. So, chances are, you probably loaded the grid using pyart.io.read_grid. We now have a function pydda.io.read_grid that will load this into the proper format for you.

Much regards,

Bobby