convert_lc_ascii_to_nc#
- mhm_tools.pre.landcover_ascii_to_nc.convert_lc_ascii_to_nc(input_nml: str | Path, output: str | Path, var_name: str | None = 'land_cover', normalize_latlon: bool = False) None[source]#
Workflow for converting landcover ASCII files to NetCDF.
Parse mHM namelist for landcover blocks (paths, years).
Read each ASCII landcover file into xarray.
Concatenate along new ‘time’ dimension.
Add CF-style numeric time + time_bnds.
Write NetCDF.
Notes
Supports any number of ASCII tiles (1, 2, …).
The last time bound ends at (max(year_end)+1)-01-01.
By default the data variable is called ‘land_cover’. You can override that with var_name=….