sdf_xarray.download.fetch_dataset#
- sdf_xarray.download.fetch_dataset(dataset_name, save_path=None)[source]#
Downloads the specified dataset from its Zenodo URL. If it is already downloaded, then the path to the cached, unzipped directory is returned.
- Parameters:
dataset_name (
Literal['test_array_no_grids','test_dist_fn','test_files_1D','test_files_2D_moving_window','test_files_3D','test_mismatched_files','test_two_probes_2D','tutorial_dataset_1d','tutorial_dataset_2d','tutorial_dataset_2d_moving_window','tutorial_dataset_3d','1_1_drifting_bunch','2_1_two_stream_instability','3_3_Gaussian_1d_laser','3_5_Gaussian_beam','4_2_self_heating','4_3_basic_target','4_4_momentum_distribution','5_1_probe','5_2_subsets']) – The name of the dataset to downloadsave_path (
Path|str|None) – The directory to save the dataset to (defaults to the cache folder"sdf_datasets". Seepooch.os_cachefor details on how the cache works)
- Returns:
The path to the directory containing the unzipped dataset files
- Return type:
Path
Examples
>>> # Assuming the dataset has not been downloaded yet >>> path = fetch_dataset("tutorial_dataset_1d") Downloading file 'tutorial_dataset_1d.zip' ... Unzipping contents of '.../sdf_datasets/tutorial_dataset_1d.zip' to '.../sdf_datasets/tutorial_dataset_1d' >>> path '.../sdf_datasets/tutorial_dataset_1d'