Skip to content

Commit faa8c11

Browse files
author
Max Burnette
committed
add geostreams tutorial
1 parent 9c5a3c6 commit faa8c11

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Generating file lists by plot
2+
3+
## Finding plot ID
4+
```
5+
SENSOR_NAME = "MAC Field Scanner Season 1 Field Plot 101 W"
6+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/sensors?sensor_name={SENSOR_NAME}
7+
```
8+
9+
This returns a JSON object with an 'id' parameter. You can use this ID parameter to specify the right data stream.
10+
11+
## Finding stream ID within a plot
12+
The names are formatted as "<Sensor Group> Datasets (<Sensor ID>)".
13+
```
14+
SENSOR_ID = 3355
15+
STREAM_NAME = "Thermal IR GeoTIFFs Datasets ({SENSOR_ID})"
16+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/streams?stream_name={STREAM_NAME}
17+
```
18+
19+
This returns a JSON object with an 'id' parameter. You can use this ID parameter to get the right datapoints.
20+
21+
## Listing Clowder file IDs for that plot & sensor stream
22+
```
23+
STREAM_ID = "11586"
24+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/datapoints?stream_id={STREAM_ID}
25+
```
26+
27+
This returns a list of datapoint JSON objects, each with a 'properties' parameter that looks like:
28+
```
29+
properties: {
30+
dataset_name: "Thermal IR GeoTIFFs - 2016-05-09__12-07-57-990",
31+
source_dataset: "https://terraref.ncsa.illinois.edu/clowder/datasets/59fc9e7d4f0c3383c73d2905"
32+
},
33+
```
34+
35+
The source_dataset URL can be used to view the dataset in Clowder.
36+
37+
## Getting ROGER file path from dataset
38+
Given a source dataset URL, we can call the API to get the files and their paths.
39+
```
40+
SOURCE_DATASET = "https://terraref.ncsa.illinois.edu/clowder/datasets/59fc9e7d4f0c3383c73d2905"
41+
# Add /api after /clowder, and add /files at the end of the URL
42+
GET "https://terraref.ncsa.illinois.edu/clowder/api/datasets/59fc9e7d4f0c3383c73d2905/files"
43+
```
44+
45+
This returns a list of files in the dataset and their paths if available:
46+
```
47+
[
48+
{
49+
size: "346069",
50+
date-created: "Fri Nov 03 11:51:13 CDT 2017",
51+
id: "59fc9e814f0c3383c73d2962",
52+
filepath: "/home/clowder/sites/ua-mac/Level_1/ir_geotiff/2016-05-09/2016-05-09__12-07-57-990/ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.png",
53+
contentType: "image/png",
54+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.png"
55+
},
56+
{
57+
size: "1231298",
58+
date-created: "Fri Nov 03 11:51:16 CDT 2017",
59+
id: "59fc9e844f0c3383c73d2980",
60+
filepath: "/home/clowder/sites/ua-mac/Level_1/ir_geotiff/2016-05-09/2016-05-09__12-07-57-990/ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.tif",
61+
contentType: "image/tiff",
62+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.tif"
63+
}
64+
]
65+
```
66+
67+
Depending on permissions you may need to provide authentication to get this list.

0 commit comments

Comments
 (0)