Skip to content

Commit

Permalink
clarify fetch in tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadtourei committed Dec 16, 2024
1 parent 3001b76 commit ec85024
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
13 changes: 10 additions & 3 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorial/patch.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```


Expand Down
13 changes: 9 additions & 4 deletions docs/tutorial/spool.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand All @@ -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()
Expand Down

0 comments on commit ec85024

Please sign in to comment.