File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,39 @@ You can specify the input as ``grib`` to read the data from a GRIB file.
5151
5252For more options, see :ref: `grib-input `.
5353
54+ ********
55+ netcdf
56+ ********
57+
58+ You can specify the input as ``netcdf `` to read the data from a NetCDF
59+ file.
60+
61+ .. literalinclude :: yaml/inputs_5.yaml
62+ :language: yaml
63+
64+ .. note ::
65+
66+ The netcdf input expects the data to be stored identically to the
67+ GRIB input, i.e. with a values coordinate, and variable names that
68+ match what the checkpoint was trained on.
69+
70+ For context, using ``earthkit-data `` a grib file can be exported as
71+ netcdf with the following and then read back in using the netcdf
72+ input, note how the names are created:
73+
74+ .. code :: python
75+
76+ import earthkit.data as ekd
77+
78+ ds = ekd.from_source(" file" , " input.grib" )
79+
80+ ds_xr = ds.to_xarray(
81+ variable_key = " p_l" ,
82+ remapping = {" p_l" : " {param} _{levelist} " },
83+ add_earthkit_attrs = False ,
84+ )
85+ ds_xr.to_netcdf(" input.nc" )
86+
5487******
5588 mars
5689******
Original file line number Diff line number Diff line change 1+ input :
2+ netcdf : /path/to/netcdf/file.nc
You can’t perform that action at this time.
0 commit comments