Skip to content

Commit 105fb67

Browse files
authored
Merge pull request #23 from terraref/geostreams-guide
add geostreams tutorial
2 parents 9c5a3c6 + 3accf02 commit 105fb67

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
You can also filter the datapoints by date:
38+
```
39+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/datapoints?stream_id={STREAM_ID}&since=2017-01-02&until=2017-06-10
40+
```
41+
42+
## Getting ROGER file path from dataset
43+
Given a source dataset URL, we can call the API to get the files and their paths.
44+
```
45+
SOURCE_DATASET = "https://terraref.ncsa.illinois.edu/clowder/datasets/59fc9e7d4f0c3383c73d2905"
46+
# Add /api after /clowder, and add /files at the end of the URL
47+
GET "https://terraref.ncsa.illinois.edu/clowder/api/datasets/59fc9e7d4f0c3383c73d2905/files"
48+
```
49+
50+
This returns a list of files in the dataset and their paths if available:
51+
```
52+
[
53+
{
54+
size: "346069",
55+
date-created: "Fri Nov 03 11:51:13 CDT 2017",
56+
id: "59fc9e814f0c3383c73d2962",
57+
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",
58+
contentType: "image/png",
59+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.png"
60+
},
61+
{
62+
size: "1231298",
63+
date-created: "Fri Nov 03 11:51:16 CDT 2017",
64+
id: "59fc9e844f0c3383c73d2980",
65+
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",
66+
contentType: "image/tiff",
67+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.tif"
68+
}
69+
]
70+
```
71+
72+
Depending on permissions you may need to provide authentication to get this list.

0 commit comments

Comments
 (0)