def convert_hdf5_to_netcdf4(input_file, output_file): ds = xr.open_dataset(input_file) chl = ds['chlor_a'].to_dataset() chl.to_netcdf(output_file, format='NETCDF4_CLASSIC')