## 4. Convert to NetCDF file --- ### Introduction There is always a need to convert [GrADS](http://cola.gmu.edu/grads/) dataset into [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) format, because [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) is self-describing. This is equivalent to combining both the CTL file and binary data file into a single (`.nc`) one. --- ### Converting Since the loading of CTL dataset is simple, and also that we could make use of [xarray](https://docs.xarray.dev/en/stable/)'s `to_netcdf()` function, the whole converting process is simple: ```python from xgrads import open_CtlDataset open_CtlDataset('input.ctl').to_netcdf('output.nc') ```