data.datasource_to_file¶
Import path: earth2studio.data.datasource_to_file
Documentation¶
Utility function that can be used for building a local data store needed
for an inference request. This file can then be used with the
earth2studio.data.DataArrayFile data source to load data from file.
This is useful when multiple runs of the same input data is needed.
Parameters:
-
file_name(str) –File name of output NetCDF
-
source(DataSource) –The original data source to fetch from
-
time(list[str] | list[datetime] | list[datetime64]) –List of time strings, datetimes or np.datetime64 (UTC)
-
variable(VariableArray) –Strings or list of strings that refer to variables to return
-
lead_time(LeadTimeArray, default:array([timedelta64(0, 'h')])) –Lead times to fetch for each provided time, by default np.array(np.timedelta64(0, "h"))
-
backend(Literal['netcdf', 'zarr'], default:'netcdf') –Storage backend to save output file as, by default "netcdf"
-
chunks(dict[str, int], default:{'variable': 1}) –Chunk sizes along each dimension, by default {"variable": 1}
-
dtype(dtype, default:None) –Data type for storing data
-
backend_kwargs(dict[str, Any], default:{}) –Dictionary of keyword arguments forwarded to the underlying
xarray.DataArray.to_netcdf/xarray.DataArray.to_zarrcall depending on the selected backend.