yadg.extractors package
- yadg.extractors.extract(filetype, path)
Worker function of the
extract
subcommand.Extracts data from provided
path
, assuming it is the specifiedfiletype
. The data is either returned as adatatree.DataTree
or axarray.Dataset
, however in either case the returned objects have aret.to_netcdf()
as well as aret.to_dict()
method, which can be used to write the file.Warning
This feature has been introduced in
yadg-5.0a2
and is unstable.- Parameters:
filetype (
str
) – Specifies the filetype. Can be bothyadg
-native as well as a MaRDA extractorsFileType
. Automatically checks for matches using themarda:
prefix.path (
Path
) – Apathlib.Path
object pointing to the file to be extracted.
- Returns:
The extracted data and metadata, which can be written to
NetCDF
format usingret.to_netcdf()
.- Return type:
Union[xr.Dataset, datatree.DataTree]