From ec85024f6a5fb8a3cc9bb59a4a3efaf44acd0637 Mon Sep 17 00:00:00 2001 From: ahmadtourei Date: Mon, 16 Dec 2024 11:38:15 -0700 Subject: [PATCH] clarify fetch in tutorials --- docs/index.qmd | 13 ++++++++++--- docs/tutorial/patch.qmd | 4 ++++ docs/tutorial/spool.qmd | 13 +++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/docs/index.qmd b/docs/index.qmd index ea003ce5..fde0d200 100644 --- a/docs/index.qmd +++ b/docs/index.qmd @@ -39,10 +39,13 @@ print(out_str) ```{python} import dascore as dc -from dascore.utils.downloader import fetch +# Import fetch to read DASCore example files +from dascore.utils.downloader import fetch -# get a path to an example file, replace with your path +# Fetch a sample file path from DASCore file_path = fetch('terra15_das_1_trimmed.hdf5') +# To read DAS data stored locally on your machine, simply replace the above line with: +# file_path = "/path/to/data/directory/data.EXT" spool = dc.spool(file_path) patch = spool[0] @@ -53,10 +56,14 @@ patch = spool[0] ```{python} #| output: false import dascore as dc +# Import fetch to read DASCore example files from dascore.utils.downloader import fetch -# get a path to a directory of das files, replace with your path +# Fetch a sample file path from DASCore (just to get a usable path for the rest of the cell) directory_path = fetch('terra15_das_1_trimmed.hdf5').parent +# To read a directory of DAS data stored locally on your machine, +# simply replace the above line with: +# directory_path = "/path/to/data/directory/" spool = ( # Create a spool to interact with directory data diff --git a/docs/tutorial/patch.qmd b/docs/tutorial/patch.qmd index 1d30bdea..4d12b2b0 100644 --- a/docs/tutorial/patch.qmd +++ b/docs/tutorial/patch.qmd @@ -37,9 +37,13 @@ A single file can be loaded like this: #| code-fold: true # This codeblock is just to get a usable path for the next cell. import dascore as dc +# Import fetch to read DASCore example files from dascore.utils.downloader import fetch + path = fetch("terra15_das_1_trimmed.hdf5") +# To read DAS data stored locally on your machine, simply replace the above line with: +# path = "/path/to/data/directory/data.EXT" ``` diff --git a/docs/tutorial/spool.qmd b/docs/tutorial/spool.qmd index a5d88c52..657f3b12 100644 --- a/docs/tutorial/spool.qmd +++ b/docs/tutorial/spool.qmd @@ -24,9 +24,12 @@ spool1 = dc.spool(patch_list) ```{python} import dascore as dc +# Import fetch to read DASCore example files from dascore.utils.downloader import fetch path_to_das_file = fetch("terra15_das_1_trimmed.hdf5") +# To read DAS data stored locally on your machine, simply replace the above line with: +# path_to_das_file = "/path/to/data/directory/data.EXT" spool2 = dc.spool(path_to_das_file) ``` @@ -35,12 +38,14 @@ spool2 = dc.spool(path_to_das_file) ```{python} import dascore as dc +# Import fetch to read DASCore example files from dascore.utils.downloader import fetch -# We use fetch to make sure the file is downloaded. You would -# just need to replace directory_path with your data directory path. -path_to_das_file = fetch("terra15_das_1_trimmed.hdf5") -directory_path = path_to_das_file.parent +# Fetch a sample file path from DASCore (just to get a usable path for the rest of the cell) +directory_path = fetch('terra15_das_1_trimmed.hdf5').parent +# To read a directory of DAS data stored locally on your machine, +# simply replace the above line with: +# directory_path = "/path/to/data/directory/" # Update will create an index of the contents for fast querying/access spool3 = dc.spool(directory_path).update()