0

I have created with xarray a netcdf of rainfall every 5 minutes. With Hec HMS 4.11 I can convert it to DSS format, the problem is that when converting it, only the start column is imported but also the end column of each interval. Any ideas so that when I convert it to DSS I complete the final column?

Files (netcdf and DSS): https://drive.google.com/file/d/17KCpg2kBoeMa3UHKSm57IpsyQ0Q9zDsl/view?usp=sharing

lista=[]
for column in gdf.columns[:]:
    

    try:
        
        fecha=pd.to_datetime(column, format='%Y-%m-%d %H:%M:%S') #si la columna no es una fecha sale del TRY
        geo_grid_cubic = make_geocube(
                                        gdf,
                                        measurements=[column],
                                        resolution=(-25, 25),
                                        rasterize_function=partial(rasterize_points_griddata, method="cubic"),)
        geo_grid_cubic = geo_grid_cubic.rio.clip(contorno.geometry.values, contorno.crs)
        
        #añado dimension con la fecha
        da=geo_grid_cubic.assign_coords(time = fecha)  
        da = da.expand_dims(dim="time")
        da=da.rename({column: 'Precipitation'})
        da['Precipitation'].attrs['name'] = 'Precipitation'
        da['Precipitation'].attrs['long_name'] = 'Precipitation'
        lista.append(da)
        print(column)
        
    except:pass
    
geotiff_da =xr.combine_by_coords(lista)
geotiff_da  = geotiff_da .rename({'x': 'longitude','y': 'latitude'})
geotiff_da.rio.write_crs("epsg:25830", inplace=True)

Convert netcdf to dss

0 Answers0